Commit 1bfe515f authored by Adrian Likins's avatar Adrian Likins

gimp-joke-980321

 * app/iscissors.c, app/tips_dialog.c, app/gradient.c,
        libgimp/gimp.c, plug-ins/AlienMap/AlienMap.c,
        plug-ins/bmp/bmp.c, plug-ins/fits/fitsrw.h,
        plug-ins/fits/fitsrw.c, plug-ins/flarefx/flarefx.c,
        plug-ins/gfig/gfig.c, plug-ins/gfli/gfli.c,
        plug-ins/gicon/gicon.c, plug-ins/gqbist/gqbist.c,
        plug-ins/gtm/gtm.c, plug-ins/hot/hot.c,
        plug-ins/ifscompose/ifscompose.c,
        plug-ins/ifscompose/ifscompose_utils.c
        plug-ins/max_rgb/max_rgb.c, plug-ins/nlfilt/nlfilt.c,
        plug-ins/pat/pat.c, plug-ins/pcx/pcx.c, plug-ins/rotate/rotate.c,
        plug-ins/script-fu/script-fu-server.c, plug-ins/snoise/snoise.c,
        plug-ins/threshold_alpha/threshold_alpha.c,
        plug-ins/zealouscrop/zealouscrop.c :gimp-joke-980321

        plug-ins/CML_explorer, plug-ins/autocrop,
        plug-ins/align_layers, plug-ins/blinds,
        plug-ins/bmp, plug-ins/megawidget: gimp-joke-980322

        Applied gimp-joke-980322-0.patch and gimp-joke-980321-0.patch
        from Yasuhiro SHIRASAKI <joke@awa.tohoku.ac.jp>. Mostly
        portability for DEC osf1's cc. Lots of MAIN();'s, trailing
        commas in enums, and guchar/gchar madness.

	Gimp now sends mail, cleans vinyl records,
	removes stubborn stains, julien fries, and more!

-adrian
parent 4ef2e384
Sun Mar 22 14:23:03 EST 1998 Adrian Likins <adrian@gimp.org>
* app/iscissors.c, app/tips_dialog.c, app/gradient.c,
libgimp/gimp.c, plug-ins/AlienMap/AlienMap.c,
plug-ins/bmp/bmp.c, plug-ins/fits/fitsrw.h,
plug-ins/fits/fitsrw.c, plug-ins/flarefx/flarefx.c,
plug-ins/gfig/gfig.c, plug-ins/gfli/gfli.c,
plug-ins/gicon/gicon.c, plug-ins/gqbist/gqbist.c,
plug-ins/gtm/gtm.c, plug-ins/hot/hot.c,
plug-ins/ifscompose/ifscompose.c,
plug-ins/ifscompose/ifscompose_utils.c
plug-ins/max_rgb/max_rgb.c, plug-ins/nlfilt/nlfilt.c,
plug-ins/pat/pat.c, plug-ins/pcx/pcx.c, plug-ins/rotate/rotate.c,
plug-ins/script-fu/script-fu-server.c, plug-ins/snoise/snoise.c,
plug-ins/threshold_alpha/threshold_alpha.c,
plug-ins/zealouscrop/zealouscrop.c :gimp-joke-980321
plug-ins/CML_explorer, plug-ins/autocrop,
plug-ins/align_layers, plug-ins/blinds,
plug-ins/bmp, plug-ins/megawidget: gimp-joke-980322
Applied gimp-joke-980322-0.patch and gimp-joke-980321-0.patch
from Yasuhiro SHIRASAKI <joke@awa.tohoku.ac.jp>. Mostly
portability for DEC osf1's cc. Lots of MAIN();'s, trailing
commas in enums, and guchar/gchar madness.
Sun Mar 22 01:59:31 PST 1998 Manish Singh <yosh@gimp.org>
* autoconfed for random/lrand48/rand madness
......@@ -86,7 +114,7 @@ Thu Mar 19 01:04:56 PST 1998 Manish Singh <yosh@gimp.org>
Wed Mar 18 20:57:55 EST 1998 Adrian Likins <adrian@gimp.org>
*AlienMap/AlienMap.c CEL/CEL.c CML_explorer/CML_explorer.c
* AlienMap/AlienMap.c CEL/CEL.c CML_explorer/CML_explorer.c
align_layers/align_layers.c animationplay/animationplay.c
bmp/bmpwrite.c dbbrowser/dbbrowser.c emboss/emboss.c
exchange/exchange.c faxg3/faxg3.c faxg3/g3.c gbr/gbr.c
......
......@@ -41,7 +41,7 @@ tips_dialog_create ()
if (tips_count == 0)
{
temp = g_malloc (512);
sprintf (temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
sprintf ((char *)temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
read_tips_file ((char *)temp);
g_free (temp);
}
......
......@@ -5920,7 +5920,7 @@ gradients_get_active_invoker(Argument *args)
return_args[1].value.pdb_pointer = g_strdup(curr_gradient->name);
return return_args;
}; /* gradients_get_active_invoker */
} /* gradients_get_active_invoker */
/***** gradients_set_active *****/
......
......@@ -5920,7 +5920,7 @@ gradients_get_active_invoker(Argument *args)
return_args[1].value.pdb_pointer = g_strdup(curr_gradient->name);
return return_args;
}; /* gradients_get_active_invoker */
} /* gradients_get_active_invoker */
/***** gradients_set_active *****/
......
......@@ -5920,7 +5920,7 @@ gradients_get_active_invoker(Argument *args)
return_args[1].value.pdb_pointer = g_strdup(curr_gradient->name);
return return_args;
}; /* gradients_get_active_invoker */
} /* gradients_get_active_invoker */
/***** gradients_set_active *****/
......
......@@ -854,11 +854,19 @@ palette_refresh_callback (GtkWidget *w,
palette = client_data;
if(palette)
{
palette_free_palettes ();
palette_init_palettes();
palette_create_palette_menu (palette, default_palette_entries);
palette_calc_scrollbar (palette);
palette_draw_entries (palette);
palette_draw_current_entry (palette);
}
else
{
palette_free_palettes ();
palette_init_palettes();
}
palette_create_palette_menu (palette, default_palette_entries);
}
......@@ -1466,10 +1474,9 @@ palette_refresh_invoker (Argument *args)
*/
int success = TRUE ;
if(palette)
palette_free_palettes ();
palette_free_palettes();
palette_init_palettes();
return procedural_db_return_args (&palette_refresh_proc, success);
}
......
......@@ -41,7 +41,7 @@ tips_dialog_create ()
if (tips_count == 0)
{
temp = g_malloc (512);
sprintf (temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
sprintf ((char *)temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
read_tips_file ((char *)temp);
g_free (temp);
}
......
......@@ -284,7 +284,7 @@ selection_to_bezier(GtkWidget *w, gpointer none)
tools_select(BEZIER_SELECT);
}
return;
};
}
static IScissorsOptions *
iscissors_selection_options (void)
......
......@@ -854,11 +854,19 @@ palette_refresh_callback (GtkWidget *w,
palette = client_data;
if(palette)
{
palette_free_palettes ();
palette_init_palettes();
palette_create_palette_menu (palette, default_palette_entries);
palette_calc_scrollbar (palette);
palette_draw_entries (palette);
palette_draw_current_entry (palette);
}
else
{
palette_free_palettes ();
palette_init_palettes();
}
palette_create_palette_menu (palette, default_palette_entries);
}
......@@ -1466,10 +1474,9 @@ palette_refresh_invoker (Argument *args)
*/
int success = TRUE ;
if(palette)
palette_free_palettes ();
palette_free_palettes();
palette_init_palettes();
return procedural_db_return_args (&palette_refresh_proc, success);
}
......
......@@ -41,7 +41,7 @@ tips_dialog_create ()
if (tips_count == 0)
{
temp = g_malloc (512);
sprintf (temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
sprintf ((char *)temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
read_tips_file ((char *)temp);
g_free (temp);
}
......
......@@ -284,7 +284,7 @@ selection_to_bezier(GtkWidget *w, gpointer none)
tools_select(BEZIER_SELECT);
}
return;
};
}
static IScissorsOptions *
iscissors_selection_options (void)
......
......@@ -284,7 +284,7 @@ selection_to_bezier(GtkWidget *w, gpointer none)
tools_select(BEZIER_SELECT);
}
return;
};
}
static IScissorsOptions *
iscissors_selection_options (void)
......
......@@ -5920,7 +5920,7 @@ gradients_get_active_invoker(Argument *args)
return_args[1].value.pdb_pointer = g_strdup(curr_gradient->name);
return return_args;
}; /* gradients_get_active_invoker */
} /* gradients_get_active_invoker */
/***** gradients_set_active *****/
......
......@@ -854,11 +854,19 @@ palette_refresh_callback (GtkWidget *w,
palette = client_data;
if(palette)
{
palette_free_palettes ();
palette_init_palettes();
palette_create_palette_menu (palette, default_palette_entries);
palette_calc_scrollbar (palette);
palette_draw_entries (palette);
palette_draw_current_entry (palette);
}
else
{
palette_free_palettes ();
palette_init_palettes();
}
palette_create_palette_menu (palette, default_palette_entries);
}
......@@ -1466,10 +1474,9 @@ palette_refresh_invoker (Argument *args)
*/
int success = TRUE ;
if(palette)
palette_free_palettes ();
palette_free_palettes();
palette_init_palettes();
return procedural_db_return_args (&palette_refresh_proc, success);
}
......
......@@ -160,7 +160,7 @@ gint do_bluenone;
/***** Functions *****/
MAIN ();
MAIN ()
static void
query ()
......
......@@ -117,7 +117,7 @@ typedef struct
typedef struct
{
guchar *name;
gchar *name;
gpointer data;
} gtkW_menu_item;
/* gtkW global variables */
......@@ -143,16 +143,16 @@ static void gtkW_menu_update (GtkWidget *widget, gpointer data);
static void gtkW_toggle_change_value (gtkW_widget_table *wtable);
/* gtkW method */
GtkWidget *gtkW_check_button_new (GtkWidget *parent,
guchar *name,
gchar *name,
GtkSignalFunc update,
gint *value);
static GtkWidget *gtkW_dialog_new (guchar *name,
static GtkWidget *gtkW_dialog_new (gchar *name,
GtkSignalFunc ok_callback,
GtkSignalFunc close_callback);
static GtkWidget *gtkW_frame_new (GtkWidget *parent, guchar *name);
static GtkWidget *gtkW_frame_new (GtkWidget *parent, gchar *name);
static GtkWidget *gtkW_hbox_new (GtkWidget *parent);
static void gtkW_message_dialog (gint gtk_was_initialized, guchar *message);
static GtkWidget *gtkW_message_dialog_new (guchar * name);
static void gtkW_message_dialog (gint gtk_was_initialized, gchar *message);
static GtkWidget *gtkW_message_dialog_new (gchar * name);
static GtkWidget *gtkW_table_add_button (GtkWidget *table,
gchar *name,
gint x0,
......@@ -183,7 +183,7 @@ static GtkWidget *gtkW_table_add_iscale_entry (GtkWidget *table,
gdouble step,
gpointer table_entry);
static GtkWidget *gtkW_table_add_menu (GtkWidget *parent,
guchar *name,
gchar *name,
gint x,
gint y,
GtkSignalFunc imenu_update,
......@@ -192,7 +192,7 @@ static GtkWidget *gtkW_table_add_menu (GtkWidget *parent,
gint item_num,
gpointer table_entry);
static GtkWidget *gtkW_table_add_toggle (GtkWidget *table,
guchar *name,
gchar *name,
gint x,
gint y,
GtkSignalFunc update,
......@@ -200,7 +200,7 @@ static GtkWidget *gtkW_table_add_toggle (GtkWidget *table,
gpointer widget_entry);
static GtkWidget *gtkW_table_new (GtkWidget *parent, gint col, gint row);
static GtkWidget *gtkW_vbox_add_button (GtkWidget *vbox,
guchar *name,
gchar *name,
GtkSignalFunc update,
gpointer data);
static GtkWidget *gtkW_vbox_new (GtkWidget *parent);
......@@ -347,7 +347,7 @@ typedef struct
gint scale;
gint start_offset;
gint seed;
guchar last_file_name[256];
gchar last_file_name[256];
} ValueType;
static ValueType VALS =
......@@ -401,10 +401,10 @@ static void hsv_to_rgb (int *h, int *s, int *v);
static gdouble logistic_function (CML_PARAM *param, gdouble x, gdouble power);
static gint DIALOG ();
static GtkWidget *CML_dialog_sub_panel_new (GtkWidget *parent,
guchar *name,
gchar *name,
CML_PARAM *param,
gint channel_id);
static GtkWidget *CML_dialog_advanced_panel_new (GtkWidget *parent, guchar *name);
static GtkWidget *CML_dialog_advanced_panel_new (GtkWidget *parent, gchar *name);
void preview_update ();
static void function_graph_new (GtkWidget *widget, gpointer data);
static void CML_set_or_randomize_seed_callback (GtkWidget *widget, gpointer data);
......@@ -419,7 +419,7 @@ static gint force_overwrite (char *filename);
static void CML_overwrite_ok_callback (GtkWidget *widget, gpointer data);
static void CML_preview_update_callback (GtkWidget *widget, gpointer data);
static void CML_load_from_file_callback (GtkWidget *widget, gpointer client_data);
static gint CML_load_parameter_file (guchar *filename, gint interactive_mode);
static gint CML_load_parameter_file (gchar *filename, gint interactive_mode);
static void CML_execute_load_from_file (GtkWidget *widget, gpointer client_data);
static gint parse_line_to_gint (FILE *file, gint *flag);
static gdouble parse_line_to_gdouble (FILE *file, gint *flag);
......@@ -528,7 +528,7 @@ run (char *name,
break;
case RUN_NONINTERACTIVE:
{
guchar *filename = param[3].data.d_string;
gchar *filename = param[3].data.d_string;
if (! CML_load_parameter_file (filename, FALSE))
return;
......@@ -1620,7 +1620,7 @@ DIALOG ()
static GtkWidget *
CML_dialog_sub_panel_new (GtkWidget *parent,
guchar *name,
gchar *name,
CML_PARAM *param,
gint channel_id)
{
......@@ -1733,7 +1733,7 @@ CML_dialog_sub_panel_new (GtkWidget *parent,
}
static GtkWidget *
CML_dialog_advanced_panel_new (GtkWidget *parent, guchar *name)
CML_dialog_advanced_panel_new (GtkWidget *parent, gchar *name)
{
GtkWidget *frame;
GtkWidget *subframe;
......@@ -1742,7 +1742,7 @@ CML_dialog_advanced_panel_new (GtkWidget *parent, guchar *name)
gint index = 0;
gint widget_offset = 12;
gint channel_id;
guchar *ch_name[] = { "Hue", "Saturation", "Value" };
gchar *ch_name[] = { "Hue", "Saturation", "Value" };
CML_PARAM *param;
frame = gtkW_frame_new (parent, name);
......@@ -2091,7 +2091,7 @@ CML_execute_save_to_file (GtkWidget *widget, gpointer client_data)
}
if ((err != 0) && (file == NULL))
{
guchar buffer[CML_LINE_SIZE];
gchar buffer[CML_LINE_SIZE];
sprintf (buffer, "Error: could not open \"%s\"", filename);
gtkW_message_dialog (TRUE, buffer);
......@@ -2136,7 +2136,7 @@ CML_execute_save_to_file (GtkWidget *widget, gpointer client_data)
fclose(file);
#ifdef VERBOSE_DIALOGS
{
guchar buffer[CML_LINE_SIZE];
gchar buffer[CML_LINE_SIZE];
sprintf (buffer, "Parameters were saved to \"%s\"", filename);
gtkW_message_dialog (TRUE, buffer);
......@@ -2266,7 +2266,7 @@ CML_execute_load_from_file (GtkWidget *widget, gpointer client_data)
}
static gint
CML_load_parameter_file (guchar *filename, gint interactive_mode)
CML_load_parameter_file (gchar *filename, gint interactive_mode)
{
FILE *file;
int channel_id;
......@@ -2282,7 +2282,7 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
if (!file)
{
guchar buffer[CML_LINE_SIZE];
gchar buffer[CML_LINE_SIZE];
if (interactive_mode)
{
......@@ -2293,7 +2293,7 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
}
else
{
guchar line[CML_LINE_SIZE];
gchar line[CML_LINE_SIZE];
gdouble version = 0.99;
version = parse_line_to_gdouble (file, &flag); /* old format returns 1 */
......@@ -2410,8 +2410,8 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
static gint
parse_line_to_gint (FILE *file, gint *flag)
{
guchar line[CML_LINE_SIZE];
guchar *str;
gchar line[CML_LINE_SIZE];
gchar *str;
gint value;
if (! *flag)
......@@ -2438,8 +2438,8 @@ parse_line_to_gint (FILE *file, gint *flag)
static gdouble
parse_line_to_gdouble (FILE *file, gint *flag)
{
guchar line[CML_LINE_SIZE];
guchar *str;
gchar line[CML_LINE_SIZE];
gchar *str;
gdouble value;
if (! *flag)
......@@ -2636,7 +2636,7 @@ gtkW_toggle_change_value (gtkW_widget_table *wtable)
GtkWidget *
gtkW_check_button_new (GtkWidget *parent,
guchar *name,
gchar *name,
GtkSignalFunc update,
gint *value)
{
......@@ -2653,7 +2653,7 @@ gtkW_check_button_new (GtkWidget *parent,
}
static GtkWidget *
gtkW_dialog_new (guchar *name,
gtkW_dialog_new (gchar *name,
GtkSignalFunc ok_callback,
GtkSignalFunc close_callback)
{
......@@ -2689,7 +2689,7 @@ gtkW_dialog_new (guchar *name,
static GtkWidget *
gtkW_frame_new (GtkWidget *parent,
guchar *name)
gchar *name)
{
GtkWidget *frame;
......@@ -2718,7 +2718,7 @@ gtkW_hbox_new (GtkWidget *parent)
}
static void
gtkW_message_dialog (gint gtk_was_initialized, guchar *message)
gtkW_message_dialog (gint gtk_was_initialized, gchar *message)
{
GtkWidget *dlg;
GtkWidget *table;
......@@ -2751,7 +2751,7 @@ gtkW_message_dialog (gint gtk_was_initialized, guchar *message)
}
static GtkWidget *
gtkW_message_dialog_new (guchar * name)
gtkW_message_dialog_new (gchar * name)
{
GtkWidget *dlg, *button;
......@@ -2811,7 +2811,7 @@ gtkW_table_add_dscale_entry (GtkWidget *table,
{
GtkObject *adjustment;
GtkWidget *label, *hbox, *scale, *entry;
guchar *buffer;
gchar *buffer;
label = gtk_label_new (name);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
......@@ -2843,7 +2843,7 @@ gtkW_table_add_dscale_entry (GtkWidget *table,
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
gtk_widget_set_usize (entry, GTKW_ENTRY_WIDTH, 0);
buffer = (guchar *) g_malloc (GTKW_ENTRY_BUFFER_SIZE);
buffer = (gchar *) g_malloc (GTKW_ENTRY_BUFFER_SIZE);
sprintf (buffer, "%6f", *value);
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
gtk_signal_connect (GTK_OBJECT (entry), "changed",
......@@ -2880,7 +2880,7 @@ gtkW_table_add_iscale_entry (GtkWidget *table,
{
GtkObject *adjustment;
GtkWidget *label, *hbox, *scale, *entry;
guchar *buffer;
gchar *buffer;
label = gtk_label_new (name);
gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.5);
......@@ -2911,7 +2911,7 @@ gtkW_table_add_iscale_entry (GtkWidget *table,
gtk_object_set_user_data (adjustment, entry);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
gtk_widget_set_usize (entry, GTKW_ENTRY_WIDTH, 0);
buffer = (guchar *) g_malloc (GTKW_ENTRY_BUFFER_SIZE);
buffer = (gchar *) g_malloc (GTKW_ENTRY_BUFFER_SIZE);
sprintf (buffer, "%d", *value);
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
gtk_signal_connect (GTK_OBJECT (entry), "changed",
......@@ -2935,7 +2935,7 @@ gtkW_table_add_iscale_entry (GtkWidget *table,
static GtkWidget *
gtkW_table_add_menu (GtkWidget *table,
guchar *name,
gchar *name,
gint x,
gint y,
GtkSignalFunc menu_update,
......@@ -2995,7 +2995,7 @@ gtkW_table_add_menu (GtkWidget *table,
static GtkWidget *
gtkW_table_add_toggle (GtkWidget *table,
guchar *name,
gchar *name,
gint x,
gint y,
GtkSignalFunc update,
......@@ -3041,7 +3041,7 @@ gtkW_table_new (GtkWidget *parent, gint col, gint row)
static GtkWidget *
gtkW_vbox_add_button (GtkWidget *vbox,
guchar *name,
gchar *name,
GtkSignalFunc update,
gpointer data)
{
......
......@@ -53,7 +53,7 @@ static void gtkW_iscale_update (GtkAdjustment *adjustment, gpointer data);
static void gtkW_ientry_update (GtkWidget *widget, gpointer data);
static GtkWidget *gtkW_dialog_new (char *name, GtkSignalFunc ok_callback,
GtkSignalFunc close_callback);
static void gtkW_message_dialog (gint gtk_was_initialized, guchar *message);
static void gtkW_message_dialog (gint gtk_was_initialized, gchar *message);
static GtkWidget *gtkW_message_dialog_new (char * name);
static void
gtkW_table_add_toggle (GtkWidget *table,
......@@ -83,11 +83,11 @@ GtkWidget *gtkW_table_add_button (GtkWidget *table,
gpointer value);
typedef struct
{
guchar *name;
gchar *name;
gpointer data;
} gtkW_menu_item;
GtkWidget *gtkW_table_add_menu (GtkWidget *parent,
guchar *name,
gchar *name,
int x,
int y,
GtkSignalFunc imenu_update,
......@@ -482,7 +482,7 @@ DIALOG ()
GSList *group = NULL;
#endif
int index = 0;
guchar buffer[10];
gchar buffer[10];
gchar **argv;
gint argc;
......@@ -733,7 +733,7 @@ gtkW_dialog_new (char * name,
}
static void
gtkW_message_dialog (gint gtk_was_initialized, guchar *message)
gtkW_message_dialog (gint gtk_was_initialized, gchar *message)
{
GtkWidget *dlg;
GtkWidget *table;
......@@ -1008,7 +1008,7 @@ gtkW_table_add_button (GtkWidget *table,
GtkWidget *
gtkW_table_add_menu (GtkWidget *table,
guchar *name,
gchar *name,
int x,
int y,
GtkSignalFunc menu_update,
......@@ -1018,7 +1018,7 @@ gtkW_table_add_menu (GtkWidget *table,
{
GtkWidget *label;
GtkWidget *menu, *menuitem, *option_menu;
guchar buf[64];
gchar buf[64];
gint i;
label = gtk_label_new (name);
......
......@@ -17,9 +17,9 @@ static void run(char *name,
GParam * param,
int *nreturn_vals,
GParam ** return_vals);
static int colors_equal(gchar *col1, gchar *col2, int bytes);
static int colors_equal(guchar *col1, gchar *col2, int bytes);
static int guess_bgcolor(GPixelRgn *pr, int width, int height, int bytes,
gchar *color);
guchar *color);
static void doit(GDrawable *drawable, gint32);
......@@ -211,8 +211,8 @@ static void doit(GDrawable *drawable, gint32 image_id)
}