[trunk] fixed warnings triggered on linux related to r2802
authorAntonin Descampe <antonin@gmail.com>
Wed, 26 Mar 2014 15:17:17 +0000 (15:17 +0000)
committerAntonin Descampe <antonin@gmail.com>
Wed, 26 Mar 2014 15:17:17 +0000 (15:17 +0000)
src/bin/jp2/convert.c
src/bin/jp2/opj_compress.c

index 0033b523a163fc71392068d738db7d8efc9916b9..a59c3c76edf86e153c9a5ed8c5e44eb0e693d974 100644 (file)
@@ -2989,8 +2989,8 @@ static opj_image_t* rawtoimage_common(const char *filename, opj_cparameters_t *p
         cmptparm[i].prec = (OPJ_UINT32)raw_cp->rawBitDepth;
         cmptparm[i].bpp = (OPJ_UINT32)raw_cp->rawBitDepth;
         cmptparm[i].sgnd = (OPJ_UINT32)raw_cp->rawSigned;
-        cmptparm[i].dx = (OPJ_UINT32)subsampling_dx * raw_cp->rawComps[i].dx;
-        cmptparm[i].dy = (OPJ_UINT32)subsampling_dy * raw_cp->rawComps[i].dy;
+        cmptparm[i].dx = (OPJ_UINT32)(subsampling_dx * raw_cp->rawComps[i].dx);
+        cmptparm[i].dy = (OPJ_UINT32)(subsampling_dy * raw_cp->rawComps[i].dy);
         cmptparm[i].w = (OPJ_UINT32)w;
         cmptparm[i].h = (OPJ_UINT32)h;
     }
index 8bd8b4d362d4e590825094c8737a3b828952a0e6..5957a467177787de10b47eb26e7876aca1141262 100644 (file)
@@ -575,13 +575,13 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
             char *sep;
             char signo;
             int width,height,bitdepth,ncomp;
-            int len;
+            OPJ_UINT32 len;
             OPJ_BOOL raw_signed;
             substr2 = strchr(opj_optarg,'@');
             if (substr2 == NULL) {
-                len = (int) strlen(opj_optarg);
+                len = (OPJ_UINT32) strlen(opj_optarg);
             } else {
-                len = substr2 - opj_optarg;
+                len = (OPJ_UINT32) (substr2 - opj_optarg);
                 substr2++; /* skip '@' character */
             }
             substr1 = (char*) malloc((len+1)*sizeof(char));
@@ -607,7 +607,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
                 raw_cp->rawComp = ncomp;
                 raw_cp->rawBitDepth = bitdepth;
                 raw_cp->rawSigned  = raw_signed;
-                raw_cp->rawComps = (raw_comp_cparameters_t*) malloc(ncomp*sizeof(raw_comp_cparameters_t));
+                raw_cp->rawComps = (raw_comp_cparameters_t*) malloc(((OPJ_UINT32)(ncomp))*sizeof(raw_comp_cparameters_t));
                 for (i = 0; i < ncomp && !wrong; i++) {
                     if (substr2 == NULL) {
                         raw_cp->rawComps[i].dx = lastdx;