]> granicus.if.org Git - openjpeg/commitdiff
[trunk] Remove easy to fix warnings about conversion
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Mon, 3 Mar 2014 12:00:24 +0000 (12:00 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Mon, 3 Mar 2014 12:00:24 +0000 (12:00 +0000)
src/bin/common/color.c
src/bin/jp2/opj_decompress.c
src/lib/openjp2/dwt.c

index f18eb801d5becb2a583407c4f0d76259bda381c2..6cb98497b8c15ba1511d03c31ce699838f053c6c 100644 (file)
@@ -388,7 +388,8 @@ fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tcmsCreateTransform failed. "
        if(image->numcomps > 2)/* RGB, RGBA */
    {
        unsigned short *inbuf, *outbuf, *in, *out;
-       max = max_w * max_h; nr_samples = max * 3 * sizeof(unsigned short);
+       max = max_w * max_h;
+  nr_samples = (cmsUInt32Number)(max * 3 * sizeof(unsigned short));
        in = inbuf = (unsigned short*)malloc(nr_samples);
        out = outbuf = (unsigned short*)malloc(nr_samples);
 
index b2e4e83cfbb2efcf61ebcc1495a63b9edb3cc1a0..dd1a07753ca7d32274765da3af345378dc8b4fb0 100644 (file)
@@ -271,7 +271,7 @@ static int infile_format(const char *fname)
        const char *s, *magic_s;
        int ext_format, magic_format;
        unsigned char buf[12];
-       unsigned int l_nb_read;
+       OPJ_SIZE_T l_nb_read;
 
        reader = fopen(fname, "rb");
 
index 7d87a9f876b40225c9048c8d76b74394535abc10..c617ffcfb6982af2e082e622f0177742181b34dc 100644 (file)
@@ -404,7 +404,7 @@ INLINE OPJ_BOOL opj_dwt_encode_procedure(opj_tcd_tilecomp_t * tilec,void (*p_fun
        rw = l_cur_res->x1 - l_cur_res->x0;
        rh = l_cur_res->y1 - l_cur_res->y0;
 
-       l_data_size = opj_dwt_max_resolution( tilec->resolutions,tilec->numresolutions) * sizeof(OPJ_INT32);
+       l_data_size = opj_dwt_max_resolution( tilec->resolutions,tilec->numresolutions) * (OPJ_UINT32)sizeof(OPJ_INT32);
        bj = (OPJ_INT32*)opj_malloc(l_data_size);
        if (! bj) {
                return OPJ_FALSE;