--- OLD/ppm/ppmquant.c Thu Jan 1 00:00:00 1970 +++ NEW/ppm/ppmquant.c Thu Jan 1 00:00:00 1970 @@ -31,10 +31,10 @@ }; static colorhist_vector mediancut ARGS(( colorhist_vector chv, int colors, int sum, pixval maxval, int newcolors )); -static int redcompare ARGS(( colorhist_vector ch1, colorhist_vector ch2 )); -static int greencompare ARGS(( colorhist_vector ch1, colorhist_vector ch2 )); -static int bluecompare ARGS(( colorhist_vector ch1, colorhist_vector ch2 )); -static int sumcompare ARGS(( box_vector b1, box_vector b2 )); +static int redcompare ARGS((const void *, const void *)); +static int greencompare ARGS((const void *, const void *)); +static int bluecompare ARGS((const void *, const void *)); +static int sumcompare ARGS((const void *, const void *)); int main( argc, argv ) @@ -590,30 +590,25 @@ return colormap; } -static int -redcompare( ch1, ch2 ) - colorhist_vector ch1, ch2; +static int redcompare(const void *a1, const void *a2) { - return (int) PPM_GETR( ch1->color ) - (int) PPM_GETR( ch2->color ); + return (int) PPM_GETR(((const struct colorhist_item *)a1)->color) - + (int) PPM_GETR(((const struct colorhist_item *)a2)->color); } -static int -greencompare( ch1, ch2 ) - colorhist_vector ch1, ch2; +static int greencompare(const void *a1, const void *a2) { - return (int) PPM_GETG( ch1->color ) - (int) PPM_GETG( ch2->color ); + return (int) PPM_GETG(((const struct colorhist_item *)a1)->color) - + (int) PPM_GETG(((const struct colorhist_item *)a2)->color); } -static int -bluecompare( ch1, ch2 ) - colorhist_vector ch1, ch2; +static int bluecompare(const void *a1, const void *a2) { - return (int) PPM_GETB( ch1->color ) - (int) PPM_GETB( ch2->color ); + return (int) PPM_GETB(((const struct colorhist_item *)a1)->color) - + (int) PPM_GETB(((const struct colorhist_item *)a2)->color); } -static int -sumcompare( b1, b2 ) - box_vector b1, b2; +static int sumcompare(const void *a1, const void *a2) { - return b2->sum - b1->sum; + return ((const struct box *)a1)->sum - ((const struct box *)a2)->sum; }