From 4a4e6adae4c1a0e9ab3b6fad477edfe26c1a2aca Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 14 Jun 2016 17:06:50 +0100 Subject: 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. --- source/fitz/filter-predict.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/fitz/filter-predict.c') diff --git a/source/fitz/filter-predict.c b/source/fitz/filter-predict.c index 3136c651..02475c41 100644 --- a/source/fitz/filter-predict.c +++ b/source/fitz/filter-predict.c @@ -59,7 +59,7 @@ static inline int paeth(int a, int b, int c) } static void -fz_predict_tiff(fz_predict *state, unsigned char *out, unsigned char *in, int len) +fz_predict_tiff(fz_predict *state, unsigned char *out, unsigned char *in) { int left[FZ_MAX_COLORS]; int i, k; @@ -95,14 +95,14 @@ fz_predict_tiff(fz_predict *state, unsigned char *out, unsigned char *in, int le } static void -fz_predict_png(fz_predict *state, unsigned char *out, unsigned char *in, int len, int predictor) +fz_predict_png(fz_predict *state, unsigned char *out, unsigned char *in, size_t len, int predictor) { int bpp = state->bpp; - int i; + size_t i; unsigned char *ref = state->ref; - if (bpp > len) - bpp = len; + if ((size_t)bpp > len) + bpp = (int)len; switch (predictor) { @@ -157,14 +157,14 @@ fz_predict_png(fz_predict *state, unsigned char *out, unsigned char *in, int len } static int -next_predict(fz_context *ctx, fz_stream *stm, int len) +next_predict(fz_context *ctx, fz_stream *stm, size_t len) { fz_predict *state = stm->state; unsigned char *buf = state->buffer; unsigned char *p = buf; unsigned char *ep; int ispng = state->predictor >= 10; - int n; + size_t n; if (len >= sizeof(state->buffer)) len = sizeof(state->buffer); @@ -182,7 +182,7 @@ next_predict(fz_context *ctx, fz_stream *stm, int len) if (state->predictor == 1) memcpy(state->out, state->in, n); else if (state->predictor == 2) - fz_predict_tiff(state, state->out, state->in, n); + fz_predict_tiff(state, state->out, state->in); else { fz_predict_png(state, state->out, state->in + 1, n - 1, state->in[0]); -- cgit v1.2.3