From 963283d7d0c89bf097c3be4b123c8e58d9d306c0 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 24 Feb 2014 14:27:02 +0000 Subject: [PATCH] [trunk] Fix warning about signed/unsigned mismatch --- tests/unit/testempty1.c | 10 +++++----- tests/unit/testempty2.c | 12 +++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/unit/testempty1.c b/tests/unit/testempty1.c index ed9d636f..01547e3d 100644 --- a/tests/unit/testempty1.c +++ b/tests/unit/testempty1.c @@ -57,15 +57,15 @@ int main(int argc, char *argv[]) const char * v = opj_version(); const OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_GRAY; - int numcomps = 1; + unsigned int numcomps = 1; int i; - int image_width = 256; - int image_height = 256; + unsigned int image_width = 256; + unsigned int image_height = 256; opj_cparameters_t parameters; - int subsampling_dx = 0; - int subsampling_dy = 0; + unsigned int subsampling_dx = 0; + unsigned int subsampling_dy = 0; opj_image_cmptparm_t cmptparm; opj_image_t *image; diff --git a/tests/unit/testempty2.c b/tests/unit/testempty2.c index e342e015..dbbbaf93 100644 --- a/tests/unit/testempty2.c +++ b/tests/unit/testempty2.c @@ -58,15 +58,15 @@ int main(int argc, char *argv[]) const char * v = opj_version(); const OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_GRAY; - int numcomps = 1; + unsigned int numcomps = 1; int i; - int image_width = 256; - int image_height = 256; + unsigned int image_width = 256; + unsigned int image_height = 256; opj_cparameters_t parameters; - int subsampling_dx = parameters.subsampling_dx; - int subsampling_dy = parameters.subsampling_dy; + unsigned int subsampling_dx; + unsigned int subsampling_dy; const char outputfile[] = "testempty2.j2k"; opj_image_cmptparm_t cmptparm; @@ -80,6 +80,8 @@ int main(int argc, char *argv[]) opj_set_default_encoder_parameters(¶meters); parameters.cod_format = J2K_CFMT; puts(v); + subsampling_dx = (unsigned int)parameters.subsampling_dx; + subsampling_dy = (unsigned int)parameters.subsampling_dy; cmptparm.prec = 8; cmptparm.bpp = 8; cmptparm.sgnd = 0;