]> granicus.if.org Git - openjpeg/commitdiff
[trunk] removed warning from convert.c
authorMatthieu Darbois <mayeut@users.noreply.github.com>
Tue, 23 Dec 2014 16:03:45 +0000 (16:03 +0000)
committerMatthieu Darbois <mayeut@users.noreply.github.com>
Tue, 23 Dec 2014 16:03:45 +0000 (16:03 +0000)
Update  issue 442

src/bin/jp2/convert.c

index 4273141f009099f0791524ad401d5798b836a8d0..e6346ea903d4afb51bc5f499c4ee54d15d9dfe9a 100644 (file)
@@ -108,15 +108,15 @@ static void scale_component_up(opj_image_comp_t* component, OPJ_UINT32 precision
        
        len = (OPJ_SIZE_T)component->w * (OPJ_SIZE_T)component->h;
        if (component->sgnd) {
-               OPJ_INT64  newMax = (1U << (precision - 1));
-               OPJ_INT64  oldMax = (1U << (component->prec - 1));
+               OPJ_INT64  newMax = (OPJ_INT64)(1U << (precision - 1));
+               OPJ_INT64  oldMax = (OPJ_INT64)(1U << (component->prec - 1));
                OPJ_INT32* l_data = component->data;
                for (i = 0; i < len; ++i) {
                        l_data[i] = (OPJ_INT32)(((OPJ_INT64)l_data[i] * newMax) / oldMax);
                }
        } else {
-               OPJ_UINT64  newMax = (1U << precision) - 1U;
-               OPJ_UINT64  oldMax = (1U << component->prec) - 1U;
+               OPJ_UINT64  newMax = (OPJ_UINT64)((1U << precision) - 1U);
+               OPJ_UINT64  oldMax = (OPJ_UINT64)((1U << component->prec) - 1U);
                OPJ_UINT32* l_data = (OPJ_UINT32*)component->data;
                for (i = 0; i < len; ++i) {
                        l_data[i] = (OPJ_UINT32)(((OPJ_UINT64)l_data[i] * newMax) / oldMax);