diff options
Diffstat (limited to 'source/tools')
-rw-r--r-- | source/tools/murun.c | 9 | ||||
-rw-r--r-- | source/tools/mutool.c | 2 | ||||
-rw-r--r-- | source/tools/pdfextract.c | 2 | ||||
-rw-r--r-- | source/tools/pdfinfo.c | 4 | ||||
-rw-r--r-- | source/tools/pdfshow.c | 6 |
5 files changed, 12 insertions, 11 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c index 0b36e727..6d14f99f 100644 --- a/source/tools/murun.c +++ b/source/tools/murun.c @@ -101,7 +101,8 @@ static void jsB_read(js_State *J) const char *filename = js_tostring(J, 1); FILE *f; char *s; - int n, t; + long n; + size_t t; f = fopen(filename, "rb"); if (!f) { @@ -146,7 +147,7 @@ static void jsB_read(js_State *J) static void jsB_readline(js_State *J) { char line[256]; - int n; + size_t n; if (!fgets(line, sizeof line, stdin)) js_error(J, "cannot read line from stdin"); n = strlen(line); @@ -556,7 +557,7 @@ static int ffi_buffer_has(js_State *J, void *buf_, const char *key) fz_buffer *buf = buf_; int idx; if (is_number(key, &idx)) { - if (idx < 0 || idx >= buf->len) + if (idx < 0 || (size_t)idx >= buf->len) js_rangeerror(J, "index out of bounds"); js_pushnumber(J, buf->data[idx]); return 1; @@ -573,7 +574,7 @@ static int ffi_buffer_put(js_State *J, void *buf_, const char *key) fz_buffer *buf = buf_; int idx; if (is_number(key, &idx)) { - if (idx < 0 || idx >= buf->len) + if (idx < 0 || (size_t)idx >= buf->len) js_rangeerror(J, "index out of bounds"); buf->data[idx] = js_tonumber(J, -1); return 1; diff --git a/source/tools/mutool.c b/source/tools/mutool.c index 20f4f957..97c74fae 100644 --- a/source/tools/mutool.c +++ b/source/tools/mutool.c @@ -46,7 +46,7 @@ static struct { static int namematch(const char *end, const char *start, const char *match) { - int len = strlen(match); + size_t len = strlen(match); return ((end-len >= start) && (strncmp(end-len, match, len) == 0)); } diff --git a/source/tools/pdfextract.c b/source/tools/pdfextract.c index 80c25c2b..2a3689c5 100644 --- a/source/tools/pdfextract.c +++ b/source/tools/pdfextract.c @@ -91,7 +91,7 @@ static void savefont(pdf_obj *dict, int num) char *ext = ""; fz_output *out; char *fontname = "font"; - int len; + size_t len; unsigned char *data; obj = pdf_dict_get(ctx, dict, PDF_NAME_FontName); diff --git a/source/tools/pdfinfo.c b/source/tools/pdfinfo.c index 9df8e182..fcede5f7 100644 --- a/source/tools/pdfinfo.c +++ b/source/tools/pdfinfo.c @@ -754,7 +754,7 @@ printinfo(fz_context *ctx, globals *glo, char *filename, int show, int page) if (!strncmp(cs, "Device", 6)) { - int len = strlen(cs + 6); + size_t len = strlen(cs + 6); memmove(cs + 3, cs + 6, len + 1); cs[3 + len + 1] = '\0'; } @@ -773,7 +773,7 @@ printinfo(fz_context *ctx, globals *glo, char *filename, int show, int page) if (!strncmp(altcs, "Device", 6)) { - int len = strlen(altcs + 6); + size_t len = strlen(altcs + 6); memmove(altcs + 3, altcs + 6, len + 1); altcs[3 + len + 1] = '\0'; } diff --git a/source/tools/pdfshow.c b/source/tools/pdfshow.c index 988663a4..d56cbcd6 100644 --- a/source/tools/pdfshow.c +++ b/source/tools/pdfshow.c @@ -70,9 +70,9 @@ static void showpagetree(void) fz_printf(ctx, out, "\n"); } -static void showsafe(unsigned char *buf, int n) +static void showsafe(unsigned char *buf, size_t n) { - int i; + size_t i; for (i = 0; i < n; i++) { if (buf[i] == '\r' || buf[i] == '\n') { putchar('\n'); @@ -97,7 +97,7 @@ static void showstream(int num, int gen) { fz_stream *stm; unsigned char buf[2048]; - int n; + size_t n; showcolumn = 0; |