summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-06-14 17:06:50 +0100
committerRobin Watts <robin.watts@artifex.com>2016-06-17 13:24:47 +0100
commit4a4e6adae4c1a0e9ab3b6fad477edfe26c1a2aca (patch)
tree4ed45be7545229ce5d8bb124a8332b5444004b1b /platform/x11
parentc9bad4ef3e32bc799b134bc3b258f9392cf60e3e (diff)
downloadmupdf-4a4e6adae4c1a0e9ab3b6fad477edfe26c1a2aca.tar.xz
Use 'size_t' instead of int as appropriate.
This silences the many warnings we get when building for x64 in windows. This does not address any of the warnings we get in thirdparty libraries - in particular harfbuzz. These look (at a quick glance) harmless though.
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/curl_stream.c8
-rw-r--r--platform/x11/pdfapp.c6
-rw-r--r--platform/x11/win_main.c14
3 files changed, 14 insertions, 14 deletions
diff --git a/platform/x11/curl_stream.c b/platform/x11/curl_stream.c
index 9749f57c..4bce3527 100644
--- a/platform/x11/curl_stream.c
+++ b/platform/x11/curl_stream.c
@@ -316,13 +316,13 @@ fetcher_thread(curl_stream_state *state)
}
static int
-stream_next(fz_context *ctx, fz_stream *stream, int len)
+stream_next(fz_context *ctx, fz_stream *stream, size_t len)
{
curl_stream_state *state = (curl_stream_state *)stream->state;
- int len_read = 0;
- int read_point = stream->pos;
+ size_t len_read = 0;
+ fz_off_t read_point = stream->pos;
int block = read_point>>BLOCK_SHIFT;
- int left_over = (-read_point) & (BLOCK_SIZE-1);
+ size_t left_over = (-read_point) & (BLOCK_SIZE-1);
unsigned char *buf = state->public_buffer;
if (state->error != NULL)
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c
index bc0f5e23..55d5b5e3 100644
--- a/platform/x11/pdfapp.c
+++ b/platform/x11/pdfapp.c
@@ -863,12 +863,12 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai
if (drawpage)
{
char buf2[64];
- int len;
+ size_t len;
sprintf(buf2, " - %d/%d (%d dpi)",
app->pageno, app->pagecount, app->resolution);
len = MAX_TITLE-strlen(buf2);
- if ((int)strlen(app->doctitle) > len)
+ if (strlen(app->doctitle) > len)
{
snprintf(buf, len-3, "%s", app->doctitle);
strcat(buf, "...");
@@ -1109,7 +1109,7 @@ void pdfapp_onkey(pdfapp_t *app, int c, int modifiers)
if (app->issearching)
{
- int n = strlen(app->search);
+ size_t n = strlen(app->search);
if (c < ' ')
{
if (c == '\b' && n > 0)
diff --git a/platform/x11/win_main.c b/platform/x11/win_main.c
index f1731954..c686c240 100644
--- a/platform/x11/win_main.c
+++ b/platform/x11/win_main.c
@@ -52,7 +52,7 @@ static char filename[PATH_MAX];
RegCreateKeyExA(parent, name, 0, 0, 0, KEY_WRITE, 0, &ptr, 0)
#define SET_KEY(parent, name, value) \
- RegSetValueExA(parent, name, 0, REG_SZ, (const BYTE *)(value), strlen(value) + 1)
+ RegSetValueExA(parent, name, 0, REG_SZ, (const BYTE *)(value), (DWORD)strlen(value) + 1)
void install_app(char *argv0)
{
@@ -290,7 +290,7 @@ static char **cd_opts;
static char **cd_vals;
static int pd_okay = 0;
-INT CALLBACK
+INT_PTR CALLBACK
dlogpassproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
@@ -317,7 +317,7 @@ dlogpassproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
return FALSE;
}
-INT CALLBACK
+INT_PTR CALLBACK
dlogtextproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
@@ -354,7 +354,7 @@ dlogtextproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
return FALSE;
}
-INT CALLBACK
+INT_PTR CALLBACK
dlogchoiceproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND listbox;
@@ -455,7 +455,7 @@ int winchoiceinput(pdfapp_t *app, int nopts, char *opts[], int *nvals, char *val
return pd_okay;
}
-INT CALLBACK
+INT_PTR CALLBACK
dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
char buf[256];
@@ -536,7 +536,7 @@ void info()
winerror(&gapp, "cannot create info dialog");
}
-INT CALLBACK
+INT_PTR CALLBACK
dlogaboutproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
@@ -727,7 +727,7 @@ void windrawstring(pdfapp_t *app, int x, int y, char *s)
{
HFONT font = (HFONT)GetStockObject(ANSI_FIXED_FONT);
SelectObject(hdc, font);
- TextOutA(hdc, x, y - 12, s, strlen(s));
+ TextOutA(hdc, x, y - 12, s, (int)strlen(s));
}
void winblitsearch()