--- ray/src/px/ciq.c 1990/12/04 11:25:45 1.6 +++ ray/src/px/ciq.c 2003/06/30 14:59:12 2.4 @@ -1,9 +1,6 @@ -/* Copyright 1988 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: ciq.c,v 2.4 2003/06/30 14:59:12 schorsch Exp $"; #endif - /* CIQ - main program for color image quantization options for Floyd-Steinberg dithering by minimization of accumulated error @@ -13,6 +10,8 @@ Paul Heckbert 16 April 82, cleaned up 8 June 86 Greg Ward 1 March 88, modified for arbitrary picture sizes */ +#include + #include "standard.h" #include "ciq.h" @@ -44,7 +43,7 @@ colormap cm; /* quantization colormap */ if (synth) n = makecm(nw,&na); /* analyze histogram and synthesize colormap */ else { - bcopy((char *)cm,(char *)color,sizeof color); + memcpy((void *)color,(void *)cm,sizeof color); n = nw; na = 0; for (i=0; ir,lp->g,lp->b)++; } - free((char *)line); + free((void *)line); } convertmap(in,out) /* convert to shifted color map */ @@ -120,8 +119,8 @@ colormap ocm; /* colormap for orig */ oline[x] = table(map,lp->r,lp->g,lp->b); picwriteline(y,oline); } - free((char *)iline); - free((char *)oline); + free((void *)iline); + free((void *)oline); } draw_dith(ocm) /* quantize with dithering */ @@ -170,7 +169,7 @@ colormap ocm; /* colormap for orig */ } picwriteline(y,oline); } - free((char *)iline); - free((char *)oline); - free((char *)buf); + free((void *)iline); + free((void *)oline); + free((void *)buf); }