The way is now free for a new millenium without sprintf being used together with

gettext.


--Sven
This commit is contained in:
Sven Neumann 1999-12-30 18:54:17 +00:00
parent f9b657fc05
commit 1c2b0228ca
40 changed files with 318 additions and 271 deletions

View File

@ -1,3 +1,50 @@
Thu Dec 30 19:45:13 CET 1999 Sven Neumann <sven@gimp.org>
* plug-ins/bmp/bmpread.c
* plug-ins/bmp/bmpwrite.c
* plug-ins/common/compose.c
* plug-ins/common/gifload.c
* plug-ins/common/normalize.c
* plug-ins/common/png.c
* plug-ins/common/sunras.c
* plug-ins/common/warp.c
* plug-ins/common/xbm.c
* plug-ins/common/zealouscrop.c
* plug-ins/fits/fits.c
* plug-ins/flame/flame.c
* plug-ins/gap/gap_arr_dialog.c
* plug-ins/gap/gap_filter_foreach.c
* plug-ins/gap/gap_lib.c
* plug-ins/gap/gap_mod_layer.c
* plug-ins/gap/gap_mov_dialog.c
* plug-ins/gap/gap_mpege.c
* plug-ins/gap/gap_range_ops.c
* plug-ins/gap/gap_split.c
* plug-ins/gdyntext/charmap.c
* plug-ins/gimpressionist/brush.c
* plug-ins/gimpressionist/color.c
* plug-ins/gimpressionist/general.c
* plug-ins/gimpressionist/gimp.c
* plug-ins/gimpressionist/orientation.c
* plug-ins/gimpressionist/paper.c
* plug-ins/gimpressionist/placement.c
* plug-ins/gimpressionist/ppmtool.c
* plug-ins/gimpressionist/ppmtool.h
* plug-ins/gimpressionist/presets.c
* plug-ins/gimpressionist/repaint.c
* plug-ins/gimpressionist/size.c
* plug-ins/ifscompose/ifscompose.c
* plug-ins/imagemap/imap_cmd_guides.c
* plug-ins/imagemap/imap_edit_area_info.c
* plug-ins/imagemap/imap_menu.c
* plug-ins/print/print.c
* po-plug-ins/POTFILES.in
Got rid of all occurences of sprintf together with gettext and removed
translation tags from console output.
In a few places I also changed malloc to g_malloc and friends.
Thu Dec 30 15:21:29 GMT 1999 Adam D. Moss <adam@gimp.org>
* plug-ins/common/animoptimize.c: PDB interface patch

View File

@ -45,8 +45,7 @@ ReadBMP (char *name)
if (interactive_bmp)
{
temp_buf = g_malloc (strlen (name) + 11);
sprintf (temp_buf, _("Loading %s:"), name);
temp_buf = g_strdup_printf (_("Loading %s:"), name);
gimp_progress_init (temp_buf);
g_free (temp_buf);
}

View File

@ -168,8 +168,7 @@ WriteBMP (char *filename,
if (interactive_bmp)
{
temp_buf = g_malloc (strlen (filename) + 11);
sprintf (temp_buf, _("Saving %s:"), filename);
temp_buf = g_strdup_printf (_("Saving %s:"), filename);
gimp_progress_init (temp_buf);
g_free (temp_buf);
}

View File

@ -273,7 +273,7 @@ run (char *name,
GStatusType status = STATUS_SUCCESS;
gint32 image_ID, drawable_ID;
int compose_by_drawable;
char msg[256];
gchar *msg;
INIT_I18N_UI ();
@ -302,9 +302,10 @@ run (char *name,
layer_list = gimp_image_get_layers (param[1].data.d_int32, &nlayers);
if ((layer_list == NULL) || (nlayers <= 0))
{
sprintf (msg, "compose: Could not get layers for image %d",
(int)param[1].data.d_int32);
msg = g_strdup_printf (_("compose: Could not get layers for image %d"),
(int)param[1].data.d_int32);
show_message (msg);
g_free (msg);
return;
}
drawable_ID = layer_list[0];
@ -418,7 +419,7 @@ compose (char *compose_type,
if ( (width != (int)gimp_drawable_width (compose_ID[j]))
|| (height != (int)gimp_drawable_height (compose_ID[j])))
{
show_message ("compose: drawables have different size");
show_message (_("Compose: Drawables have different size"));
return -1;
}
}
@ -435,7 +436,7 @@ compose (char *compose_type,
if ( (width != (int)gimp_image_width (compose_ID[j]))
|| (height != (int)gimp_image_height (compose_ID[j])))
{
show_message ("compose: images have different size");
show_message (_("Compose: Images have different size"));
return -1;
}
}
@ -448,7 +449,7 @@ compose (char *compose_type,
g32 = gimp_image_get_layers (compose_ID[j], &num_layers);
if ((g32 == NULL) || (num_layers <= 0))
{
show_message ("compose: error in getting layer IDs");
show_message (_("Compose: Error in getting layer IDs"));
return (-1);
}
@ -464,11 +465,13 @@ compose (char *compose_type,
/* Check bytes per pixel */
incr_src[j] = drawable_src[j]->bpp;
if ((incr_src[j] != 1) && (incr_src[j] != 2))
{char msg[256];
sprintf (msg, _("compose: image is not a gray image (bpp=%d)"),
incr_src[j]);
show_message (msg);
return (-1);
{
gchar *msg;
g_strdup_printf (_("Compose: Image is not a gray image (bpp=%d)"),
incr_src[j]);
show_message (msg);
g_free (msg);
return (-1);
}
/* Get pixel region */
@ -478,11 +481,6 @@ compose (char *compose_type,
/* Get memory for retrieving information */
src[j] = (unsigned char *)g_malloc (tile_height * width
* drawable_src[j]->bpp);
if (src[j] == NULL)
{
show_message (_("compose: not enough memory"));
return (-1);
}
}
/* Create new image */
@ -492,13 +490,6 @@ compose (char *compose_type,
width, height, gdtype_dst,
&layer_ID_dst, &drawable_dst, &pixel_rgn_dst);
dst = (unsigned char *)g_malloc (tile_height * width * drawable_dst->bpp);
if (dst == NULL)
{
for (j = 0; j < num_images; j++)
g_free (src[j]);
show_message (_("compose: not enough memory"));
return (-1);
}
/* Do the composition */
i = 0;

View File

@ -801,6 +801,7 @@ ReadImage (FILE *fd,
gint v;
gint i, j;
gchar *framename;
gchar *framename_ptr;
gboolean alpha_frame = FALSE;
int nreturn_vals;
static int previous_disposal;
@ -894,15 +895,30 @@ ReadImage (FILE *fd,
switch (previous_disposal)
{
case 0x00: break; /* 'don't care' */
case 0x01: framename = g_strconcat (framename, _(" (combine)"), NULL); break;
case 0x02: framename = g_strconcat (framename, _(" (replace)"), NULL); break;
case 0x03: framename = g_strconcat (framename, _(" (combine)"), NULL); break;
case 0x00:
break; /* 'don't care' */
case 0x01:
framename_ptr = framename;
framename = g_strconcat (framename, " (combine)", NULL);
g_free (framename_ptr);
break;
case 0x02:
framename_ptr = framename;
framename = g_strconcat (framename, " (replace)", NULL);
g_free (framename_ptr);
break;
case 0x03:
framename_ptr = framename;
framename = g_strconcat (framename, " (combine)", NULL);
g_free (framename_ptr);
break;
case 0x04:
case 0x05:
case 0x06:
case 0x07:
framename = g_strconcat (framename, _(" (unknown disposal)"), NULL);
framename_ptr = framename;
framename = g_strconcat (framename, " (unknown disposal)", NULL);
g_free (framename_ptr);
g_message ("GIF: Hmm... please forward this GIF to the "
"GIF plugin author!\n (adam@foxbox.org)\n");
break;

View File

@ -152,8 +152,8 @@ indexed_norma(gint32 image_ID) /* a.d.m. */
if (cmap==NULL)
{
printf(_("normalize: cmap was NULL! Quitting...\n"));
gimp_quit();
printf ("normalize: cmap was NULL! Quitting...\n");
return;
}
for (i=0;i<ncols;i++)

View File

@ -390,7 +390,7 @@ load_image (char *filename) /* I - File to load */
if (strrchr(filename, '/') != NULL)
progress = g_strdup_printf (_("Loading %s:"), strrchr(filename, '/') + 1);
else
progress = g_strdup_printf (progress, _("Loading %s:"), filename);
progress = g_strdup_printf (_("Loading %s:"), filename);
gimp_progress_init(progress);
g_free (progress);

View File

@ -437,7 +437,7 @@ load_image (char *filename)
if (l_run_mode != RUN_NONINTERACTIVE)
{
temp = g_strdup_printf (temp, _("Loading %s:"), filename);
temp = g_strdup_printf (_("Loading %s:"), filename);
gimp_progress_init (temp);
g_free (temp);
}
@ -1727,7 +1727,7 @@ show_message (char *message)
if (l_run_mode == RUN_INTERACTIVE)
gimp_message (message);
else
fprintf (stderr, _("sunras: %s\n"), message);
fprintf (stderr, "sunras: %s\n", message);
}
static int

View File

@ -1104,26 +1104,25 @@ diff (GDrawable *drawable,
/* allocate row buffers for source & dest. data */
/* P.S. Hey, what happens if malloc returns NULL, hmmm..? */
prev_row = (guchar *) malloc ((x2 - x1 + 2) * src_bytes);
cur_row = (guchar *) malloc ((x2 - x1 + 2) * src_bytes);
next_row = (guchar *) malloc ((x2 - x1 + 2) * src_bytes);
prev_row = g_new (guchar, (x2 - x1 + 2) * src_bytes);
cur_row = g_new (guchar, (x2 - x1 + 2) * src_bytes);
next_row = g_new (guchar, (x2 - x1 + 2) * src_bytes);
prev_row_g = (guchar *) malloc ((x2 - x1 + 2) * src_bytes);
cur_row_g = (guchar *) malloc ((x2 - x1 + 2) * src_bytes);
next_row_g = (guchar *) malloc ((x2 - x1 + 2) * src_bytes);
prev_row_g = g_new (guchar, (x2 - x1 + 2) * src_bytes);
cur_row_g = g_new (guchar, (x2 - x1 + 2) * src_bytes);
next_row_g = g_new (guchar, (x2 - x1 + 2) * src_bytes);
cur_row_v = (guchar *) malloc ((x2 - x1 + 2) * src_bytes); /* vector map */
cur_row_m = (guchar *) malloc ((x2 - x1 + 2) * src_bytes); /* magnitude map */
cur_row_v = g_new (guchar, (x2 - x1 + 2) * src_bytes); /* vector map */
cur_row_m = g_new (guchar, (x2 - x1 + 2) * src_bytes); /* magnitude map */
destx = (guchar *) malloc ((x2 - x1) * dest_bytes);
desty = (guchar *) malloc ((x2 - x1) * dest_bytes);
destx = g_new (guchar, (x2 - x1) * dest_bytes);
desty = g_new (guchar, (x2 - x1) * dest_bytes);
if ((desty==NULL) || (destx==NULL) || (cur_row_m==NULL) || (cur_row_v==NULL)
|| (next_row_g==NULL) || (cur_row_g==NULL) || (prev_row_g==NULL)
|| (next_row==NULL) || (cur_row==NULL) || (prev_row==NULL)) {
fprintf(stderr, _("Warp diff: error allocating memory.\n"));
fprintf(stderr, "Warp diff: error allocating memory.\n");
exit(1);
}
@ -1315,17 +1314,17 @@ diff (GDrawable *drawable,
gimp_progress_init ( _("Smoothing Y gradient..."));
blur16(draw_yd);
free (prev_row); /* row buffers allocated at top of fn. */
free (cur_row);
free (next_row);
free (prev_row_g); /* row buffers allocated at top of fn. */
free (cur_row_g);
free (next_row_g);
free (cur_row_v);
free (cur_row_m);
g_free (prev_row); /* row buffers allocated at top of fn. */
g_free (cur_row);
g_free (next_row);
g_free (prev_row_g); /* row buffers allocated at top of fn. */
g_free (cur_row_g);
g_free (next_row_g);
g_free (cur_row_v);
g_free (cur_row_m);
free (destx);
free (desty);
g_free (destx);
g_free (desty);
*xl_id = xlayer_id; /* pass back the X and Y layer ID numbers */
*yl_id = ylayer_id;

View File

@ -710,7 +710,7 @@ not_bw_dialog (void)
if (!gtk_initialized)
{
fprintf (stderr, _("XBM: can only save two color indexed images\n"));
fprintf (stderr, "XBM: can only save two color indexed images\n");
return;
}

View File

@ -206,7 +206,7 @@ static void do_zcrop(GDrawable *drawable, gint32 image_id)
if (((livingcols==0) || (livingrows==0)) ||
((livingcols==width) && (livingrows==height)))
{
printf(_("ZealousCrop(tm): Nothing to be done.\n"));
printf("ZealousCrop(tm): Nothing to be done.\n");
return;
}

View File

@ -483,8 +483,7 @@ save_image (char *filename,
if (l_run_mode != RUN_NONINTERACTIVE)
{
temp = g_malloc (strlen (filename) + 64);
sprintf (temp, _("Saving %s:"), filename);
temp = g_strdup_printf (_("Saving %s:"), filename);
gimp_progress_init (temp);
g_free (temp);
}

View File

@ -277,7 +277,7 @@ doit (GDrawable * drawable)
bytes = drawable->bpp;
if (3 != bytes && 4 != bytes) {
fprintf(stderr, _("only works with three or four channels, not %d.\n"), bytes);
fprintf(stderr, "only works with three or four channels, not %d.\n", bytes);
return;
}

View File

@ -672,7 +672,7 @@ pair_flt_create_value(t_pair *pair, char *title, GtkTable *table, int row, t_arr
if((*arr_ptr->flt_format != '%')
|| (arr_ptr->flt_format[strlen(arr_ptr->flt_format) -1] != 'f'))
{
printf( _("pair_flt_create_value: Bad FloatFormat ignored %s\n"), arr_ptr->flt_format);
printf( "pair_flt_create_value: Bad FloatFormat ignored %s\n", arr_ptr->flt_format);
arr_ptr->flt_format = "%0.2f";
}
}
@ -825,7 +825,7 @@ pair_int_create_value(t_pair *pair, char *title, GtkTable *table, int row, t_arr
if((*arr_ptr->int_format != '%')
|| (arr_ptr->int_format[strlen(arr_ptr->int_format) -1] != 'd'))
{
printf( _("pair_int_create_value: Bad IntFormat ignored %s\n"), arr_ptr->int_format);
printf ("pair_int_create_value: Bad IntFormat ignored %s\n", arr_ptr->int_format);
arr_ptr->int_format = "%d";
}
}
@ -1056,10 +1056,10 @@ gint p_array_std_dialog(char *title_txt,
label_create_value(l_label_txt, GTK_TABLE(table), (l_idx + 1), arr_ptr);
break;
case WGT_ACT_BUTTON:
printf( _("WGT_ACT_BUTTON not implemented yet, widget type ignored\n"));
printf ("WGT_ACT_BUTTON not implemented yet, widget type ignored\n");
break;
default: /* undefined widget type */
printf( _("Unknown widget type %d ignored\n"), arr_ptr->widget_type);
printf ("Unknown widget type %d ignored\n", arr_ptr->widget_type);
break;
} /* end switch */

View File

@ -109,8 +109,8 @@ static gint p_pitstop(GRunModeType run_mode, char *plugin_name, gint text_flag,
char *step_backup_file, gint len_step_backup_file,
gint32 layer_idx)
{
char *l_env;
char l_msg[512];
gchar *l_env;
gchar *l_msg;
static t_but_arg l_but_argv[3];
gint l_but_argc;
gint l_argc;
@ -150,17 +150,19 @@ static gint p_pitstop(GRunModeType run_mode, char *plugin_name, gint text_flag,
}
if(text_flag == 0)
{
sprintf(l_msg, _("2.nd call of %s\n(define end-settings)"), plugin_name);
l_msg = g_strdup_printf (_("2.nd call of %s\n(define end-settings)"), plugin_name);
}
else
{
sprintf(l_msg, _("Non-Interactive call of %s\n(for all layers inbetween)"), plugin_name);
l_msg = g_strdup_printf (_("Non-Interactive call of %s\n(for all layers inbetween)"), plugin_name);
l_but_argc = 3;
l_argc = 1;
}
l_continue = p_array_std_dialog (_("Animated Filter apply"), l_msg,
l_argc, l_argv,
l_but_argc, l_but_argv, 0);
g_free (l_msg);
if(l_continue < 0) return -1;
else return l_continue;
@ -188,7 +190,7 @@ static void p_visibilty_restore(gint32 image_id, gint nlayers, int *visible_tab,
}
else
{
printf( _("Error: Plugin %s has changed Nr. of layers from %d to %d\ncould not restore Layer visibilty.\n"),
printf ("Error: Plugin %s has changed Nr. of layers from %d to %d\ncould not restore Layer visibilty.\n",
plugin_name, (int)nlayers, (int)l_nlayers2);
}
@ -204,12 +206,12 @@ static gint32 p_get_indexed_layerid(gint32 image_id, gint *nlayers, gint32 idx,
l_layers_list = gimp_image_get_layers(image_id, &l_nlayers2);
if(l_layers_list == NULL)
{
printf( _("Warning: cant get layers (maybe the image was closed)\n"));
printf ("Warning: cant get layers (maybe the image was closed)\n");
return -1;
}
if((l_nlayers2 != *nlayers) && (*nlayers > 0))
{
printf( _("Error: Plugin %s has changed Nr. of layers from %d to %d\nAnim Filter apply stopped.\n"),
printf ("Error: Plugin %s has changed Nr. of layers from %d to %d\nAnim Filter apply stopped.\n",
plugin_name, (int)*nlayers, (int)l_nlayers2);
return -1;
}
@ -260,7 +262,7 @@ int p_foreach_multilayer(GRunModeType run_mode, gint32 image_id,
l_rc = p_procedure_available(plugin_name, PTYP_CAN_OPERATE_ON_DRAWABLE);
if(l_rc < 0)
{
fprintf(stderr, _("ERROR: Plugin not available or wrong type %s\n"), plugin_name);
fprintf(stderr, "ERROR: Plugin not available or wrong type %s\n", plugin_name);
return -1;
}
@ -279,7 +281,7 @@ int p_foreach_multilayer(GRunModeType run_mode, gint32 image_id,
{
if(l_nlayers < 1)
{
fprintf(stderr, _("ERROR: need at 1 Layers to apply plugin !\n"));
fprintf(stderr, "ERROR: need at least 1 Layers to apply plugin !\n");
}
else
{
@ -309,7 +311,7 @@ int p_foreach_multilayer(GRunModeType run_mode, gint32 image_id,
l_child_pid = 0; /* fork(); */
if(l_child_pid < 0)
{
fprintf(stderr, _("ERROR: fork failed !\n"));
fprintf(stderr, "ERROR: fork failed !\n");
return -1;
}
@ -497,7 +499,7 @@ int p_foreach_multilayer(GRunModeType run_mode, gint32 image_id,
/* check if to save each step to backup file */
if((l_step_backup_file[0] != '\0') && (l_step_backup_file[0] != ' '))
{
printf( _("Saving image to backupfile:%s step = %d\n"),
printf ("Saving image to backupfile:%s step = %d\n",
l_step_backup_file, (int)l_idx);
p_save_xcf(image_id, l_step_backup_file);
}

View File

@ -1790,9 +1790,9 @@ int gap_goto(GRunModeType run_mode, gint32 image_id, int nr)
int rc;
t_anim_info *ainfo_ptr;
long l_dest;
char l_hline[50];
char l_title[50];
long l_dest;
gchar *l_hline;
gchar *l_title;
rc = -1;
ainfo_ptr = p_alloc_ainfo(image_id, run_mode);
@ -1804,18 +1804,21 @@ int gap_goto(GRunModeType run_mode, gint32 image_id, int nr)
if(run_mode == RUN_INTERACTIVE)
{
sprintf(l_title, _("Goto Frame (%ld/%ld)")
, ainfo_ptr->curr_frame_nr
, ainfo_ptr->frame_cnt);
sprintf(l_hline, _("Destination Frame Number (%ld - %ld)")
, ainfo_ptr->first_frame_nr
, ainfo_ptr->last_frame_nr);
l_title = g_strdup_printf (_("Goto Frame (%ld/%ld)")
, ainfo_ptr->curr_frame_nr
, ainfo_ptr->frame_cnt);
l_hline = g_strdup_printf (_("Destination Frame Number (%ld - %ld)")
, ainfo_ptr->first_frame_nr
, ainfo_ptr->last_frame_nr);
l_dest = p_slider_dialog(l_title, l_hline, _("Number :"), NULL
, ainfo_ptr->first_frame_nr
, ainfo_ptr->last_frame_nr
, ainfo_ptr->curr_frame_nr
, TRUE);
g_free (l_title);
g_free (l_hline);
if(l_dest < 0)
{
@ -1856,8 +1859,8 @@ int gap_del(GRunModeType run_mode, gint32 image_id, int nr)
long l_cnt;
long l_max;
char l_hline[50];
char l_title[50];
gchar *l_hline;
gchar *l_title;
rc = -1;
ainfo_ptr = p_alloc_ainfo(image_id, run_mode);
@ -1869,11 +1872,11 @@ int gap_del(GRunModeType run_mode, gint32 image_id, int nr)
if(run_mode == RUN_INTERACTIVE)
{
sprintf(l_title, _("Delete Frames (%ld/%ld)")
, ainfo_ptr->curr_frame_nr
, ainfo_ptr->frame_cnt);
sprintf(l_hline, _("Delete Frames from %ld to (Number)")
, ainfo_ptr->curr_frame_nr);
l_title = g_strdup_printf (_("Delete Frames (%ld/%ld)")
, ainfo_ptr->curr_frame_nr
, ainfo_ptr->frame_cnt);
l_hline = g_strdup_printf (_("Delete Frames from %ld to (Number)")
, ainfo_ptr->curr_frame_nr);
l_max = ainfo_ptr->last_frame_nr;
if(l_max == ainfo_ptr->curr_frame_nr)
@ -1891,6 +1894,9 @@ int gap_del(GRunModeType run_mode, gint32 image_id, int nr)
, ainfo_ptr->curr_frame_nr
, TRUE);
g_free (l_title);
g_free (l_hline);
if(l_cnt >= 0)
{
l_cnt = 1 + l_cnt - ainfo_ptr->curr_frame_nr;
@ -1930,11 +1936,11 @@ int gap_del(GRunModeType run_mode, gint32 image_id, int nr)
int p_dup_dialog(t_anim_info *ainfo_ptr, long *range_from, long *range_to)
{
static t_arr_arg argv[3];
char l_title[50];
gchar *l_title;
sprintf(l_title, _("Duplicate Frames (%ld/%ld)")
, ainfo_ptr->curr_frame_nr
, ainfo_ptr->frame_cnt);
l_title = g_strdup_printf (_("Duplicate Frames (%ld/%ld)")
, ainfo_ptr->curr_frame_nr
, ainfo_ptr->frame_cnt);
p_init_arr_arg(&argv[0], WGT_INT_PAIR);
argv[0].label_txt = _("From :");
@ -1961,13 +1967,16 @@ int p_dup_dialog(t_anim_info *ainfo_ptr, long *range_from, long *range_to)
argv[2].help_txt = _("Copy selected Range n-times \n(you may type in Values > 99)");
if(TRUE == p_array_dialog(l_title, _("Duplicate Framerange"), 3, argv))
{ *range_from = (long)(argv[0].int_ret);
*range_to = (long)(argv[1].int_ret);
{
g_free (l_title);
*range_from = (long)(argv[0].int_ret);
*range_to = (long)(argv[1].int_ret);
return (int)(argv[2].int_ret);
}
else
{
return -1;
g_free (l_title);
return -1;
}
@ -2039,8 +2048,7 @@ int gap_exchg(GRunModeType run_mode, gint32 image_id, int nr)
long l_dest;
long l_initial;
char l_hline[50];
char l_title[50];
gchar *l_title;
rc = -1;
l_initial = 1;
@ -2061,16 +2069,16 @@ int gap_exchg(GRunModeType run_mode, gint32 image_id, int nr)
{
l_initial = ainfo_ptr->last_frame_nr;
}
sprintf(l_title, _("Exchange current Frame (%ld)")
, ainfo_ptr->curr_frame_nr);
sprintf(l_hline, _("With Frame (Number)"));
l_title = g_strdup_printf (_("Exchange current Frame (%ld)")
, ainfo_ptr->curr_frame_nr);
l_dest = p_slider_dialog(l_title, l_hline, _("Number :"), NULL
, ainfo_ptr->first_frame_nr
, ainfo_ptr->last_frame_nr
, l_initial
, TRUE);
l_dest = p_slider_dialog(l_title, _("With Frame (Number)"), _("Number :"), NULL
, ainfo_ptr->first_frame_nr
, ainfo_ptr->last_frame_nr
, l_initial
, TRUE);
g_free (l_title);
if(0 != p_chk_framechange(ainfo_ptr))
{
l_dest = -1;
@ -2103,11 +2111,11 @@ int gap_exchg(GRunModeType run_mode, gint32 image_id, int nr)
int p_shift_dialog(t_anim_info *ainfo_ptr, long *range_from, long *range_to)
{
static t_arr_arg argv[3];
char l_title[50];
gchar *l_title;
sprintf(l_title, _("Framesequence Shift (%ld/%ld)")
, ainfo_ptr->curr_frame_nr
, ainfo_ptr->frame_cnt);
l_title = g_strdup_printf (_("Framesequence Shift (%ld/%ld)")
, ainfo_ptr->curr_frame_nr
, ainfo_ptr->frame_cnt);
p_init_arr_arg(&argv[0], WGT_INT_PAIR);
argv[0].label_txt = _("From :");
@ -2134,13 +2142,16 @@ int p_shift_dialog(t_anim_info *ainfo_ptr, long *range_from, long *range_to)
argv[2].help_txt = _("Renumber the affected framesequence \n(numbers are shifted in circle by N)");
if(TRUE == p_array_dialog(l_title, _("Framesequence shift"), 3, argv))
{ *range_from = (long)(argv[0].int_ret);
*range_to = (long)(argv[1].int_ret);
return (int)(argv[2].int_ret);
{
g_free (l_title);
*range_from = (long)(argv[0].int_ret);
*range_to = (long)(argv[1].int_ret);
return (int)(argv[2].int_ret);
}
else
{
return 0;
g_free (l_title);
return 0;
}

View File

@ -78,8 +78,6 @@ int p_layer_modify_dialog(t_anim_info *ainfo_ptr,
static t_but_arg b_argv[2];
gint l_rc;
static char l_buf[MAX_LAYERNAME];
/* Layer select modes */
static char *sel_args[7] = { N_("Pattern is equal to LayerName"),
N_("Pattern is Start of LayerName"),
@ -143,8 +141,6 @@ int p_layer_modify_dialog(t_anim_info *ainfo_ptr,
l_rc = -1;
sprintf(l_buf, _("Perform function on one or more Layer(s)\nin all frames of the selected framerange\n"));
/* the 3 Action Buttons */
b_argv[0].but_txt = _("OK");
b_argv[0].but_val = 0;
@ -152,7 +148,7 @@ int p_layer_modify_dialog(t_anim_info *ainfo_ptr,
b_argv[1].but_val = -1;
p_init_arr_arg(&argv[0], WGT_LABEL);
argv[0].label_txt = &l_buf[0];
argv[0].label_txt = _("Perform function on one or more Layer(s)\nin all frames of the selected framerange\n");
p_init_arr_arg(&argv[1], WGT_INT_PAIR);
argv[1].constraint = TRUE;
@ -249,8 +245,8 @@ int p_layer_modify_dialog(t_anim_info *ainfo_ptr,
static gint
p_pitstop_dialog(gint text_flag, char *filter_procname)
{
char *l_env;
char l_msg[512];
gchar *l_env;
gchar *l_msg;
static t_but_arg l_but_argv[2];
gint l_but_argc;
gint l_argc;
@ -279,16 +275,17 @@ p_pitstop_dialog(gint text_flag, char *filter_procname)
}
if(text_flag == 0)
{
sprintf(l_msg, _("2.nd call of %s\n(define end-settings)"), filter_procname);
l_msg = g_strdup_printf (_("2.nd call of %s\n(define end-settings)"), filter_procname);
}
else
{
sprintf(l_msg, _("Non-Interactive call of %s\n(for all selected layers)"), filter_procname);
l_msg = g_strdup_printf ( _("Non-Interactive call of %s\n(for all selected layers)"), filter_procname);
}
l_continue = p_array_std_dialog ( _("Animated Filter apply"), l_msg,
l_argc, l_argv,
l_but_argc, l_but_argv, 0);
g_free (l_msg);
return (l_continue);
} /* end p_pitstop_dialog */

View File

@ -89,6 +89,8 @@ extern int gap_debug; /* ==0 ... dont print debug infos */
GDK_BUTTON1_MOTION_MASK
#define LABEL_LENGTH 32
typedef struct {
gint run;
} t_mov_interface;
@ -121,12 +123,12 @@ typedef struct
GtkAdjustment *opacity_adj;
GtkEntry *rotation_ent;
GtkAdjustment *rotation_adj;
char X_Label[20];
char Y_Label[20];
char Opacity_Label[30];
char Wresize_Label[30];
char Hresize_Label[30];
char Rotation_Label[30];
char X_Label[LABEL_LENGTH];
char Y_Label[LABEL_LENGTH];
char Opacity_Label[LABEL_LENGTH];
char Wresize_Label[LABEL_LENGTH];
char Hresize_Label[LABEL_LENGTH];
char Rotation_Label[LABEL_LENGTH];
GtkWidget *X_LabelPtr;
GtkWidget *Y_LabelPtr;
GtkWidget *Opacity_LabelPtr;
@ -1078,13 +1080,13 @@ p_points_to_tab(t_mov_path_preview *path_ptr)
}
void p_update_point_labels(t_mov_path_preview *path_ptr)
{
sprintf(&path_ptr->X_Label[0], _("X [%d]: "), pvals->point_idx + 1);
sprintf(&path_ptr->Y_Label[0], _("Y [%d]: "), pvals->point_idx + 1);
sprintf(&path_ptr->Opacity_Label[0], _("Opacity [%d]: "), pvals->point_idx + 1);
sprintf(&path_ptr->Wresize_Label[0], _("Width [%d]: "), pvals->point_idx + 1);
sprintf(&path_ptr->Hresize_Label[0], _("Height [%d]: "), pvals->point_idx + 1);
sprintf(&path_ptr->Rotation_Label[0], _("Rotate deg[%d]: "), pvals->point_idx + 1);
{
snprintf(&path_ptr->X_Label[0], LABEL_LENGTH, _("X [%d]: "), pvals->point_idx + 1);
snprintf(&path_ptr->Y_Label[0], LABEL_LENGTH, _("Y [%d]: "), pvals->point_idx + 1);
snprintf(&path_ptr->Opacity_Label[0], LABEL_LENGTH, _("Opacity [%d]: "), pvals->point_idx + 1);
snprintf(&path_ptr->Wresize_Label[0], LABEL_LENGTH, _("Width [%d]: "), pvals->point_idx + 1);
snprintf(&path_ptr->Hresize_Label[0], LABEL_LENGTH, _("Height [%d]: "), pvals->point_idx + 1);
snprintf(&path_ptr->Rotation_Label[0], LABEL_LENGTH, _("Rotate deg[%d]: "), pvals->point_idx + 1);
if(NULL != path_ptr->X_LabelPtr)

View File

@ -515,7 +515,7 @@ int p_mpeg2encode_gen_parfile(t_anim_info *ainfo_ptr, t_mpg_par *mp_ptr)
l_fp = fopen(mp_ptr->parfile, "w");
if(l_fp == NULL)
{
fprintf(stderr, _("cant open MPEG Paramfile %s for write\n"), mp_ptr->parfile);
fprintf(stderr, "cant open MPEG Paramfile %s for write\n", mp_ptr->parfile);
return -1;
}
@ -1007,7 +1007,7 @@ int gap_mpeg_encode(GRunModeType run_mode,
}
else
{
printf ( _("sorry folks, NON_INTERACTIVE call .. not implemented yet\n"));
printf ("sorry folks, NON_INTERACTIVE call .. not implemented yet\n");
l_rc = -1;
}

View File

@ -99,9 +99,9 @@ p_anim_sizechange_dialog(t_anim_info *ainfo_ptr, t_gap_asiz asiz_mode,
long *offs_x, long *offs_y)
{
static t_arr_arg argv[4];
gint cnt;
char *title;
char hline[100];
gint cnt;
gchar *title;
gchar *hline;
gint l_width;
gint l_height;
gint l_rc;
@ -142,7 +142,7 @@ p_anim_sizechange_dialog(t_anim_info *ainfo_ptr, t_gap_asiz asiz_mode,
{
case ASIZ_CROP:
title = _("Crop AnimFrames (all)");
sprintf(hline, _("Crop (original %dx%d)"), l_width, l_height);
hline = g_strdup_printf (_("Crop (original %dx%d)"), l_width, l_height);
argv[0].int_max = l_width;
argv[0].constraint = TRUE;
argv[1].int_max = l_height;
@ -153,14 +153,14 @@ p_anim_sizechange_dialog(t_anim_info *ainfo_ptr, t_gap_asiz asiz_mode,
break;
case ASIZ_RESIZE:
title = _("Resize AnimFrames (all)");
sprintf(hline, _("Resize (original %dx%d)"), l_width, l_height);
hline = g_strdup_printf (_("Resize (original %dx%d)"), l_width, l_height);
argv[2].int_min = -l_width;
argv[3].int_min = -l_height;
cnt = 4;
break;
default:
title = _("Scale AnimFrames (all)");
sprintf(hline, _("Scale (original %dx%d)"), l_width, l_height);
hline = g_strdup_printf (_("Scale (original %dx%d)"), l_width, l_height);
cnt = 2;
break;
}
@ -175,7 +175,8 @@ p_anim_sizechange_dialog(t_anim_info *ainfo_ptr, t_gap_asiz asiz_mode,
if(asiz_mode == ASIZ_CROP)
{
l_rc = p_array_dialog(title, hline, cnt, argv);
g_free (hline);
*size_x = (long)(argv[0].int_ret);
*size_y = (long)(argv[1].int_ret);
*offs_x = (long)(argv[2].int_ret);
@ -1432,16 +1433,17 @@ p_frames_layer_del(t_anim_info *ainfo_ptr,
gint l_nlayers;
gint32 *l_layers_list;
gdouble l_percentage, l_percentage_step;
static char l_buff[50];
int l_rc;
gchar *l_buff;
int l_rc;
l_rc = 0;
l_percentage = 0.0;
if(ainfo_ptr->run_mode == RUN_INTERACTIVE)
{
sprintf(l_buff, _("Removing Layer (pos:%ld) from Frames .."), position);
l_buff = g_strdup_printf (_("Removing Layer (pos:%ld) from Frames .."), position);
gimp_progress_init(l_buff);
g_free (l_buff);
}

View File

@ -218,13 +218,13 @@ static long
p_split_dialog(t_anim_info *ainfo_ptr, gint *inverse_order, gint *no_alpha, char *extension, gint len_ext)
{
static t_arr_arg argv[4];
char buf[128];
gchar *buf;
buf = g_strdup_printf (_("%s\n%s\n(%s_0001.%s)\n"),
_("Make a frame (diskfile) from each Layer"),
_("frames are named: base_nr.extension"),
ainfo_ptr->basename, extension);
sprintf(buf, _("%s\n%s\n(%s_0001.%s)\n"),
_("Make a frame (diskfile) from each Layer"),
_("frames are named: base_nr.extension"),
ainfo_ptr->basename, extension);
p_init_arr_arg(&argv[0], WGT_LABEL);
argv[0].label_txt = &buf[0];
@ -248,13 +248,15 @@ p_split_dialog(t_anim_info *ainfo_ptr, gint *inverse_order, gint *no_alpha, char
_("Split Settings :"),
4, argv))
{
*inverse_order = argv[2].int_ret;
*no_alpha = argv[3].int_ret;
return 0;
g_free (buf);
*inverse_order = argv[2].int_ret;
*no_alpha = argv[3].int_ret;
return 0;
}
else
{
return -1;
g_free (buf);
return -1;
}
} /* end p_split_dialog */

View File

@ -86,7 +86,7 @@ static void charmap_init(CharMap *cm)
GtkWidget *button;
guint x, y, i;
gchar clabel[2];
gchar tip[20];
gchar *tip;
GtkTooltips *tooltips;
cm->width = 8;
@ -113,8 +113,9 @@ static void charmap_init(CharMap *cm)
gtk_signal_connect_after(GTK_OBJECT(button), "toggled",
GTK_SIGNAL_FUNC(on_charmap_char_toggled), cm);
gtk_widget_show(button);
sprintf(tip, _("Char: %c, %d, 0x%02x"), i < 32 ? ' ' : i, i, i);
tip = g_strdup_printf (_("Char: %c, %d, 0x%02x"), i < 32 ? ' ' : i, i, i);
gtk_tooltips_set_tip(tooltips, button, tip, NULL);
g_free (tip);
}
}

View File

@ -81,7 +81,7 @@ void brushdmenuselect(gint32 id, gpointer data)
rowstride = p->width * 3;
src_row = (guchar *)safemalloc((x2 - x1) * bpp);
src_row = g_new (guchar, (x2 - x1) * bpp);
gimp_pixel_rgn_init (&src_rgn, drawable, 0, 0, x2-x1, y2-y1, FALSE, FALSE);
@ -131,7 +131,7 @@ void brushdmenuselect(gint32 id, gpointer data)
}
}
}
free(src_row);
g_free (src_row);
if(bpp >= 3) pcvals.colorbrushes = 1;
else pcvals.colorbrushes = 0;
@ -346,17 +346,14 @@ void create_brushpage(GtkNotebook *notebook)
GtkWidget *scrolled_win, *list;
GtkWidget *tmpw;
GtkWidget *dmenu;
char title[100];
sprintf(title, "Brush");
labelbox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Brush"));
gtk_box_pack_start(GTK_BOX(labelbox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(labelbox);
menubox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Brush"));
gtk_box_pack_start(GTK_BOX(menubox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(menubox);

View File

@ -45,18 +45,15 @@ void create_colorpage(GtkNotebook *notebook)
GtkWidget *box0, *box1, *box2, *box3, *thispage;
GtkWidget *labelbox, *menubox;
GtkWidget *tmpw;
char title[100];
int i;
sprintf(title, _("Color"));
labelbox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Color"));
gtk_box_pack_start(GTK_BOX(labelbox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(labelbox);
menubox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Color"));
gtk_box_pack_start(GTK_BOX(menubox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(menubox);

View File

@ -129,17 +129,14 @@ void create_generalpage(GtkNotebook *notebook)
GtkWidget *box1, *box2, *box3, *box4, *thispage;
GtkWidget *labelbox, *menubox;
GtkWidget *tmpw, *colbutton;
char title[100];
sprintf(title, _("General"));
labelbox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("General"));
gtk_box_pack_start(GTK_BOX(labelbox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(labelbox);
menubox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("General"));
gtk_box_pack_start(GTK_BOX(menubox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(menubox);

View File

@ -214,7 +214,7 @@ void grabarea(void)
rowstride = p->width * 3;
src_row = (guchar *)safemalloc((x2 - x1) * bpp);
src_row = g_new (guchar, (x2 - x1) * bpp);
gimp_pixel_rgn_init (&src_rgn, drawable, 0, 0, x2-x1, y2-y1, FALSE, FALSE);
@ -268,7 +268,7 @@ void grabarea(void)
}
}
}
free(src_row);
g_free (src_row);
}
void gimpressionist_main(void)
@ -289,7 +289,7 @@ void gimpressionist_main(void)
has_alpha = gimp_drawable_has_alpha (drawable->id);
alpha = (has_alpha) ? bpp - 1 : bpp;
dest_row = (guchar *)safemalloc((x2 - x1) * bpp);
dest_row = g_new (guchar, (x2 - x1) * bpp);
gimp_progress_init( _("Painting..."));
@ -370,7 +370,7 @@ void gimpressionist_main(void)
}
}
free(dest_row);
g_free (dest_row);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->id, TRUE);

View File

@ -46,18 +46,15 @@ void create_orientationpage(GtkNotebook *notebook)
GtkWidget *box1, *box2, *box3, *box4, *thispage;
GtkWidget *labelbox, *menubox;
GtkWidget *tmpw;
char title[100];
int i;
sprintf(title, _("Orientation"));
labelbox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Orientation"));
gtk_box_pack_start(GTK_BOX(labelbox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(labelbox);
menubox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Orientation"));
gtk_box_pack_start(GTK_BOX(menubox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(menubox);

View File

@ -71,7 +71,7 @@ void selectpaper(GtkWidget *wg, GtkWidget *p)
gtk_label_get(GTK_LABEL(GTK_BIN(tmpw)->child), &l);
sprintf(fname, _("Paper/%s"), l);
sprintf(fname, "Paper/%s", l);
strcpy(pcvals.selectedpaper, fname);
updatepaperprev(fname);
}
@ -84,17 +84,14 @@ void create_paperpage(GtkNotebook *notebook)
GtkWidget *labelbox, *menubox;
GtkWidget *scrolled_win, *list;
GtkWidget *tmpw;
char title[100];
sprintf(title, _("Paper"));
labelbox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Paper"));
gtk_box_pack_start(GTK_BOX(labelbox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(labelbox);
menubox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Paper"));
gtk_box_pack_start(GTK_BOX(menubox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(menubox);

View File

@ -46,18 +46,15 @@ void create_placementpage(GtkNotebook *notebook)
GtkWidget *box0, *box1, *box2, *box3, *thispage;
GtkWidget *labelbox, *menubox;
GtkWidget *tmpw;
char title[100];
int i;
sprintf(title, _("Placement"));
labelbox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Placement"));
gtk_box_pack_start(GTK_BOX(labelbox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(labelbox);
menubox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Placement"));
gtk_box_pack_start(GTK_BOX(menubox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(menubox);

View File

@ -13,7 +13,6 @@
#include <math.h>
#include "ppmtool.h"
#include "gimpressionist.h"
#include <libgimp/stdplugins-intl.h>
int readline(FILE *f, char *buffer, int len)
{
@ -34,16 +33,6 @@ void fatal(char *s)
exit(1);
}
void *safemalloc(int len)
{
void *p = g_malloc(len);
if(!p) {
fprintf(stderr, _("(When allocating %u bytes.)\n"), len);
fatal( _("Out of memory!\n"));
}
return p;
}
void killppm(struct ppm *p)
{
free(p->col);
@ -64,7 +53,7 @@ void newppm(struct ppm *p, int xs, int ys)
p->width = xs;
p->height = ys;
p->col = safemalloc(xs * 3 * ys);
p->col = g_malloc(xs * 3 * ys);
for(x = 0; x < xs * 3 * ys; x += 3) {
p->col[x+0] = bgcol[0];
p->col[x+1] = bgcol[1];
@ -212,7 +201,7 @@ void loadgbr(char *fn, struct ppm *p)
if(p->col) killppm(p);
if(!f) {
fprintf(stderr, _("loadgbr: Unable to open file \"%s\"!\n"), fn);
fprintf(stderr, "loadgbr: Unable to open file \"%s\"!\n", fn);
newppm(p, 10,10);
return;
}
@ -224,7 +213,7 @@ void loadgbr(char *fn, struct ppm *p)
newppm(p, hdr.width, hdr.height);
ptr = safemalloc(hdr.width);
ptr = g_malloc(hdr.width);
fseek(f, hdr.header_size, SEEK_SET);
for(y = 0; y < p->height; y++) {
fread(ptr, p->width, 1, f);
@ -254,7 +243,7 @@ void loadppm(char *fn, struct ppm *p)
if(p->col) killppm(p);
if(!f) {
fprintf(stderr, _("loadppm: Unable to open file \"%s\"!\n"), fn);
fprintf(stderr, "loadppm: Unable to open file \"%s\"!\n", fn);
newppm(p, 10,10);
return;
/* fatal("Aborting!"); */
@ -264,7 +253,7 @@ void loadppm(char *fn, struct ppm *p)
if(strcmp(line, "P6")) {
if(strcmp(line, "P5")) {
fclose(f);
printf( _("loadppm: File \"%s\" not PPM/PGM? (line=\"%s\")%c\n"), fn, line, 7);
printf( "loadppm: File \"%s\" not PPM/PGM? (line=\"%s\")%c\n", fn, line, 7);
newppm(p, 10,10);
return;
/* fatal("Aborting!"); */
@ -276,17 +265,17 @@ void loadppm(char *fn, struct ppm *p)
p->height = atoi(strchr(line, ' ')+1);
readline(f, line, 200);
if(strcmp(line, "255")) {
printf( _("loadppm: File \"%s\" not valid PPM/PGM? (line=\"%s\")%c\n"), fn, line, 7);
printf ("loadppm: File \"%s\" not valid PPM/PGM? (line=\"%s\")%c\n", fn, line, 7);
newppm(p, 10,10);
return;
/* fatal("Aborting!"); */
}
p->col = safemalloc(p->height * p->width * 3);
p->col = g_malloc(p->height * p->width * 3);
if(!pgm) {
fread(p->col, p->height * 3 * p->width, 1, f);
} else {
guchar *tmpcol = safemalloc(p->width * p->height);
guchar *tmpcol = g_malloc(p->width * p->height);
fread(tmpcol, p->height * p->width, 1, f);
for(y = 0; y < p->width * p->height * 3; y++) {
p->col[y] = tmpcol[y/3];
@ -323,7 +312,7 @@ void copyppm(struct ppm *s, struct ppm *p)
killppm(p);
p->width = s->width;
p->height = s->height;
p->col = safemalloc(p->width * 3 * p->height);
p->col = g_malloc(p->width * 3 * p->height);
memcpy(p->col, s->col, p->width * 3 * p->height);
}

View File

@ -7,7 +7,6 @@ struct ppm {
};
void fatal(char *s);
void *safemalloc(int len);
void killppm(struct ppm *p);
void newppm(struct ppm *p, int xs, int ys);
void getrgb(struct ppm *s, float xo, float yo, unsigned char *d);

View File

@ -50,7 +50,7 @@ int loadoldpreset(char *fname)
f = fopen(fname, "rb");
if(!f) {
fprintf(stderr, _("Error opening file \"%s\" for reading!%c\n"), fname, 7);
fprintf(stderr, "Error opening file \"%s\" for reading!%c\n", fname, 7);
return -1;
}
len = fread(&pcvals, 1, sizeof(pcvals), f);
@ -260,7 +260,7 @@ int loadpreset(char *fn)
f = fopen(fn, "rt");
if(!f) {
fprintf(stderr, _("Error opening file \"%s\" for reading!\n"), fn);
fprintf(stderr, "Error opening file \"%s\" for reading!\n", fn);
return -1;
}
fgets(line,10,f);
@ -425,7 +425,7 @@ void savepreset(GtkWidget *wg, GtkWidget *p)
storevals();
if(!thispath) {
fprintf(stderr, _("Internal error: (savepreset) thispath == NULL"));
fprintf(stderr, "Internal error: (savepreset) thispath == NULL");
return;
}
@ -433,7 +433,7 @@ void savepreset(GtkWidget *wg, GtkWidget *p)
f = fopen(fname, "wt");
if(!f) {
fprintf(stderr, _("Error opening file \"%s\" for writing!%c\n"), fname, 7);
fprintf(stderr, "Error opening file \"%s\" for writing!%c\n", fname, 7);
return;
}
fprintf(f, "%s\n", PRESETMAGIC);
@ -567,21 +567,17 @@ void create_presetpage(GtkNotebook *notebook)
GtkWidget *labelbox, *menubox;
GtkWidget *scrolled_win, *list;
GtkWidget *tmpw;
char title[100];
sprintf(title, _("Presets"));
labelbox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Presets"));
gtk_box_pack_start(GTK_BOX(labelbox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(labelbox);
menubox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new ( _("Presets"));
gtk_box_pack_start(GTK_BOX(menubox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(menubox);
presetlist = list = gtk_list_new ();
thispage = gtk_vbox_new(FALSE, 0);

View File

@ -139,7 +139,7 @@ int bestbrush(struct ppm *p, struct ppm *a, int tx, int ty,
}
if(!brlist) {
fprintf(stderr, _("What!? No brushes?!\n"));
fprintf(stderr, "What!? No brushes?!\n");
return 0;
}
@ -279,7 +279,7 @@ void repaint(struct ppm *p, struct ppm *a)
/* Shouldn't be necessary, but... */
if(img_has_alpha)
if((p->width != a->width) || (p->height != a->height)) {
fprintf(stderr, _("Huh? Image size != alpha size?\n"));
fprintf(stderr, "Huh? Image size != alpha size?\n");
return;
}
@ -295,11 +295,11 @@ void repaint(struct ppm *p, struct ppm *a)
bgamma = runningvals.brushgamma;
brushes = safemalloc(numbrush * sizeof(struct ppm));
brushsum = safemalloc(numbrush * sizeof(double));
brushes = g_malloc (numbrush * sizeof(struct ppm));
brushsum = g_malloc (numbrush * sizeof(double));
if(dropshadow)
shadows = safemalloc(numbrush * sizeof(struct ppm));
shadows = g_malloc (numbrush * sizeof(struct ppm));
else
shadows = NULL;
@ -583,8 +583,8 @@ void repaint(struct ppm *p, struct ppm *a)
if(runningvals.placetype == 1) {
int j;
xpos = safemalloc(i * sizeof(int));
ypos = safemalloc(i * sizeof(int));
xpos = g_new (int, i);
ypos = g_new (int, i);
for(j = 0; j < i; j++) {
int factor = (int)(tmp.width * density / maxbrushwidth + 0.5);
if(factor < 1) factor = 1;
@ -664,7 +664,7 @@ void repaint(struct ppm *p, struct ppm *a)
case 6: /* Adaptive */
break; /* Handled below */
default:
fprintf(stderr, _("Internal error; Unknown orientationtype\n"));
fprintf(stderr, "Internal error; Unknown orientationtype\n");
on = 0;
break;
}
@ -684,7 +684,7 @@ void repaint(struct ppm *p, struct ppm *a)
case 6: /* Adaptive */
break; /* Handled below */
default:
fprintf(stderr, _("Internal error; Unknown sizetype\n"));
fprintf(stderr, "Internal error; Unknown sizetype\n");
sn = 0;
break;
}
@ -784,10 +784,16 @@ void repaint(struct ppm *p, struct ppm *a)
for(i = 0; i < numbrush; i++) {
killppm(&brushes[i]);
}
free(brushes);
g_free(brushes);
if(shadows)
free(shadows);
free(brushsum);
g_free(shadows);
g_free(brushsum);
if (xpos)
g_free (xpos);
if (ypos)
g_free (ypos);
if(runningvals.generalpaintedges) {
crop(&tmp, maxbrushwidth, maxbrushheight, tmp.width - maxbrushwidth, tmp.height - maxbrushheight);

View File

@ -45,18 +45,15 @@ void create_sizepage(GtkNotebook *notebook)
GtkWidget *box1, *box2, *box3, *box4, *thispage;
GtkWidget *labelbox, *menubox;
GtkWidget *tmpw;
char title[100];
int i;
sprintf(title, _("Size"));
labelbox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Size"));
gtk_box_pack_start(GTK_BOX(labelbox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(labelbox);
menubox = gtk_hbox_new (FALSE, 0);
tmpw = gtk_label_new(title);
tmpw = gtk_label_new (_("Size"));
gtk_box_pack_start(GTK_BOX(menubox), tmpw, FALSE, FALSE, 0);
gtk_widget_show_all(menubox);

View File

@ -1339,7 +1339,7 @@ ifs_compose(GDrawable *drawable)
{
gint i,j;
GDrawableType type = gimp_drawable_type(drawable->id);
gchar buffer[128];
gchar *buffer;
gint width = drawable->width;
gint height = drawable->height;
@ -1374,8 +1374,10 @@ ifs_compose(GDrawable *drawable)
gpointer pr;
sprintf(buffer, _("Rendering IFS (%d/%d)..."), band_no+1, num_bands);
buffer = g_strdup_printf (_("Rendering IFS (%d/%d)..."),
band_no+1, num_bands);
gimp_progress_init(buffer);
g_free (buffer);
/* render the band to a buffer */
if (band_y + band_height > height)
@ -1390,8 +1392,11 @@ ifs_compose(GDrawable *drawable)
/* transfer the image to the drawable */
sprintf(buffer, _("Copying IFS to image (%d/%d)..."), band_no+1,num_bands);
buffer = g_strdup_printf (_("Copying IFS to image (%d/%d)..."),
band_no+1,num_bands);
gimp_progress_init(buffer);
g_free (buffer);
progress = 0;
max_progress = band_height * width;

View File

@ -91,7 +91,7 @@ recalc_bounds(GtkWidget *widget, gpointer data)
GuidesDialog_t *param = (GuidesDialog_t*) data;
gint width, height, left, top, hspace, vspace, rows, cols;
gint bound_w, bound_h;
char bounds[128];
gchar *bounds;
width = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(param->width));
height = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(param->height));
@ -107,8 +107,8 @@ recalc_bounds(GtkWidget *widget, gpointer data)
bound_w = (width + hspace) * cols - hspace;
bound_h = (height + vspace) * rows - vspace;
sprintf(bounds, _("Resulting Guide Bounds: %d,%d to %d,%d (%d areas)"),
left, top, left + bound_w, top + bound_h, rows * cols);
bounds = g_strdup_printf (_("Resulting Guide Bounds: %d,%d to %d,%d (%d areas)"),
left, top, left + bound_w, top + bound_h, rows * cols);
if (left + bound_w > get_image_width() ||
top + bound_h > get_image_height()) {
default_dialog_set_ok_sensitivity(param->dialog, FALSE);
@ -116,6 +116,7 @@ recalc_bounds(GtkWidget *widget, gpointer data)
default_dialog_set_ok_sensitivity(param->dialog, TRUE);
}
gtk_label_set_text(GTK_LABEL(param->guide_bounds), bounds);
g_free (bounds);
}
static GuidesDialog_t*
@ -216,12 +217,13 @@ make_guides_dialog()
static void
init_guides_dialog(GuidesDialog_t *dialog, ObjectList_t *list)
{
char dimension[128];
gchar *dimension;
dialog->list = list;
sprintf(dimension, _("Image dimensions: %d x %d"), get_image_width(),
get_image_height());
dimension = g_strdup_printf (_("Image dimensions: %d x %d"), get_image_width(),
get_image_height());
gtk_label_set_text(GTK_LABEL(dialog->image_dimensions), dimension);
g_free (dimension);
gtk_label_set_text(GTK_LABEL(dialog->guide_bounds),
_("Resulting Guide Bounds: 0,0 to 0,0 (0 areas)"));
gtk_widget_grab_focus(dialog->width);

View File

@ -435,7 +435,7 @@ void
edit_area_info_dialog_show(AreaInfoDialog_t *dialog, Object_t *obj,
gboolean add)
{
char title[64];
gchar *title;
object_unlock(dialog->obj);
object_lock(obj);
@ -455,9 +455,10 @@ edit_area_info_dialog_show(AreaInfoDialog_t *dialog, Object_t *obj,
dialog->geometry_cb_id =
object_list_add_geometry_cb(obj->list, geometry_changed, dialog);
sprintf(title, _("Area #%d Settings"),
object_get_position_in_list(obj) + 1);
title = g_strdup_printf (_("Area #%d Settings"),
object_get_position_in_list(obj) + 1);
default_dialog_set_title(dialog->dialog, title);
g_free (title);
default_dialog_show(dialog->dialog);
}

View File

@ -234,14 +234,15 @@ make_file_menu(GtkWidget *menu_bar)
static void
command_list_changed(Command_t *command, gpointer data)
{
char scratch[64];
gchar *scratch;
/* Set undo entry */
if (_menu.undo)
gtk_widget_destroy(_menu.undo);
sprintf(scratch, _("Undo %s"), (command) ? command->name : "");
scratch = g_strdup_printf (_("Undo %s"), (command) ? command->name : "");
_menu.undo = insert_item_with_label(_menu.edit_menu, 1, scratch,
menu_command, &_menu.cmd_undo);
g_free (scratch);
add_accelerator(_menu.undo, 'Z', GDK_CONTROL_MASK);
gtk_widget_set_sensitive(_menu.undo, (command != NULL));
@ -249,9 +250,10 @@ command_list_changed(Command_t *command, gpointer data)
command = command_list_get_redo_command();
if (_menu.redo)
gtk_widget_destroy(_menu.redo);
sprintf(scratch, _("Redo %s"), (command) ? command->name : "");
scratch = g_strdup_printf (_("Redo %s"), (command) ? command->name : "");
_menu.redo = insert_item_with_label(_menu.edit_menu, 2, scratch,
menu_command, &_menu.cmd_redo);
g_free (scratch);
add_accelerator(_menu.redo, 'R', GDK_CONTROL_MASK);
gtk_widget_set_sensitive(_menu.redo, (command != NULL));
}

View File

@ -757,7 +757,7 @@ do_print_dialog(void)
N_("Portrait"),
N_("Landscape")
};
char plug_in_name[80];
gchar *plug_in_name;
/*
@ -782,9 +782,11 @@ do_print_dialog(void)
*/
print_dialog = dialog = gtk_dialog_new();
sprintf(plug_in_name, _("Print v%s"), PLUG_IN_VERSION);
plug_in_name = g_strdup_printf (_("Print v%s"), PLUG_IN_VERSION);
gtk_window_set_title(GTK_WINDOW(dialog), plug_in_name);
g_free (plug_in_name);
gtk_window_set_wmclass(GTK_WINDOW(dialog), "print", "Gimp");
gtk_window_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
gtk_container_border_width(GTK_CONTAINER(dialog), 0);

View File

@ -119,7 +119,6 @@ plug-ins/gimpressionist/orientation.c
plug-ins/gimpressionist/orientmap.c
plug-ins/gimpressionist/paper.c
plug-ins/gimpressionist/placement.c
plug-ins/gimpressionist/ppmtool.c
plug-ins/gimpressionist/presets.c
plug-ins/gimpressionist/preview.c
plug-ins/gimpressionist/repaint.c