/*
* 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>
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;
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]);
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;
}
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;
}
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;
}
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;
}
/*
* 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 $
*/
/******************************************************************************\
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;
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;