]> Creatis software - gdcm.git/commitdiff
COMP: applying partial patch sent to jasper group, to please VS7.1
authormalaterre <malaterre>
Thu, 9 Jun 2005 22:01:59 +0000 (22:01 +0000)
committermalaterre <malaterre>
Thu, 9 Jun 2005 22:01:59 +0000 (22:01 +0000)
src/gdcmjasper/src/libjasper/base/jas_cm.c
src/gdcmjasper/src/libjasper/base/jas_icc.c
src/gdcmjasper/src/libjasper/jp2/jp2_cod.c

index a4f54fecd30f28c77050c431203fa6cd7328dcb6..e3e8528aab7099e8cd7d97178e88443a355eea4c 100644 (file)
@@ -62,7 +62,7 @@
 /*
  * Color Management
  *
- * $Id: jas_cm.c,v 1.1 2005/05/22 18:32:58 malaterre Exp $
+ * $Id: jas_cm.c,v 1.2 2005/06/09 22:01:59 malaterre Exp $
  */
 
 #include <jasper/jas_config.h>
@@ -548,7 +548,7 @@ int jas_cmxform_apply(jas_cmxform_t *xform, jas_cmpixmap_t *in, jas_cmpixmap_t *
       bufptr = &outbuf[i];
       dataptr = &fmt->buf[n];
       for (j = 0; j < m; ++j) {
-        v = (*bufptr) * scale + bias;
+        v = (long)((*bufptr) * scale + bias); /* warning C4244: '=' : conversion from 'jas_cmreal_t' to 'long', possible loss of data */
         bufptr += xform->numoutchans;
         if (jas_cmputint(&dataptr, fmt->sgnd, fmt->prec, v))
           goto error;
@@ -908,10 +908,10 @@ static jas_cmreal_t jas_cmshapmatlut_lookup(jas_cmshapmatlut_t *lut, jas_cmreal_
   int lo;
   int hi;
   t = x * (lut->size - 1);
-  lo = floor(t);
+  lo = (int)floor(t); /* warning C4244: '=' : conversion from 'double' to 'int', possible loss of data */
   if (lo < 0)
     return lut->data[0];
-  hi = ceil(t);
+  hi = (int)ceil(t); /* warning C4244: '=' : conversion from 'double' to 'int', possible loss of data */
   if (hi >= lut->size)
     return lut->data[lut->size - 1];
   return lut->data[lo] + (t - lo) * (lut->data[hi] - lut->data[lo]);
index 5794e2c5a020fb8dc585a07cc43d4cf388446b62..9d0ecf05d1054e90b62c7cbaef64eadd47429b1c 100644 (file)
@@ -1600,7 +1600,7 @@ static int jas_iccgetuint16(jas_stream_t *in, jas_iccuint16_t *val)
   ulonglong tmp;
   if (jas_iccgetuint(in, 2, &tmp))
     return -1;
-  *val = tmp;
+  *val = (jas_iccuint16_t)tmp; /* warning C4244: '=' : conversion from 'ulonglong' to 'jas_iccuint16_t', possible loss of data */
   return 0;
 }
 
@@ -1609,8 +1609,8 @@ static int jas_iccgetsint32(jas_stream_t *in, jas_iccsint32_t *val)
   ulonglong tmp;
   if (jas_iccgetuint(in, 4, &tmp))
     return -1;
-  *val = (tmp & 0x80000000) ? (-JAS_CAST(longlong, (((~tmp) &
-    0x7fffffff) + 1))) : JAS_CAST(longlong, tmp);
+  *val = (jas_iccsint32_t)((tmp & 0x80000000) ? (-JAS_CAST(longlong, (((~tmp) &
+    0x7fffffff) + 1))) : JAS_CAST(longlong, tmp)); /* warning C4244: '=' : conversion from 'longlong' to 'jas_iccsint32_t', possible loss of data */
   return 0;
 }
 
@@ -1619,7 +1619,7 @@ static int jas_iccgetuint32(jas_stream_t *in, jas_iccuint32_t *val)
   ulonglong tmp;
   if (jas_iccgetuint(in, 4, &tmp))
     return -1;
-  *val = tmp;
+  *val = (jas_iccuint32_t)tmp; /* warning C4244: '=' : conversion from 'ulonglong' to 'jas_iccuint32_t', possible loss of data */
   return 0;
 }
 
@@ -1637,7 +1637,7 @@ static int jas_iccputuint(jas_stream_t *out, int n, ulonglong val)
   int i;
   int c;
   for (i = n; i > 0; --i) {
-    c = (val >> (8 * (i - 1))) & 0xff;
+    c = (int)((val >> (8 * (i - 1))) & 0xff); /* warning C4244: '=' : conversion from 'ulonglong' to 'int', possible loss of data */
     if (jas_stream_putc(out, c) == EOF)
       return -1;
   }
index 687eb09731eeea4e4eba674a1f8d6d5f42804cde..d3c5186979e4e2ea4be976c16a40c9dd0cb53e6b 100644 (file)
@@ -64,7 +64,7 @@
 /*
  * JP2 Library
  *
- * $Id: jp2_cod.c,v 1.1 2005/05/22 18:33:03 malaterre Exp $
+ * $Id: jp2_cod.c,v 1.2 2005/06/09 22:02:00 malaterre Exp $
  */
 
 /******************************************************************************\
@@ -262,7 +262,7 @@ jp2_box_t *jp2_box_get(jas_stream_t *in)
     if (jp2_getuint64(in, &extlen)) {
       goto error;
     }
-    box->len = extlen;
+    box->len = (uint_fast32_t)extlen; /* warning C4244: '=' : conversion from 'uint_fast64_t' to 'uint_fast32_t', possible loss of data */
   }
   if (box->len != 0 && box->len < 8) {
     goto error;
@@ -704,8 +704,8 @@ static int jp2_putuint32(jas_stream_t *out, uint_fast32_t val)
 
 static int jp2_putuint64(jas_stream_t *out, uint_fast64_t val)
 {
-  if (jp2_putuint32(out, (val >> 32) & 0xffffffffUL) ||
-    jp2_putuint32(out, val & 0xffffffffUL)) {
+  if (jp2_putuint32(out, (uint_fast32_t)((val >> 32) & 0xffffffffUL) ||
+    jp2_putuint32(out, (uint_fast32_t)(val & 0xffffffffUL)))) { /* warning C4244: 'function' : conversion from 'uint_fast64_t' to 'uint_fast32_t', possible loss of data */
     return -1;
   }
   return 0;