From: Arnar Mar Hrafnkelsson Date: Sat, 27 Oct 2001 08:21:08 +0000 (+0000) Subject: Added static to all internal functions for image.c and palimg.c X-Git-Tag: Imager-0.48^2~522 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/63b018fd46a2cb8ff5186af584b2e95ebffb32b0 Added static to all internal functions for image.c and palimg.c --- diff --git a/image.c b/image.c index 2f549866..3a5de5a2 100644 --- a/image.c +++ b/image.c @@ -1310,6 +1310,7 @@ Returns 0 if the pixel could be set, -1 otherwise. =cut */ +static int i_ppix_d(i_img *im, int x, int y, i_color *val) { int ch; @@ -1335,6 +1336,7 @@ Returns 0 if the pixel could be set, -1 otherwise. =cut */ +static int i_gpix_d(i_img *im, int x, int y, i_color *val) { int ch; @@ -1363,6 +1365,7 @@ Returns the number of pixels copied (eg. if r, l or y is out of range) =cut */ +static int i_glin_d(i_img *im, int l, int r, int y, i_color *vals) { int ch, count, i; @@ -1399,6 +1402,7 @@ Returns the number of pixels copied (eg. if r, l or y is out of range) =cut */ +static int i_plin_d(i_img *im, int l, int r, int y, i_color *vals) { int ch, count, i; @@ -1427,6 +1431,7 @@ i_plin_d(i_img *im, int l, int r, int y, i_color *vals) { =cut */ +static int i_ppixf_d(i_img *im, int x, int y, i_fcolor *val) { int ch; @@ -1447,6 +1452,7 @@ i_ppixf_d(i_img *im, int x, int y, i_fcolor *val) { =cut */ +static int i_gpixf_d(i_img *im, int x, int y, i_fcolor *val) { int ch; @@ -1476,6 +1482,7 @@ Returns the number of pixels copied (eg. if r, l or y is out of range) =cut */ +static int i_glinf_d(i_img *im, int l, int r, int y, i_fcolor *vals) { int ch, count, i; @@ -1512,6 +1519,7 @@ Returns the number of pixels copied (eg. if r, l or y is out of range) =cut */ +static int i_plinf_d(i_img *im, int l, int r, int y, i_fcolor *vals) { int ch, count, i; @@ -1546,7 +1554,9 @@ Returns the number of samples read (which should be (r-l) * bits_set(chan_mask) =cut */ -int i_gsamp_d(i_img *im, int l, int r, int y, i_sample_t *samps, +static +int +i_gsamp_d(i_img *im, int l, int r, int y, i_sample_t *samps, int *chans, int chan_count) { int ch, count, i, w; unsigned char *data; @@ -1602,7 +1612,9 @@ Returns the number of samples read (which should be (r-l) * bits_set(chan_mask) =cut */ -int i_gsampf_d(i_img *im, int l, int r, int y, i_fsample_t *samps, +static +int +i_gsampf_d(i_img *im, int l, int r, int y, i_fsample_t *samps, int *chans, int chan_count) { int ch, count, i, w; unsigned char *data; diff --git a/palimg.c b/palimg.c index ad873424..be5858ad 100644 --- a/palimg.c +++ b/palimg.c @@ -244,7 +244,7 @@ present in the image. =cut */ -int i_ppix_p(i_img *im, int x, int y, i_color *val) { +static int i_ppix_p(i_img *im, int x, int y, i_color *val) { i_palidx which; if (x < 0 || x >= im->xsize || y < 0 || y >= im->ysize) return -1; @@ -268,7 +268,7 @@ Retrieve a pixel, converting from a palette index to a color. =cut */ -int i_gpix_p(i_img *im, int x, int y, i_color *val) { +static int i_gpix_p(i_img *im, int x, int y, i_color *val) { i_palidx which; if (x < 0 || x >= im->xsize || y < 0 || y >= im->ysize) { return -1; @@ -288,7 +288,7 @@ Retrieve a row of pixels. =cut */ -int i_glin_p(i_img *im, int l, int r, int y, i_color *vals) { +static int i_glin_p(i_img *im, int l, int r, int y, i_color *vals) { if (y >= 0 && y < im->ysize && l < im->xsize && l >= 0) { int palsize = PALEXT(im)->count; i_color *pal = PALEXT(im)->pal; @@ -320,7 +320,7 @@ RGB. =cut */ -int i_plin_p(i_img *im, int l, int r, int y, i_color *vals) { +static int i_plin_p(i_img *im, int l, int r, int y, i_color *vals) { int ch, count, i; i_palidx *data; i_palidx which; @@ -351,7 +351,7 @@ int i_plin_p(i_img *im, int l, int r, int y, i_color *vals) { =cut */ -int i_gsamp_p(i_img *im, int l, int r, int y, i_sample_t *samps, +static int i_gsamp_p(i_img *im, int l, int r, int y, i_sample_t *samps, int *chans, int chan_count) { int ch; if (y >= 0 && y < im->ysize && l < im->xsize && l >= 0) { @@ -405,7 +405,7 @@ int i_gsamp_p(i_img *im, int l, int r, int y, i_sample_t *samps, =cut */ -int i_gpal_p(i_img *im, int l, int r, int y, i_palidx *vals) { +static int i_gpal_p(i_img *im, int l, int r, int y, i_palidx *vals) { if (y >= 0 && y < im->ysize && l < im->xsize && l >= 0) { i_palidx *data; int i, w; @@ -429,7 +429,7 @@ int i_gpal_p(i_img *im, int l, int r, int y, i_palidx *vals) { =cut */ -int i_ppal_p(i_img *im, int l, int r, int y, i_palidx *vals) { +static int i_ppal_p(i_img *im, int l, int r, int y, i_palidx *vals) { if (y >= 0 && y < im->ysize && l < im->xsize && l >= 0) { i_palidx *data; int i, w; @@ -452,7 +452,7 @@ int i_ppal_p(i_img *im, int l, int r, int y, i_palidx *vals) { =cut */ -int i_addcolors_p(i_img *im, i_color *color, int count) { +static int i_addcolors_p(i_img *im, i_color *color, int count) { if (PALEXT(im)->count + count <= PALEXT(im)->alloc) { int result = PALEXT(im)->count; int index = result; @@ -474,7 +474,7 @@ int i_addcolors_p(i_img *im, i_color *color, int count) { =cut */ -int i_getcolors_p(i_img *im, int i, i_color *color, int count) { +static int i_getcolors_p(i_img *im, int i, i_color *color, int count) { if (i >= 0 && i+count <= PALEXT(im)->count) { while (count) { *color++ = PALEXT(im)->pal[i++]; @@ -500,7 +500,7 @@ static int color_eq(i_img *im, i_color *c1, i_color *c2) { =cut */ -int i_colorcount_p(i_img *im) { +static int i_colorcount_p(i_img *im) { return PALEXT(im)->count; } @@ -509,7 +509,7 @@ int i_colorcount_p(i_img *im) { =cut */ -int i_maxcolors_p(i_img *im) { +static int i_maxcolors_p(i_img *im) { return PALEXT(im)->alloc; } @@ -518,7 +518,7 @@ int i_maxcolors_p(i_img *im) { =cut */ -int i_setcolors_p(i_img *im, int index, i_color *colors, int count) { +static int i_setcolors_p(i_img *im, int index, i_color *colors, int count) { if (index >= 0 && count >= 1 && index + count < PALEXT(im)->count) { while (count) { PALEXT(im)->pal[index++] = *colors++; @@ -535,7 +535,7 @@ int i_setcolors_p(i_img *im, int index, i_color *colors, int count) { =cut */ -int i_findcolor_p(i_img *im, i_color *color, i_palidx *entry) { +static int i_findcolor_p(i_img *im, i_color *color, i_palidx *entry) { if (PALEXT(im)->count) { int i; /* often the same color comes up several times in a row */