-#define CBCR_OFFSET ((INT32) CENTERJSAMPLE << SCALEBITS)
-#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
-#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
+#define CBCR_OFFSET ((JPEG_INT32) CENTERJSAMPLE << SCALEBITS)
+#define ONE_HALF ((JPEG_INT32) 1 << (SCALEBITS-1))
+#define FIX(x) ((JPEG_INT32) ((x) * (1L<<SCALEBITS) + 0.5))