bzero/bcopy pogrom.

-Yosh
This commit is contained in:
Manish Singh 1998-03-21 02:17:49 +00:00
parent 947490dd2e
commit e5a3b37453
14 changed files with 72 additions and 86 deletions

View File

@ -1,3 +1,7 @@
Fri Mar 20 18:15:06 PST 1998 Manish Singh <yosh@gimp.org>
* s/bzero/memset/ and s/bcopy/memcpy/ in plug-ins
Fri Mar 20 16:54:47 EST 1998 Adrian Likins <adrian@gimp.org> Fri Mar 20 16:54:47 EST 1998 Adrian Likins <adrian@gimp.org>
* app/palette.c: * app/palette.c:

View File

@ -1913,9 +1913,9 @@ CML_copy_parameters_callback (GtkWidget *widget, gpointer data)
gdk_flush (); gdk_flush ();
return; return;
} }
bcopy (channel_menu[copy_source].data, memcpy (channel_menu[copy_destination].data,
channel_menu[copy_destination].data, channel_menu[copy_source].data,
sizeof (CML_PARAM)); sizeof (CML_PARAM));
CML_preview_defer = TRUE; CML_preview_defer = TRUE;
widgets = widget_pointers[copy_destination]; widgets = widget_pointers[copy_destination];
for (index = 0; index < CML_PARAM_NUM; index++) for (index = 0; index < CML_PARAM_NUM; index++)
@ -2385,9 +2385,9 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
{ {
if ((selective_load_source == 0) || (selective_load_destination == 0)) if ((selective_load_source == 0) || (selective_load_destination == 0))
{ {
bcopy ((void *)&ch[0], &(VALS.hue), sizeof (CML_PARAM)); memcpy (&(VALS.hue), (void *)&ch[0], sizeof (CML_PARAM));
bcopy ((void *)&ch[1], &(VALS.sat), sizeof (CML_PARAM)); memcpy (&(VALS.sat), (void *)&ch[1], sizeof (CML_PARAM));
bcopy ((void *)&ch[2], &(VALS.val), sizeof (CML_PARAM)); memcpy (&(VALS.val), (void *)&ch[2], sizeof (CML_PARAM));
VALS.initial_value = initial_value; VALS.initial_value = initial_value;
VALS.scale = scale; VALS.scale = scale;
VALS.start_offset = start_offset; VALS.start_offset = start_offset;
@ -2395,9 +2395,9 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
} }
else else
{ {
bcopy ((void *)&ch[selective_load_source - 1], memcpy ((CML_PARAM *)&VALS + (selective_load_destination - 1),
(CML_PARAM *)&VALS + (selective_load_destination - 1), (void *)&ch[selective_load_source - 1],
sizeof (CML_PARAM)); sizeof (CML_PARAM));
} }
if ( sizeof (VALS.last_file_name) <= strlen (filename)) if ( sizeof (VALS.last_file_name) <= strlen (filename))

View File

@ -1913,9 +1913,9 @@ CML_copy_parameters_callback (GtkWidget *widget, gpointer data)
gdk_flush (); gdk_flush ();
return; return;
} }
bcopy (channel_menu[copy_source].data, memcpy (channel_menu[copy_destination].data,
channel_menu[copy_destination].data, channel_menu[copy_source].data,
sizeof (CML_PARAM)); sizeof (CML_PARAM));
CML_preview_defer = TRUE; CML_preview_defer = TRUE;
widgets = widget_pointers[copy_destination]; widgets = widget_pointers[copy_destination];
for (index = 0; index < CML_PARAM_NUM; index++) for (index = 0; index < CML_PARAM_NUM; index++)
@ -2385,9 +2385,9 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
{ {
if ((selective_load_source == 0) || (selective_load_destination == 0)) if ((selective_load_source == 0) || (selective_load_destination == 0))
{ {
bcopy ((void *)&ch[0], &(VALS.hue), sizeof (CML_PARAM)); memcpy (&(VALS.hue), (void *)&ch[0], sizeof (CML_PARAM));
bcopy ((void *)&ch[1], &(VALS.sat), sizeof (CML_PARAM)); memcpy (&(VALS.sat), (void *)&ch[1], sizeof (CML_PARAM));
bcopy ((void *)&ch[2], &(VALS.val), sizeof (CML_PARAM)); memcpy (&(VALS.val), (void *)&ch[2], sizeof (CML_PARAM));
VALS.initial_value = initial_value; VALS.initial_value = initial_value;
VALS.scale = scale; VALS.scale = scale;
VALS.start_offset = start_offset; VALS.start_offset = start_offset;
@ -2395,9 +2395,9 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
} }
else else
{ {
bcopy ((void *)&ch[selective_load_source - 1], memcpy ((CML_PARAM *)&VALS + (selective_load_destination - 1),
(CML_PARAM *)&VALS + (selective_load_destination - 1), (void *)&ch[selective_load_source - 1],
sizeof (CML_PARAM)); sizeof (CML_PARAM));
} }
if ( sizeof (VALS.last_file_name) <= strlen (filename)) if ( sizeof (VALS.last_file_name) <= strlen (filename))

View File

@ -142,7 +142,6 @@ run(gchar *name, gint nparam, GParam *param,
*nretvals = 1; *nretvals = 1;
*retvals = rvals; *retvals = rvals;
/* bzero(&args, sizeof(struct piArgs)); */
memset(&args,(int)0,sizeof(struct piArgs)); memset(&args,(int)0,sizeof(struct piArgs));
rvals[0].type = PARAM_STATUS; rvals[0].type = PARAM_STATUS;
@ -332,9 +331,7 @@ int pluginCore(struct piArgs *argp) {
srcbuf=(guchar*)malloc(rowsize*3); srcbuf=(guchar*)malloc(rowsize*3);
dstbuf=(guchar*)malloc(rowsize); dstbuf=(guchar*)malloc(rowsize);
/* bzero(srcbuf, rowsize*3); */
memset(srcbuf,(int)0,(size_t)(rowsize*3)); memset(srcbuf,(int)0,(size_t)(rowsize*3));
/* bzero(dstbuf, rowsize); */
memset(dstbuf,(int)0,(size_t)rowsize); memset(dstbuf,(int)0,(size_t)rowsize);
EmbossInit(DtoR(argp->azimuth), DtoR(argp->elevation), argp->depth); EmbossInit(DtoR(argp->azimuth), DtoR(argp->elevation), argp->depth);
@ -344,14 +341,14 @@ int pluginCore(struct piArgs *argp) {
/* first row */ /* first row */
gimp_pixel_rgn_get_rect(&src, srcbuf, 0, 0, width, 3); gimp_pixel_rgn_get_rect(&src, srcbuf, 0, 0, width, 3);
bcopy(srcbuf+rowsize, srcbuf, rowsize); memcpy(srcbuf, srcbuf+rowsize, rowsize);
EmbossRow(srcbuf, argp->embossp ? (guchar *)0 : srcbuf, EmbossRow(srcbuf, argp->embossp ? (guchar *)0 : srcbuf,
dstbuf, width, bypp, has_alpha); dstbuf, width, bypp, has_alpha);
gimp_pixel_rgn_set_row(&dst, dstbuf, 0, 0, width); gimp_pixel_rgn_set_row(&dst, dstbuf, 0, 0, width);
/* last row */ /* last row */
gimp_pixel_rgn_get_rect(&src, srcbuf, 0, height-3, width, 3); gimp_pixel_rgn_get_rect(&src, srcbuf, 0, height-3, width, 3);
bcopy(srcbuf+rowsize, srcbuf+rowsize*2, rowsize); memcpy(srcbuf+rowsize*2, srcbuf+rowsize, rowsize);
EmbossRow(srcbuf, argp->embossp ? (guchar *)0 : srcbuf, EmbossRow(srcbuf, argp->embossp ? (guchar *)0 : srcbuf,
dstbuf, width, bypp, has_alpha); dstbuf, width, bypp, has_alpha);
gimp_pixel_rgn_set_row(&dst, dstbuf, 0, height-1, width); gimp_pixel_rgn_set_row(&dst, dstbuf, 0, height-1, width);
@ -467,8 +464,8 @@ emboss_do_preview(GtkWidget *w) {
dst = malloc(rowsize); dst = malloc(rowsize);
c = malloc(rowsize*3); c = malloc(rowsize*3);
bcopy(thePreview->bits, c, rowsize); memcpy(c, thePreview->bits, rowsize);
bcopy(thePreview->bits, c+rowsize, rowsize*2); memcpy(c+rowsize, thePreview->bits, rowsize*2);
EmbossInit(DtoR(ap->azimuth), DtoR(ap->elevation), ap->depth); EmbossInit(DtoR(ap->azimuth), DtoR(ap->elevation), ap->depth);
EmbossRow(c, ap->embossp ? (guchar *)0 : c, EmbossRow(c, ap->embossp ? (guchar *)0 : c,
@ -476,9 +473,9 @@ emboss_do_preview(GtkWidget *w) {
gtk_preview_draw_row(GTK_PREVIEW(theWidget), gtk_preview_draw_row(GTK_PREVIEW(theWidget),
dst, 0, 0, thePreview->width); dst, 0, 0, thePreview->width);
bcopy(thePreview->bits+((thePreview->height-2)*rowsize), c, rowsize*2); memcpy(c, thePreview->bits+((thePreview->height-2)*rowsize), rowsize*2);
bcopy(thePreview->bits+((thePreview->height-1)*rowsize), memcpy(c+(rowsize*2), thePreview->bits+((thePreview->height-1)*rowsize),
c+(rowsize*2), rowsize); rowsize);
EmbossRow(c, ap->embossp ? (guchar *)0 : c, EmbossRow(c, ap->embossp ? (guchar *)0 : c,
dst, thePreview->width, thePreview->bpp, FALSE); dst, thePreview->width, thePreview->bpp, FALSE);
gtk_preview_draw_row(GTK_PREVIEW(theWidget), gtk_preview_draw_row(GTK_PREVIEW(theWidget),

View File

@ -228,7 +228,6 @@ run(char *name, int nparam, GParam *param,
*nretvals = 1; *nretvals = 1;
*retvals = rvals; *retvals = rvals;
/* bzero(&args, sizeof(struct piArgs)); */
memset(&args,(int)0,sizeof(struct piArgs)); memset(&args,(int)0,sizeof(struct piArgs));
args.mode=-1; args.mode=-1;

View File

@ -135,7 +135,6 @@ run(char *name, gint nparam, GParam *param,
*nretvals = 1; *nretvals = 1;
*retvals = rvals; *retvals = rvals;
/* bzero(&args, sizeof(struct piArgs)); */
memset(&args,(int)0,sizeof(struct piArgs)); memset(&args,(int)0,sizeof(struct piArgs));
args.radius=-1.0; args.radius=-1.0;
@ -213,9 +212,7 @@ gint pluginCore(struct piArgs *argp) {
srcbuf=(guchar*)malloc(width*Bpp*3); srcbuf=(guchar*)malloc(width*Bpp*3);
dstbuf=(guchar*)malloc(width*Bpp); dstbuf=(guchar*)malloc(width*Bpp);
/* bzero(srcbuf, rowsize*3); */
memset(srcbuf,(int)0,(size_t)(rowsize*3)); memset(srcbuf,(int)0,(size_t)(rowsize*3));
/* bzero(dstbuf, rowsize); */
memset(dstbuf,(int)0,(size_t)rowsize); memset(dstbuf,(int)0,(size_t)rowsize);
filtno=nlfiltInit(argp->alpha, argp->radius, argp->filter); filtno=nlfiltInit(argp->alpha, argp->radius, argp->filter);
@ -223,13 +220,13 @@ gint pluginCore(struct piArgs *argp) {
/* first row */ /* first row */
gimp_pixel_rgn_get_rect(&srcPr, srcbuf, 0, 0, width, 3); gimp_pixel_rgn_get_rect(&srcPr, srcbuf, 0, 0, width, 3);
bcopy(srcbuf+width*Bpp, srcbuf, rowsize); memcpy(srcbuf, srcbuf+width*Bpp, rowsize);
nlfiltRow(srcbuf, dstbuf, width, Bpp, filtno); nlfiltRow(srcbuf, dstbuf, width, Bpp, filtno);
gimp_pixel_rgn_set_row(&dstPr, dstbuf, 0, 0, width); gimp_pixel_rgn_set_row(&dstPr, dstbuf, 0, 0, width);
/* last row */ /* last row */
gimp_pixel_rgn_get_rect(&srcPr, srcbuf, 0, height-3, width, 3); gimp_pixel_rgn_get_rect(&srcPr, srcbuf, 0, height-3, width, 3);
bcopy(srcbuf+rowsize, srcbuf+rowsize*2, rowsize); memcpy(srcbuf+rowsize*2, srcbuf+rowsize, rowsize);
nlfiltRow(srcbuf, dstbuf, width, Bpp, filtno); nlfiltRow(srcbuf, dstbuf, width, Bpp, filtno);
gimp_pixel_rgn_set_row(&dstPr, dstbuf, 0, height-1, width); gimp_pixel_rgn_set_row(&dstPr, dstbuf, 0, height-1, width);
@ -346,16 +343,16 @@ nlfilt_do_preview(GtkWidget *w) {
rowsize=thePreview->width*thePreview->bpp; rowsize=thePreview->width*thePreview->bpp;
dst = malloc(rowsize); dst = malloc(rowsize);
c = malloc(rowsize*3); c = malloc(rowsize*3);
bcopy(thePreview->bits, c, rowsize); memcpy(c, thePreview->bits, rowsize);
bcopy(thePreview->bits, c+rowsize, rowsize*2); memcpy(c+rowsize, thePreview->bits, rowsize*2);
filtno = nlfiltInit(ap->alpha, ap->radius, ap->filter); filtno = nlfiltInit(ap->alpha, ap->radius, ap->filter);
nlfiltRow(c, dst, thePreview->width, thePreview->bpp, filtno); nlfiltRow(c, dst, thePreview->width, thePreview->bpp, filtno);
gtk_preview_draw_row(GTK_PREVIEW(theWidget), gtk_preview_draw_row(GTK_PREVIEW(theWidget),
dst, 0, 0, thePreview->width); dst, 0, 0, thePreview->width);
bcopy(thePreview->bits+((thePreview->height-2)*rowsize), c, rowsize*2); memcpy(c, thePreview->bits+((thePreview->height-2)*rowsize), rowsize*2);
bcopy(thePreview->bits+((thePreview->height-1)*rowsize), memcpy(c+(rowsize*2), thePreview->bits+((thePreview->height-1)*rowsize),
c+(rowsize*2), rowsize); rowsize);
gtk_preview_draw_row(GTK_PREVIEW(theWidget), gtk_preview_draw_row(GTK_PREVIEW(theWidget),
dst, 0, thePreview->height-1, thePreview->width); dst, 0, thePreview->height-1, thePreview->width);
free(c); free(c);

View File

@ -39,7 +39,6 @@
#define PROGRESS_NAME "value propagating..." #define PROGRESS_NAME "value propagating..."
#define MENU_POSITION "<Image>/Filters/Distorts/Value Propagate" #define MENU_POSITION "<Image>/Filters/Distorts/Value Propagate"
/* void bcopy(void *, void *, int); */
typedef guchar CH; typedef guchar CH;
#define RGB (1 << 0) #define RGB (1 << 0)
#define GRAY (1 << 1) #define GRAY (1 << 1)
@ -411,7 +410,7 @@ value_propagate_body (gint drawable_id)
dest = dest_row + (x * bytes); dest = dest_row + (x * bytes);
here = cr + (x * bytes); here = cr + (x * bytes);
/* *** copy source value to best value holder *** */ /* *** copy source value to best value holder *** */
bcopy ((void *)here, (void *)best, bytes); memcpy ((void *)best, (void *)here, bytes);
if ( operation.initializer ) if ( operation.initializer )
(* operation.initializer)(dtype, bytes, best, here, &tmp); (* operation.initializer)(dtype, bytes, best, here, &tmp);
/* *** gather neighbors' values: loop-unfolded version *** */ /* *** gather neighbors' values: loop-unfolded version *** */
@ -569,7 +568,7 @@ propagate_white (dtype, bytes, orig, here, best, tmp)
if ( *(float *)tmp < v_here && value_difference_check(orig, here, 3) ) if ( *(float *)tmp < v_here && value_difference_check(orig, here, 3) )
{ {
*(float *)tmp = v_here; *(float *)tmp = v_here;
bcopy(here, best, 3 * sizeof(CH)); /* alpha channel holds old value */ memcpy(best, here, 3 * sizeof(CH)); /* alpha channel holds old value */
} }
break; break;
case GRAYA_IMAGE: case GRAYA_IMAGE:
@ -615,7 +614,7 @@ propagate_black (image_type, channels, orig, here, best, tmp)
if ( v_here < *(float *)tmp && value_difference_check(orig, here, 3) ) if ( v_here < *(float *)tmp && value_difference_check(orig, here, 3) )
{ {
*(float *)tmp = v_here; *(float *)tmp = v_here;
bcopy (here, best, 3 * sizeof(CH)); /* alpha channel holds old value */ memcpy (best, here, 3 * sizeof(CH)); /* alpha channel holds old value */
} }
break; break;
case GRAYA_IMAGE: case GRAYA_IMAGE:
@ -695,13 +694,13 @@ propagate_middle (image_type, channels, orig, here, best, tmp)
if ( (v_here <= data->minv) && value_difference_check(orig, here, 3) ) if ( (v_here <= data->minv) && value_difference_check(orig, here, 3) )
{ {
data->minv = v_here; data->minv = v_here;
bcopy (here, data->min, 3*sizeof(CH)); memcpy (data->min, here, 3*sizeof(CH));
data->min_modified = 1; data->min_modified = 1;
} }
if ( data->maxv <= v_here && value_difference_check(orig, here, 3) ) if ( data->maxv <= v_here && value_difference_check(orig, here, 3) )
{ {
data->maxv = v_here; data->maxv = v_here;
bcopy (here, data->max, 3*sizeof(CH)); memcpy (data->max, here, 3*sizeof(CH));
data->max_modified = 1; data->max_modified = 1;
} }
break; break;
@ -881,7 +880,7 @@ propagate_a_color (image_type, channels, orig, here, best, tmp)
if ( here[0] == fg[0] && here[1] == fg[1] && here[2] == fg[2] && if ( here[0] == fg[0] && here[1] == fg[1] && here[2] == fg[2] &&
value_difference_check(orig, here, 3) ) value_difference_check(orig, here, 3) )
{ {
bcopy (here, best, 3 * sizeof(CH)); /* alpha channel holds old value */ memcpy (best, here, 3 * sizeof(CH)); /* alpha channel holds old value */
} }
break; break;
case GRAYA_IMAGE: case GRAYA_IMAGE:
@ -903,11 +902,11 @@ propagate_opaque (image_type, channels, orig, here, best, tmp)
{ {
case RGBA_IMAGE: case RGBA_IMAGE:
if ( best[3] < here[3] && value_difference_check(orig, here, 3) ) if ( best[3] < here[3] && value_difference_check(orig, here, 3) )
bcopy(here, best, channels * sizeof(CH)); memcpy(best, here, channels * sizeof(CH));
break; break;
case GRAYA_IMAGE: case GRAYA_IMAGE:
if ( best[1] < here[1] && value_difference_check(orig, here, 1)) if ( best[1] < here[1] && value_difference_check(orig, here, 1))
bcopy(here, best, channels * sizeof(CH)); memcpy(best, here, channels * sizeof(CH));
break; break;
default: default:
break; break;
@ -925,11 +924,11 @@ propagate_transparent (image_type, channels, orig, here, best, tmp)
{ {
case RGBA_IMAGE: case RGBA_IMAGE:
if ( here[3] < best[3] && value_difference_check(orig, here, 3)) if ( here[3] < best[3] && value_difference_check(orig, here, 3))
bcopy(here, best, channels * sizeof(CH)); memcpy(best, here, channels * sizeof(CH));
break; break;
case GRAYA_IMAGE: case GRAYA_IMAGE:
if ( here[1] < best[1] && value_difference_check(orig, here, 1)) if ( here[1] < best[1] && value_difference_check(orig, here, 1))
bcopy(here, best, channels * sizeof(CH)); memcpy(best, here, channels * sizeof(CH));
break; break;
default: default:
break; break;

View File

@ -126,7 +126,6 @@ run(char *name, int nparam, GParam *param,
*nretvals = 1; *nretvals = 1;
*retvals = rvals; *retvals = rvals;
/* bzero(&args, sizeof(struct piArgs)); */
memset(&args,(int)0,sizeof(struct piArgs)); memset(&args,(int)0,sizeof(struct piArgs));
args.type=-1; args.type=-1;
gimp_get_data("plug_in_waves", &args); gimp_get_data("plug_in_waves", &args);

View File

@ -142,7 +142,6 @@ run(gchar *name, gint nparam, GParam *param,
*nretvals = 1; *nretvals = 1;
*retvals = rvals; *retvals = rvals;
/* bzero(&args, sizeof(struct piArgs)); */
memset(&args,(int)0,sizeof(struct piArgs)); memset(&args,(int)0,sizeof(struct piArgs));
rvals[0].type = PARAM_STATUS; rvals[0].type = PARAM_STATUS;
@ -332,9 +331,7 @@ int pluginCore(struct piArgs *argp) {
srcbuf=(guchar*)malloc(rowsize*3); srcbuf=(guchar*)malloc(rowsize*3);
dstbuf=(guchar*)malloc(rowsize); dstbuf=(guchar*)malloc(rowsize);
/* bzero(srcbuf, rowsize*3); */
memset(srcbuf,(int)0,(size_t)(rowsize*3)); memset(srcbuf,(int)0,(size_t)(rowsize*3));
/* bzero(dstbuf, rowsize); */
memset(dstbuf,(int)0,(size_t)rowsize); memset(dstbuf,(int)0,(size_t)rowsize);
EmbossInit(DtoR(argp->azimuth), DtoR(argp->elevation), argp->depth); EmbossInit(DtoR(argp->azimuth), DtoR(argp->elevation), argp->depth);
@ -344,14 +341,14 @@ int pluginCore(struct piArgs *argp) {
/* first row */ /* first row */
gimp_pixel_rgn_get_rect(&src, srcbuf, 0, 0, width, 3); gimp_pixel_rgn_get_rect(&src, srcbuf, 0, 0, width, 3);
bcopy(srcbuf+rowsize, srcbuf, rowsize); memcpy(srcbuf, srcbuf+rowsize, rowsize);
EmbossRow(srcbuf, argp->embossp ? (guchar *)0 : srcbuf, EmbossRow(srcbuf, argp->embossp ? (guchar *)0 : srcbuf,
dstbuf, width, bypp, has_alpha); dstbuf, width, bypp, has_alpha);
gimp_pixel_rgn_set_row(&dst, dstbuf, 0, 0, width); gimp_pixel_rgn_set_row(&dst, dstbuf, 0, 0, width);
/* last row */ /* last row */
gimp_pixel_rgn_get_rect(&src, srcbuf, 0, height-3, width, 3); gimp_pixel_rgn_get_rect(&src, srcbuf, 0, height-3, width, 3);
bcopy(srcbuf+rowsize, srcbuf+rowsize*2, rowsize); memcpy(srcbuf+rowsize*2, srcbuf+rowsize, rowsize);
EmbossRow(srcbuf, argp->embossp ? (guchar *)0 : srcbuf, EmbossRow(srcbuf, argp->embossp ? (guchar *)0 : srcbuf,
dstbuf, width, bypp, has_alpha); dstbuf, width, bypp, has_alpha);
gimp_pixel_rgn_set_row(&dst, dstbuf, 0, height-1, width); gimp_pixel_rgn_set_row(&dst, dstbuf, 0, height-1, width);
@ -467,8 +464,8 @@ emboss_do_preview(GtkWidget *w) {
dst = malloc(rowsize); dst = malloc(rowsize);
c = malloc(rowsize*3); c = malloc(rowsize*3);
bcopy(thePreview->bits, c, rowsize); memcpy(c, thePreview->bits, rowsize);
bcopy(thePreview->bits, c+rowsize, rowsize*2); memcpy(c+rowsize, thePreview->bits, rowsize*2);
EmbossInit(DtoR(ap->azimuth), DtoR(ap->elevation), ap->depth); EmbossInit(DtoR(ap->azimuth), DtoR(ap->elevation), ap->depth);
EmbossRow(c, ap->embossp ? (guchar *)0 : c, EmbossRow(c, ap->embossp ? (guchar *)0 : c,
@ -476,9 +473,9 @@ emboss_do_preview(GtkWidget *w) {
gtk_preview_draw_row(GTK_PREVIEW(theWidget), gtk_preview_draw_row(GTK_PREVIEW(theWidget),
dst, 0, 0, thePreview->width); dst, 0, 0, thePreview->width);
bcopy(thePreview->bits+((thePreview->height-2)*rowsize), c, rowsize*2); memcpy(c, thePreview->bits+((thePreview->height-2)*rowsize), rowsize*2);
bcopy(thePreview->bits+((thePreview->height-1)*rowsize), memcpy(c+(rowsize*2), thePreview->bits+((thePreview->height-1)*rowsize),
c+(rowsize*2), rowsize); rowsize);
EmbossRow(c, ap->embossp ? (guchar *)0 : c, EmbossRow(c, ap->embossp ? (guchar *)0 : c,
dst, thePreview->width, thePreview->bpp, FALSE); dst, thePreview->width, thePreview->bpp, FALSE);
gtk_preview_draw_row(GTK_PREVIEW(theWidget), gtk_preview_draw_row(GTK_PREVIEW(theWidget),

View File

@ -189,12 +189,12 @@ void render_rectangle(spec, out, out_width, field, nchan, progress)
points = (point *) (last_block + (sizeof(bucket) + sizeof(abucket)) * nbuckets); points = (point *) (last_block + (sizeof(bucket) + sizeof(abucket)) * nbuckets);
} }
bzero((char *) accumulate, sizeof(abucket) * nbuckets); memset((char *) accumulate, 0, sizeof(abucket) * nbuckets);
for (batch_num = 0; batch_num < nbatches; batch_num++) { for (batch_num = 0; batch_num < nbatches; batch_num++) {
double batch_time; double batch_time;
double sample_density; double sample_density;
control_point cp; control_point cp;
bzero((char *) buckets, sizeof(bucket) * nbuckets); memset((char *) buckets, 0, sizeof(bucket) * nbuckets);
batch_time = spec->time + temporal_deltas[batch_num]; batch_time = spec->time + temporal_deltas[batch_num];
/* interpolate and get a control point */ /* interpolate and get a control point */

View File

@ -228,7 +228,6 @@ run(char *name, int nparam, GParam *param,
*nretvals = 1; *nretvals = 1;
*retvals = rvals; *retvals = rvals;
/* bzero(&args, sizeof(struct piArgs)); */
memset(&args,(int)0,sizeof(struct piArgs)); memset(&args,(int)0,sizeof(struct piArgs));
args.mode=-1; args.mode=-1;

View File

@ -135,7 +135,6 @@ run(char *name, gint nparam, GParam *param,
*nretvals = 1; *nretvals = 1;
*retvals = rvals; *retvals = rvals;
/* bzero(&args, sizeof(struct piArgs)); */
memset(&args,(int)0,sizeof(struct piArgs)); memset(&args,(int)0,sizeof(struct piArgs));
args.radius=-1.0; args.radius=-1.0;
@ -213,9 +212,7 @@ gint pluginCore(struct piArgs *argp) {
srcbuf=(guchar*)malloc(width*Bpp*3); srcbuf=(guchar*)malloc(width*Bpp*3);
dstbuf=(guchar*)malloc(width*Bpp); dstbuf=(guchar*)malloc(width*Bpp);
/* bzero(srcbuf, rowsize*3); */
memset(srcbuf,(int)0,(size_t)(rowsize*3)); memset(srcbuf,(int)0,(size_t)(rowsize*3));
/* bzero(dstbuf, rowsize); */
memset(dstbuf,(int)0,(size_t)rowsize); memset(dstbuf,(int)0,(size_t)rowsize);
filtno=nlfiltInit(argp->alpha, argp->radius, argp->filter); filtno=nlfiltInit(argp->alpha, argp->radius, argp->filter);
@ -223,13 +220,13 @@ gint pluginCore(struct piArgs *argp) {
/* first row */ /* first row */
gimp_pixel_rgn_get_rect(&srcPr, srcbuf, 0, 0, width, 3); gimp_pixel_rgn_get_rect(&srcPr, srcbuf, 0, 0, width, 3);
bcopy(srcbuf+width*Bpp, srcbuf, rowsize); memcpy(srcbuf, srcbuf+width*Bpp, rowsize);
nlfiltRow(srcbuf, dstbuf, width, Bpp, filtno); nlfiltRow(srcbuf, dstbuf, width, Bpp, filtno);
gimp_pixel_rgn_set_row(&dstPr, dstbuf, 0, 0, width); gimp_pixel_rgn_set_row(&dstPr, dstbuf, 0, 0, width);
/* last row */ /* last row */
gimp_pixel_rgn_get_rect(&srcPr, srcbuf, 0, height-3, width, 3); gimp_pixel_rgn_get_rect(&srcPr, srcbuf, 0, height-3, width, 3);
bcopy(srcbuf+rowsize, srcbuf+rowsize*2, rowsize); memcpy(srcbuf+rowsize*2, srcbuf+rowsize, rowsize);
nlfiltRow(srcbuf, dstbuf, width, Bpp, filtno); nlfiltRow(srcbuf, dstbuf, width, Bpp, filtno);
gimp_pixel_rgn_set_row(&dstPr, dstbuf, 0, height-1, width); gimp_pixel_rgn_set_row(&dstPr, dstbuf, 0, height-1, width);
@ -346,16 +343,16 @@ nlfilt_do_preview(GtkWidget *w) {
rowsize=thePreview->width*thePreview->bpp; rowsize=thePreview->width*thePreview->bpp;
dst = malloc(rowsize); dst = malloc(rowsize);
c = malloc(rowsize*3); c = malloc(rowsize*3);
bcopy(thePreview->bits, c, rowsize); memcpy(c, thePreview->bits, rowsize);
bcopy(thePreview->bits, c+rowsize, rowsize*2); memcpy(c+rowsize, thePreview->bits, rowsize*2);
filtno = nlfiltInit(ap->alpha, ap->radius, ap->filter); filtno = nlfiltInit(ap->alpha, ap->radius, ap->filter);
nlfiltRow(c, dst, thePreview->width, thePreview->bpp, filtno); nlfiltRow(c, dst, thePreview->width, thePreview->bpp, filtno);
gtk_preview_draw_row(GTK_PREVIEW(theWidget), gtk_preview_draw_row(GTK_PREVIEW(theWidget),
dst, 0, 0, thePreview->width); dst, 0, 0, thePreview->width);
bcopy(thePreview->bits+((thePreview->height-2)*rowsize), c, rowsize*2); memcpy(c, thePreview->bits+((thePreview->height-2)*rowsize), rowsize*2);
bcopy(thePreview->bits+((thePreview->height-1)*rowsize), memcpy(c+(rowsize*2), thePreview->bits+((thePreview->height-1)*rowsize),
c+(rowsize*2), rowsize); rowsize);
gtk_preview_draw_row(GTK_PREVIEW(theWidget), gtk_preview_draw_row(GTK_PREVIEW(theWidget),
dst, 0, thePreview->height-1, thePreview->width); dst, 0, thePreview->height-1, thePreview->width);
free(c); free(c);

View File

@ -39,7 +39,6 @@
#define PROGRESS_NAME "value propagating..." #define PROGRESS_NAME "value propagating..."
#define MENU_POSITION "<Image>/Filters/Distorts/Value Propagate" #define MENU_POSITION "<Image>/Filters/Distorts/Value Propagate"
/* void bcopy(void *, void *, int); */
typedef guchar CH; typedef guchar CH;
#define RGB (1 << 0) #define RGB (1 << 0)
#define GRAY (1 << 1) #define GRAY (1 << 1)
@ -411,7 +410,7 @@ value_propagate_body (gint drawable_id)
dest = dest_row + (x * bytes); dest = dest_row + (x * bytes);
here = cr + (x * bytes); here = cr + (x * bytes);
/* *** copy source value to best value holder *** */ /* *** copy source value to best value holder *** */
bcopy ((void *)here, (void *)best, bytes); memcpy ((void *)best, (void *)here, bytes);
if ( operation.initializer ) if ( operation.initializer )
(* operation.initializer)(dtype, bytes, best, here, &tmp); (* operation.initializer)(dtype, bytes, best, here, &tmp);
/* *** gather neighbors' values: loop-unfolded version *** */ /* *** gather neighbors' values: loop-unfolded version *** */
@ -569,7 +568,7 @@ propagate_white (dtype, bytes, orig, here, best, tmp)
if ( *(float *)tmp < v_here && value_difference_check(orig, here, 3) ) if ( *(float *)tmp < v_here && value_difference_check(orig, here, 3) )
{ {
*(float *)tmp = v_here; *(float *)tmp = v_here;
bcopy(here, best, 3 * sizeof(CH)); /* alpha channel holds old value */ memcpy(best, here, 3 * sizeof(CH)); /* alpha channel holds old value */
} }
break; break;
case GRAYA_IMAGE: case GRAYA_IMAGE:
@ -615,7 +614,7 @@ propagate_black (image_type, channels, orig, here, best, tmp)
if ( v_here < *(float *)tmp && value_difference_check(orig, here, 3) ) if ( v_here < *(float *)tmp && value_difference_check(orig, here, 3) )
{ {
*(float *)tmp = v_here; *(float *)tmp = v_here;
bcopy (here, best, 3 * sizeof(CH)); /* alpha channel holds old value */ memcpy (best, here, 3 * sizeof(CH)); /* alpha channel holds old value */
} }
break; break;
case GRAYA_IMAGE: case GRAYA_IMAGE:
@ -695,13 +694,13 @@ propagate_middle (image_type, channels, orig, here, best, tmp)
if ( (v_here <= data->minv) && value_difference_check(orig, here, 3) ) if ( (v_here <= data->minv) && value_difference_check(orig, here, 3) )
{ {
data->minv = v_here; data->minv = v_here;
bcopy (here, data->min, 3*sizeof(CH)); memcpy (data->min, here, 3*sizeof(CH));
data->min_modified = 1; data->min_modified = 1;
} }
if ( data->maxv <= v_here && value_difference_check(orig, here, 3) ) if ( data->maxv <= v_here && value_difference_check(orig, here, 3) )
{ {
data->maxv = v_here; data->maxv = v_here;
bcopy (here, data->max, 3*sizeof(CH)); memcpy (data->max, here, 3*sizeof(CH));
data->max_modified = 1; data->max_modified = 1;
} }
break; break;
@ -881,7 +880,7 @@ propagate_a_color (image_type, channels, orig, here, best, tmp)
if ( here[0] == fg[0] && here[1] == fg[1] && here[2] == fg[2] && if ( here[0] == fg[0] && here[1] == fg[1] && here[2] == fg[2] &&
value_difference_check(orig, here, 3) ) value_difference_check(orig, here, 3) )
{ {
bcopy (here, best, 3 * sizeof(CH)); /* alpha channel holds old value */ memcpy (best, here, 3 * sizeof(CH)); /* alpha channel holds old value */
} }
break; break;
case GRAYA_IMAGE: case GRAYA_IMAGE:
@ -903,11 +902,11 @@ propagate_opaque (image_type, channels, orig, here, best, tmp)
{ {
case RGBA_IMAGE: case RGBA_IMAGE:
if ( best[3] < here[3] && value_difference_check(orig, here, 3) ) if ( best[3] < here[3] && value_difference_check(orig, here, 3) )
bcopy(here, best, channels * sizeof(CH)); memcpy(best, here, channels * sizeof(CH));
break; break;
case GRAYA_IMAGE: case GRAYA_IMAGE:
if ( best[1] < here[1] && value_difference_check(orig, here, 1)) if ( best[1] < here[1] && value_difference_check(orig, here, 1))
bcopy(here, best, channels * sizeof(CH)); memcpy(best, here, channels * sizeof(CH));
break; break;
default: default:
break; break;
@ -925,11 +924,11 @@ propagate_transparent (image_type, channels, orig, here, best, tmp)
{ {
case RGBA_IMAGE: case RGBA_IMAGE:
if ( here[3] < best[3] && value_difference_check(orig, here, 3)) if ( here[3] < best[3] && value_difference_check(orig, here, 3))
bcopy(here, best, channels * sizeof(CH)); memcpy(best, here, channels * sizeof(CH));
break; break;
case GRAYA_IMAGE: case GRAYA_IMAGE:
if ( here[1] < best[1] && value_difference_check(orig, here, 1)) if ( here[1] < best[1] && value_difference_check(orig, here, 1))
bcopy(here, best, channels * sizeof(CH)); memcpy(best, here, channels * sizeof(CH));
break; break;
default: default:
break; break;

View File

@ -126,7 +126,6 @@ run(char *name, int nparam, GParam *param,
*nretvals = 1; *nretvals = 1;
*retvals = rvals; *retvals = rvals;
/* bzero(&args, sizeof(struct piArgs)); */
memset(&args,(int)0,sizeof(struct piArgs)); memset(&args,(int)0,sizeof(struct piArgs));
args.type=-1; args.type=-1;
gimp_get_data("plug_in_waves", &args); gimp_get_data("plug_in_waves", &args);