X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e19291405ff3995a32c965da9694f2f20aa02468..4e15d1caa03346c126015019c1fdf093033ef40b:/src/jpeg/jdcolor.c diff --git a/src/jpeg/jdcolor.c b/src/jpeg/jdcolor.c index 6c04dfe8aa..cca2842297 100644 --- a/src/jpeg/jdcolor.c +++ b/src/jpeg/jdcolor.c @@ -12,6 +12,11 @@ #include "jinclude.h" #include "jpeglib.h" +#if defined(__VISAGECPP__) +/* Visual Age fixups for multiple declarations */ +# define null_convert null_convert2 /* already in jcmaint.c */ +# define grayscale_convert grayscale_convert2 /* already in jcmaint.c */ +#endif /* Private subobject */ @@ -21,8 +26,8 @@ typedef struct { /* Private state for YCC->RGB conversion */ int * Cr_r_tab; /* => table for Cr to R conversion */ int * Cb_b_tab; /* => table for Cb to B conversion */ - INT32 * Cr_g_tab; /* => table for Cr to G conversion */ - INT32 * Cb_g_tab; /* => table for Cb to G conversion */ + JPEG_INT32 * Cr_g_tab; /* => table for Cr to G conversion */ + JPEG_INT32 * Cb_g_tab; /* => table for Cb to G conversion */ } my_color_deconverter; typedef my_color_deconverter * my_cconvert_ptr; @@ -58,8 +63,8 @@ typedef my_color_deconverter * my_cconvert_ptr; */ #define SCALEBITS 16 /* speediest right-shift on some machines */ -#define ONE_HALF ((INT32) 1 << (SCALEBITS-1)) -#define FIX(x) ((INT32) ((x) * (1L<cconvert; int i; - INT32 x; + JPEG_INT32 x; SHIFT_TEMPS cconvert->Cr_r_tab = (int *) @@ -80,12 +85,12 @@ build_ycc_rgb_table (j_decompress_ptr cinfo) cconvert->Cb_b_tab = (int *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int)); - cconvert->Cr_g_tab = (INT32 *) + cconvert->Cr_g_tab = (JPEG_INT32 *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(INT32)); - cconvert->Cb_g_tab = (INT32 *) + (MAXJSAMPLE+1) * SIZEOF(JPEG_INT32)); + cconvert->Cb_g_tab = (JPEG_INT32 *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(INT32)); + (MAXJSAMPLE+1) * SIZEOF(JPEG_INT32)); for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ @@ -131,8 +136,8 @@ ycc_rgb_convert (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; register int * Crrtab = cconvert->Cr_r_tab; register int * Cbbtab = cconvert->Cb_b_tab; - register INT32 * Crgtab = cconvert->Cr_g_tab; - register INT32 * Cbgtab = cconvert->Cb_g_tab; + register JPEG_INT32 * Crgtab = cconvert->Cr_g_tab; + register JPEG_INT32 * Cbgtab = cconvert->Cb_g_tab; SHIFT_TEMPS while (--num_rows >= 0) { @@ -256,8 +261,8 @@ ycck_cmyk_convert (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; register int * Crrtab = cconvert->Cr_r_tab; register int * Cbbtab = cconvert->Cb_b_tab; - register INT32 * Crgtab = cconvert->Cr_g_tab; - register INT32 * Cbgtab = cconvert->Cb_g_tab; + register JPEG_INT32 * Crgtab = cconvert->Cr_g_tab; + register JPEG_INT32 * Cbgtab = cconvert->Cb_g_tab; SHIFT_TEMPS while (--num_rows >= 0) { @@ -394,3 +399,12 @@ jinit_color_deconverter (j_decompress_ptr cinfo) else cinfo->output_components = cinfo->out_color_components; } + +#if defined(__VISAGECPP__) +# ifdef null_convert2 +# undef null_convert2 +# endif +# ifdef grayscale_convert2 +# undef grayscale_convert2 +# endif +#endif