aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/jpeg-6b/jquant1.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/monniaux/jpeg-6b/jquant1.c')
-rw-r--r--test/monniaux/jpeg-6b/jquant1.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/monniaux/jpeg-6b/jquant1.c b/test/monniaux/jpeg-6b/jquant1.c
index b2f96aa1..9f5d67bc 100644
--- a/test/monniaux/jpeg-6b/jquant1.c
+++ b/test/monniaux/jpeg-6b/jquant1.c
@@ -227,7 +227,7 @@ select_ncolors (j_decompress_ptr cinfo, int Ncolors[])
for (i = 0; i < nc; i++) {
j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i);
/* calculate new total_colors if Ncolors[j] is incremented */
- temp = total_colors / Ncolors[j];
+ temp = INT_DIV(total_colors, Ncolors[j]);
temp *= Ncolors[j]+1; /* done in long arith to avoid oflo */
if (temp > (long) max_colors)
break; /* won't fit, done with this pass */
@@ -251,7 +251,7 @@ output_value (j_decompress_ptr cinfo, int ci, int j, int maxj)
* (Forcing the upper and lower values to the limits ensures that
* dithering can't produce a color outside the selected gamut.)
*/
- return (int) (((INT32) j * MAXJSAMPLE + maxj/2) / maxj);
+ return (int) INT_DIV(((INT32) j * MAXJSAMPLE + maxj/2), maxj);
}
@@ -261,7 +261,7 @@ largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj)
/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */
{
/* Breakpoints are halfway between values returned by output_value */
- return (int) (((INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));
+ return (int) INT_DIV(((INT32) (2*j + 1) * MAXJSAMPLE + maxj), (2*maxj));
}
@@ -303,7 +303,7 @@ create_colormap (j_decompress_ptr cinfo)
for (i = 0; i < cinfo->out_color_components; i++) {
/* fill in colormap entries for i'th color component */
nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
- blksize = blkdist / nci;
+ blksize = INT_DIV(blkdist, nci);
for (j = 0; j < nci; j++) {
/* Compute j'th output value (out of nci) for component */
val = output_value(cinfo, i, j, nci-1);
@@ -360,7 +360,7 @@ create_colorindex (j_decompress_ptr cinfo)
for (i = 0; i < cinfo->out_color_components; i++) {
/* fill in colorindex entries for i'th color component */
nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
- blksize = blksize / nci;
+ blksize = INT_DIV(blksize, nci);
/* adjust colorindex pointers to provide padding at negative indexes. */
if (pad)
@@ -415,7 +415,7 @@ make_odither_array (j_decompress_ptr cinfo, int ncolors)
/* Ensure round towards zero despite C's lack of consistency
* about rounding negative values in integer division...
*/
- odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den);
+ odither[j][k] = (int) (num<0 ? -INT_DIV((-num),den) : INT_DIV(num,den));
}
}
return odither;
@@ -787,6 +787,7 @@ start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
ERREXIT(cinfo, JERR_NOT_COMPILED);
break;
}
+ KILL_TAIL_CALL();
}
@@ -810,6 +811,7 @@ METHODDEF(void)
new_color_map_1_quant (j_decompress_ptr cinfo)
{
ERREXIT(cinfo, JERR_MODE_CHANGE);
+ KILL_TAIL_CALL();
}