From 32e7b1529bea8f4464a7f511ac86e7b30b0aa0c5 Mon Sep 17 00:00:00 2001 From: Antonin Descampe Date: Fri, 30 Apr 2004 09:20:22 +0000 Subject: Various corrections to avoid "signed/unsigned mismatch" warnings during compilation --- libopenjpeg/j2k.c | 2 +- libopenjpeg/tcd.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'libopenjpeg') diff --git a/libopenjpeg/j2k.c b/libopenjpeg/j2k.c index 3c427df3..df14b173 100644 --- a/libopenjpeg/j2k.c +++ b/libopenjpeg/j2k.c @@ -1347,7 +1347,7 @@ int j2k_decode_jpt_stream(unsigned char *src, int len, j2k_image_t ** img, return 0; } /* data-bin read -> need to read a new header */ - if ((cio_tell() - position) == header.Msg_length) { + if ((unsigned int)(cio_tell() - position) == header.Msg_length) { jpt_read_Msg_Header(&header); position = cio_tell(); if (header.Class_Id != 4) { /* 4 : Tile data-bin message */ diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c index fed44ecf..85b00038 100644 --- a/libopenjpeg/tcd.c +++ b/libopenjpeg/tcd.c @@ -130,9 +130,9 @@ void tcd_malloc_encode(j2k_image_t * img, j2k_cp_t * cp, int curtileno) /* Modification of the RATE >> */ for (j = 0; j < tcp->numlayers; j++) { tcp->rates[j] = - ceil(tile->numcomps * (tile->x1 - tile->x0) * + int_ceildiv(tile->numcomps * (tile->x1 - tile->x0) * (tile->y1 - - tile->y0) * img->comps[0].prec / (tcp->rates[j] * 8 * + tile->y0) * img->comps[0].prec , (tcp->rates[j] * 8 * img->comps[0].dx * img->comps[0].dy)); if (j && tcp->rates[j] < tcp->rates[j - 1] + 10) { @@ -389,9 +389,9 @@ void tcd_init_encode(j2k_image_t * img, j2k_cp_t * cp, int curtileno) /* Modification of the RATE >> */ for (j = 0; j < tcp->numlayers; j++) { tcp->rates[j] = - ceil(tile->numcomps * (tile->x1 - tile->x0) * + int_ceildiv(tile->numcomps * (tile->x1 - tile->x0) * (tile->y1 - - tile->y0) * img->comps[0].prec / (tcp->rates[j] * 8 * + tile->y0) * img->comps[0].prec , (tcp->rates[j] * 8 * img->comps[0].dx * img->comps[0].dy)); if (j && tcp->rates[j] < tcp->rates[j - 1] + 10) { @@ -580,8 +580,8 @@ void tcd_init_encode(j2k_image_t * img, j2k_cp_t * cp, int curtileno) void tcd_init(j2k_image_t * img, j2k_cp_t * cp) { - int tileno, compno, resno, bandno, precno, cblkno, i; - unsigned int x0 = 0, y0 = 0, x1 = 0, y1 = 0, w, h, j, p, q; + int tileno, compno, resno, bandno, precno, cblkno, i, j; + unsigned int x0 = 0, y0 = 0, x1 = 0, y1 = 0, w, h, p, q; tcd_img = img; tcd_cp = cp; tcd_image.tw = cp->tw; -- cgit v1.2.3