summaryrefslogtreecommitdiff
path: root/liboil/jpeg
diff options
context:
space:
mode:
authorDavid Schleef <ds@ginger.bigkitten.com>2008-05-29 13:59:09 -0700
committerDavid Schleef <ds@ginger.bigkitten.com>2008-05-29 13:59:09 -0700
commit8304de0c341d3e79799c0e6c00dafe62bbf079e0 (patch)
treedea099a98265ad6435894d41da21f2860b73977d /liboil/jpeg
parent74128fd0b3f857ed06411a1f6fd0a17907382db7 (diff)
downloadliboil-8304de0c341d3e79799c0e6c00dafe62bbf079e0.tar.gz
[oil] Compile fixes for windows
Diffstat (limited to 'liboil/jpeg')
-rw-r--r--liboil/jpeg/convert8x8_c.c10
-rw-r--r--liboil/jpeg/quantize8x8_c.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/liboil/jpeg/convert8x8_c.c b/liboil/jpeg/convert8x8_c.c
index 496aa95..23bcae6 100644
--- a/liboil/jpeg/convert8x8_c.c
+++ b/liboil/jpeg/convert8x8_c.c
@@ -74,16 +74,16 @@ OIL_DEFINE_CLASS (clipconv8x8_u8_s16,
"uint8_t * d_8x8, int dstr, int16_t * s_8x8, int sstr");
#define BLOCK8x8_F64(ptr, stride, row, column) \
- (*((double *)((void *)ptr + stride*row) + column))
+ (*((double *)((unsigned char *)ptr + stride*row) + column))
#define BLOCK8x8_PTR_F64(ptr, stride, row, column) \
- ((double *)((void *)ptr + stride*row) + column)
+ ((double *)((unsigned char *)ptr + stride*row) + column)
#define BLOCK8x8_S16(ptr, stride, row, column) \
- (*((int16_t *)((void *)ptr + stride*row) + column))
+ (*((int16_t *)((unsigned char *)ptr + stride*row) + column))
#define BLOCK8x8_U8(ptr, stride, row, column) \
- (*((uint8_t *)((void *)ptr + stride*row) + column))
+ (*((uint8_t *)((unsigned char *)ptr + stride*row) + column))
static void
@@ -93,7 +93,7 @@ conv8x8_s16_f64_c (int16_t * dest, int dstr, double *src, int sstr)
for (i = 0; i < 8; i++) {
for (j = 0; j < 8; j++) {
- BLOCK8x8_S16 (dest, dstr, i, j) = rint (BLOCK8x8_F64 (src, sstr, i, j));
+ BLOCK8x8_S16 (dest, dstr, i, j) = floor (0.5 + BLOCK8x8_F64 (src, sstr, i, j));
}
}
}
diff --git a/liboil/jpeg/quantize8x8_c.c b/liboil/jpeg/quantize8x8_c.c
index 7f8e03c..949f066 100644
--- a/liboil/jpeg/quantize8x8_c.c
+++ b/liboil/jpeg/quantize8x8_c.c
@@ -48,7 +48,7 @@ OIL_DEFINE_CLASS (dequantize8x8_s16,
"int16_t *s2_8x8, int sstr2");
#define BLOCK8x8_S16(ptr, stride, row, column) \
- (*((int16_t *)((void *)ptr + stride*row) + column))
+ (*((int16_t *)((unsigned char *)ptr + stride*row) + column))
static void
dequantize8x8_s16_ref (int16_t *dest, int dstr, int16_t *src, int sstr,