diff --git a/ChangeLog b/ChangeLog index 945fd9a29f..4a445133c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +Fri Apr 10 21:59:18 PDT 1998 Manish Singh + + * app/app_procs.c: fixed up idle handler for file open + (look like testgtk idle demo) + + * app/colomaps.c: fixup for visual test and use of gdk_color_alloc + for some fixed colors (from Owen Taylor) + + * app/errors.h + * app/errors.c + * app/main.c + * libgimp/gimp.c: redid the signal handlers so we only get a + debug prompt on SIGSEGV, SIGBUS, and SIGFPE. + + * applied gimp-jbuhler-980408-0 and gimp-joke-980409-0 (warning + fixups) + + * applied gimp-monnaux-980409-0 for configurable plugin path for + multiarch setups + Fri Apr 10 00:17:23 EDT 1998 Matthew Wilson * app/commands.c: Fixed (hopefully) the preferences code. Added diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c index e3060b2ade..73c2020f0a 100644 --- a/app/actions/plug-in-commands.c +++ b/app/actions/plug-in-commands.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/app_procs.c b/app/app_procs.c index 86bbdcb509..6de403aa85 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -110,7 +110,7 @@ static ProcRecord quit_proc = Thanks to Owen for this. */ -GtkFunction file_open_wrapper (char *name) { +gint file_open_wrapper (char *name) { file_open (name, name); return FALSE; } @@ -127,7 +127,7 @@ gimp_init (int gimp_argc, while (gimp_argc--) { if (*gimp_argv) - gtk_idle_add ((GtkFunction *) file_open_wrapper, *gimp_argv); + gtk_idle_add ((GtkFunction) file_open_wrapper, *gimp_argv); gimp_argv++; } diff --git a/app/colormaps.c b/app/colormaps.c index 12c06c1001..8251e7bac4 100644 --- a/app/colormaps.c +++ b/app/colormaps.c @@ -65,39 +65,40 @@ gulong *g_lookup_blue; gulong *color_pixel_vals; gulong *gray_pixel_vals; -static int reserved_entries = 10; /* extra colors aside from color cube */ +static int reserved_entries = 4; /* extra colors aside from color cube */ static gulong *reserved_pixels; +static void make_color (gulong *pixel_ptr, + int red, + int green, + int blue, + int readwrite); static void set_app_colors () { int i; - if (g_visual->depth == 8) + if ((g_visual->type == GDK_VISUAL_PSEUDO_COLOR) || + (g_visual->type == GDK_VISUAL_GRAYSCALE)) { - g_black_pixel = reserved_pixels[0]; - g_gray_pixel = reserved_pixels[1]; - g_white_pixel = reserved_pixels[2]; - g_color_pixel = reserved_pixels[3]; - g_normal_guide_pixel = reserved_pixels[4]; - g_active_guide_pixel = reserved_pixels[5]; - foreground_pixel = reserved_pixels[6]; - background_pixel = reserved_pixels[7]; - old_color_pixel = reserved_pixels[8]; - new_color_pixel = reserved_pixels[9]; + foreground_pixel = reserved_pixels[0]; + background_pixel = reserved_pixels[1]; + old_color_pixel = reserved_pixels[2]; + new_color_pixel = reserved_pixels[3]; } else { cycled_marching_ants = FALSE; } - store_color (&g_black_pixel, 0, 0, 0); - store_color (&g_gray_pixel, 127, 127, 127); - store_color (&g_white_pixel, 255, 255, 255); - store_color (&g_color_pixel, 255, 255, 0); - store_color (&g_normal_guide_pixel, 0, 127, 255); - store_color (&g_active_guide_pixel, 255, 0, 0); + make_color (&g_black_pixel, 0, 0, 0, FALSE); + make_color (&g_gray_pixel, 127, 127, 127, FALSE); + make_color (&g_white_pixel, 255, 255, 255, FALSE); + make_color (&g_color_pixel, 255, 255, 0, FALSE); + make_color (&g_normal_guide_pixel, 0, 127, 255, FALSE); + make_color (&g_active_guide_pixel, 255, 0, 0, FALSE); + store_color (&foreground_pixel, 0, 0, 0); store_color (&background_pixel, 255, 255, 255); store_color (&old_color_pixel, 0, 0, 0); @@ -145,7 +146,8 @@ get_color (int red, { gulong pixel; - if (g_visual->depth == 8) + if ((g_visual->type == GDK_VISUAL_PSEUDO_COLOR) || + (g_visual->type == GDK_VISUAL_GRAYSCALE)) pixel = color_pixel_vals [(red_ordered_dither[red].s[1] + green_ordered_dither[green].s[1] + blue_ordered_dither[blue].s[1])]; @@ -156,11 +158,12 @@ get_color (int red, } -void -store_color (gulong *pixel_ptr, - int red, - int green, - int blue) +static void +make_color (gulong *pixel_ptr, + int red, + int green, + int blue, + int readwrite) { GdkColor col; @@ -173,7 +176,8 @@ store_color (gulong *pixel_ptr, col.blue = blue * (65535 / 255); col.pixel = *pixel_ptr; - if (g_visual->depth == 8) + if (readwrite && ((g_visual->type == GDK_VISUAL_PSEUDO_COLOR) || + (g_visual->type == GDK_VISUAL_GRAYSCALE))) gdk_color_change (g_cmap, &col); else gdk_color_alloc (g_cmap, &col); @@ -181,6 +185,15 @@ store_color (gulong *pixel_ptr, *pixel_ptr = col.pixel; } +void +store_color (gulong *pixel_ptr, + int red, + int green, + int blue) +{ + make_color (pixel_ptr, red, green, blue, TRUE); +} + void get_standard_colormaps () @@ -205,7 +218,9 @@ get_standard_colormaps () info = gtk_preview_get_info (); g_visual = info->visual; - if (g_visual->depth == 8 && info->reserved_pixels == NULL) { + if (((g_visual->type == GDK_VISUAL_PSEUDO_COLOR) || + (g_visual->type == GDK_VISUAL_GRAYSCALE)) && + info->reserved_pixels == NULL) { g_print("GIMP cannot get enough colormaps to boot.\n"); g_print("Try exiting other color intensive applications.\n"); g_print("Also try enabling the (install-colormap) option in gimprc.\n"); diff --git a/app/errors.c b/app/errors.c index 973a06ae5f..f14620806c 100644 --- a/app/errors.c +++ b/app/errors.c @@ -68,3 +68,17 @@ fatal_error (char *fmt, ...) g_debug (prog_name); app_exit (1); } + +void +terminate (char *fmt, ...) +{ + va_list args; + + va_start (args, fmt); + printf ("%s terminated: ", prog_name); + vprintf (fmt, args); + printf ("\n"); + va_end (args); + + gdk_exit (1); +} diff --git a/app/errors.h b/app/errors.h index d5acb1889c..8c25751712 100644 --- a/app/errors.h +++ b/app/errors.h @@ -21,5 +21,6 @@ void message (char *, ...); void warning (char *, ...); void fatal_error (char *, ...); +void terminate (char *, ...); #endif /* __ERRORS_H__ */ diff --git a/app/gimage.c b/app/gimage.c index 02f90cc360..9d4b579a97 100644 --- a/app/gimage.c +++ b/app/gimage.c @@ -2632,12 +2632,14 @@ gimage_dirty (GImage *gimage) gimage->dirty ++; if (active_tool && !active_tool->preserve) { gdisp = active_tool->gdisp_ptr; - if (gdisp) + if (gdisp) { if (gdisp->gimage->ID == gimage->ID) tools_initialize (active_tool->type, gdisp); else tools_initialize (active_tool->type, NULL); + } } + return gimage->dirty; } diff --git a/app/gimprc.c b/app/gimprc.c index 9c174149f4..472f565a5d 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -84,6 +84,7 @@ char * palette_path = NULL; char * default_palette = NULL; char * gradient_path = NULL; char * default_gradient = NULL; +char * pluginrc_path = NULL; int tile_cache_size = 4194304; /* 4 MB */ int marching_speed = 150; /* 150 ms */ double gamma_val = 1.0; @@ -176,6 +177,7 @@ static ParseFunc funcs[] = { "plug-in-path", TT_PATH, &plug_in_path, NULL }, { "palette-path", TT_PATH, &palette_path, NULL }, { "gradient-path", TT_PATH, &gradient_path, NULL }, + { "pluginrc-path", TT_PATH, &pluginrc_path, NULL }, { "default-brush", TT_STRING, &default_brush, NULL }, { "default-pattern", TT_STRING, &default_pattern, NULL }, { "default-palette", TT_STRING, &default_palette, NULL }, diff --git a/app/gimprc.h b/app/gimprc.h index affdb5c976..8909e3f0ee 100644 --- a/app/gimprc.h +++ b/app/gimprc.h @@ -33,6 +33,7 @@ extern char * palette_path; extern char * default_palette; extern char * gradient_path; extern char * default_gradient; +extern char * pluginrc_path; extern int tile_cache_size; extern int marching_speed; extern double gamma_val; diff --git a/app/gui/palette-editor.c b/app/gui/palette-editor.c index b8934f049e..5179281765 100644 --- a/app/gui/palette-editor.c +++ b/app/gui/palette-editor.c @@ -92,7 +92,7 @@ static void palette_close_callback (GtkWidget *, gpointer); static gint palette_dialog_delete_callback (GtkWidget *, GdkEvent *, gpointer); static void palette_new_entries_callback (GtkWidget *, gpointer); static void palette_add_entries_callback (GtkWidget *, gpointer, gpointer); -static void palette_merge_entries_callback (GtkWidget *, gpointer); +/* static void palette_merge_entries_callback (GtkWidget *, gpointer); */ static void palette_delete_entries_callback (GtkWidget *, gpointer); static void palette_select_callback (int, int, int, ColorSelectState, void *); diff --git a/app/gui/plug-in-commands.c b/app/gui/plug-in-commands.c index e3060b2ade..73c2020f0a 100644 --- a/app/gui/plug-in-commands.c +++ b/app/gui/plug-in-commands.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/gui/plug-in-menus.c b/app/gui/plug-in-menus.c index e3060b2ade..73c2020f0a 100644 --- a/app/gui/plug-in-menus.c +++ b/app/gui/plug-in-menus.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/main.c b/app/main.c index 2db7eb5704..68808d9fca 100644 --- a/app/main.c +++ b/app/main.c @@ -232,8 +232,6 @@ static int caught_fatal_sig = 0; static RETSIGTYPE on_signal (int sig_num) { - char *sig; - if (caught_fatal_sig) /* raise (sig_num);*/ kill (getpid (), sig_num); @@ -242,38 +240,36 @@ on_signal (int sig_num) switch (sig_num) { case SIGHUP: - sig = "sighup"; + terminate ("sighup caught"); break; case SIGINT: - sig = "sigint"; + terminate ("sigint caught"); break; case SIGQUIT: - sig = "sigquit"; + terminate ("sigquit caught"); break; case SIGABRT: - sig = "sigabrt"; + terminate ("sigabrt caught"); break; case SIGBUS: - sig = "sigbus"; + fatal_error ("sigbus caught"); break; case SIGSEGV: - sig = "sigsegv"; + fatal_error ("sigsegv caught"); break; case SIGPIPE: - sig = "sigpipe"; + terminate ("sigpipe caught"); break; case SIGTERM: - sig = "sigterm"; + terminate ("sigterm caught"); break; case SIGFPE: - sig = "sigfpe"; + fatal_error ("sigfpe caught"); break; default: - sig = "unknown signal"; + fatal_error ("unknown signal"); break; } - - fatal_error ("%s caught", sig); } static RETSIGTYPE diff --git a/app/menus/plug-in-menus.c b/app/menus/plug-in-menus.c index e3060b2ade..73c2020f0a 100644 --- a/app/menus/plug-in-menus.c +++ b/app/menus/plug-in-menus.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/palette.c b/app/palette.c index b8934f049e..5179281765 100644 --- a/app/palette.c +++ b/app/palette.c @@ -92,7 +92,7 @@ static void palette_close_callback (GtkWidget *, gpointer); static gint palette_dialog_delete_callback (GtkWidget *, GdkEvent *, gpointer); static void palette_new_entries_callback (GtkWidget *, gpointer); static void palette_add_entries_callback (GtkWidget *, gpointer, gpointer); -static void palette_merge_entries_callback (GtkWidget *, gpointer); +/* static void palette_merge_entries_callback (GtkWidget *, gpointer); */ static void palette_delete_entries_callback (GtkWidget *, gpointer); static void palette_select_callback (int, int, int, ColorSelectState, void *); diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/gimpplugin-message.c +++ b/app/plug-in/gimpplugin-message.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/gimpplugin-progress.c b/app/plug-in/gimpplugin-progress.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/gimpplugin-progress.c +++ b/app/plug-in/gimpplugin-progress.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/gimpplugin.c +++ b/app/plug-in/gimpplugin.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/gimppluginmanager-run.c b/app/plug-in/gimppluginmanager-run.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/gimppluginmanager-run.c +++ b/app/plug-in/gimppluginmanager-run.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/gimppluginmanager.c +++ b/app/plug-in/gimppluginmanager.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/gimppluginshm.c b/app/plug-in/gimppluginshm.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/gimppluginshm.c +++ b/app/plug-in/gimppluginshm.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/plug-in-def.c b/app/plug-in/plug-in-def.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/plug-in-def.c +++ b/app/plug-in/plug-in-def.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/plug-in-message.c b/app/plug-in/plug-in-message.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/plug-in-message.c +++ b/app/plug-in/plug-in-message.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/plug-in-params.c +++ b/app/plug-in/plug-in-params.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/plug-in-progress.c b/app/plug-in/plug-in-progress.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/plug-in-progress.c +++ b/app/plug-in/plug-in-progress.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/plug-in-run.c b/app/plug-in/plug-in-run.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/plug-in-run.c +++ b/app/plug-in/plug-in-run.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/plug-in-shm.c b/app/plug-in/plug-in-shm.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/plug-in-shm.c +++ b/app/plug-in/plug-in-shm.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/plug-in.c b/app/plug-in/plug-in.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/plug-in.c +++ b/app/plug-in/plug-in.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug-in/plug-ins.c b/app/plug-in/plug-ins.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug-in/plug-ins.c +++ b/app/plug-in/plug-ins.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/plug_in.c b/app/plug_in.c index e3060b2ade..73c2020f0a 100644 --- a/app/plug_in.c +++ b/app/plug_in.c @@ -234,7 +234,16 @@ plug_in_init () datafiles_read_directories (plug_in_path, plug_in_init_file, MODE_EXECUTABLE); /* read the pluginrc file for cached data */ - sprintf (filename, "%s/pluginrc", gimp_directory ()); + if (pluginrc_path) + { + if (*pluginrc_path == '/') + strcpy(filename, pluginrc_path); + else + sprintf(filename, "%s/%s", gimp_directory(), pluginrc_path); + } + else + sprintf (filename, "%s/pluginrc", gimp_directory ()); + app_init_update_status("Resource configuration", filename, -1); parse_gimprc_file (filename); diff --git a/app/widgets/gimppaletteeditor.c b/app/widgets/gimppaletteeditor.c index b8934f049e..5179281765 100644 --- a/app/widgets/gimppaletteeditor.c +++ b/app/widgets/gimppaletteeditor.c @@ -92,7 +92,7 @@ static void palette_close_callback (GtkWidget *, gpointer); static gint palette_dialog_delete_callback (GtkWidget *, GdkEvent *, gpointer); static void palette_new_entries_callback (GtkWidget *, gpointer); static void palette_add_entries_callback (GtkWidget *, gpointer, gpointer); -static void palette_merge_entries_callback (GtkWidget *, gpointer); +/* static void palette_merge_entries_callback (GtkWidget *, gpointer); */ static void palette_delete_entries_callback (GtkWidget *, gpointer); static void palette_select_callback (int, int, int, ColorSelectState, void *); diff --git a/libgimp/gimp.c b/libgimp/gimp.c index 1ef4a838ff..d1ce964feb 100644 --- a/libgimp/gimp.c +++ b/libgimp/gimp.c @@ -91,6 +91,7 @@ gimp_main (int argc, signal (SIGSEGV, gimp_signal); signal (SIGPIPE, gimp_signal); signal (SIGTERM, gimp_signal); + signal (SIGFPE, gimp_signal); _readfd = atoi (argv[2]); _writefd = atoi (argv[3]); @@ -858,7 +859,17 @@ gimp_signal (int signum) caught_fatal_sig = 1; fprintf (stderr, "\n%s: %s caught\n", progname, g_strsignal (signum)); - g_debug (progname); + + switch (signum) + { + case SIGBUS: + case SIGSEGV: + case SIGFPE: + g_debug (progname); + break; + default: + break; + } gimp_quit (); } @@ -1035,7 +1046,7 @@ gimp_temp_proc_run (GPProcRun *proc_run) int nreturn_vals; GRunProc run_proc; - run_proc = g_hash_table_lookup (temp_proc_ht, (gpointer) proc_run->name); + run_proc = (GRunProc)g_hash_table_lookup (temp_proc_ht, (gpointer) proc_run->name); if (run_proc) { diff --git a/plug-ins/CML_explorer/CML_explorer.c b/plug-ins/CML_explorer/CML_explorer.c index 78e295ee2d..22d6d77c8f 100644 --- a/plug-ins/CML_explorer/CML_explorer.c +++ b/plug-ins/CML_explorer/CML_explorer.c @@ -2161,7 +2161,7 @@ force_overwrite (char *filename) GtkWidget *dlg; GtkWidget *label; GtkWidget *table; - guchar buffer[CML_LINE_SIZE]; + gchar buffer[CML_LINE_SIZE]; gint tmp; dlg = gtkW_dialog_new ("CML file operation warning", diff --git a/plug-ins/autocrop/autocrop.c b/plug-ins/autocrop/autocrop.c index 444d9aedce..48a4871d21 100644 --- a/plug-ins/autocrop/autocrop.c +++ b/plug-ins/autocrop/autocrop.c @@ -17,7 +17,7 @@ static void run(char *name, GParam * param, int *nreturn_vals, GParam ** return_vals); -static int colors_equal(guchar *col1, gchar *col2, int bytes); +static int colors_equal(guchar *col1, guchar *col2, int bytes); static int guess_bgcolor(GPixelRgn *pr, int width, int height, int bytes, guchar *color); @@ -256,7 +256,7 @@ static int guess_bgcolor(GPixelRgn *pr, int width, int height, int bytes, } } -static int colors_equal(guchar *col1, gchar *col2, int bytes) { +static int colors_equal(guchar *col1, guchar *col2, int bytes) { int equal = 1; int b; diff --git a/plug-ins/bmp/bmpwrite.c b/plug-ins/bmp/bmpwrite.c index 9321d73d3e..3974b3d3c7 100644 --- a/plug-ins/bmp/bmpwrite.c +++ b/plug-ins/bmp/bmpwrite.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include "bmp.h" diff --git a/plug-ins/common/CML_explorer.c b/plug-ins/common/CML_explorer.c index 78e295ee2d..22d6d77c8f 100644 --- a/plug-ins/common/CML_explorer.c +++ b/plug-ins/common/CML_explorer.c @@ -2161,7 +2161,7 @@ force_overwrite (char *filename) GtkWidget *dlg; GtkWidget *label; GtkWidget *table; - guchar buffer[CML_LINE_SIZE]; + gchar buffer[CML_LINE_SIZE]; gint tmp; dlg = gtkW_dialog_new ("CML file operation warning", diff --git a/plug-ins/common/autocrop.c b/plug-ins/common/autocrop.c index 444d9aedce..48a4871d21 100644 --- a/plug-ins/common/autocrop.c +++ b/plug-ins/common/autocrop.c @@ -17,7 +17,7 @@ static void run(char *name, GParam * param, int *nreturn_vals, GParam ** return_vals); -static int colors_equal(guchar *col1, gchar *col2, int bytes); +static int colors_equal(guchar *col1, guchar *col2, int bytes); static int guess_bgcolor(GPixelRgn *pr, int width, int height, int bytes, guchar *color); @@ -256,7 +256,7 @@ static int guess_bgcolor(GPixelRgn *pr, int width, int height, int bytes, } } -static int colors_equal(guchar *col1, gchar *col2, int bytes) { +static int colors_equal(guchar *col1, guchar *col2, int bytes) { int equal = 1; int b; diff --git a/plug-ins/common/palette.c b/plug-ins/common/palette.c index 8cdcb9ae0e..ea170d490e 100644 --- a/plug-ins/common/palette.c +++ b/plug-ins/common/palette.c @@ -24,7 +24,7 @@ static void run (char *name, int nparams, GParam *param, int *nreturn_vals, GPlugInInfo PLUG_IN_INFO = { NULL, NULL, query, run, }; static int running= FALSE; -static guchar *filename; /* Filename of palette file */ +static gchar *filename; /* Filename of palette file */ MAIN () @@ -63,10 +63,10 @@ static int palette_dialog(); /* AFAIK This should be part of libgimp (sigh) */ -static guchar* gimp_gimprc_query(guchar *key) { +static gchar* gimp_gimprc_query(gchar *key) { GParam *return_vals; int nreturn_vals; - guchar *value; + gchar *value; return_vals = gimp_run_procedure ("gimp_gimprc_query", &nreturn_vals, PARAM_STRING, key, PARAM_END); @@ -179,7 +179,7 @@ static int palette_dialog() { gchar **argv; gint argc; GtkWidget *dialog; - guchar *directory, *data; + gchar *directory, *data; argc = 1; argv = g_new (gchar *, 1); diff --git a/plug-ins/common/pnm.c b/plug-ins/common/pnm.c index b30c3759d0..b92e984139 100644 --- a/plug-ins/common/pnm.c +++ b/plug-ins/common/pnm.c @@ -66,7 +66,7 @@ typedef struct _PNMInfo { /* Contains the information needed to write out PNM rows */ typedef struct _PNMRowInfo { int fd; /* File descriptor */ - unsigned char *rowbuf; /* Buffer for writing out rows */ + char *rowbuf; /* Buffer for writing out rows */ int xres; /* X resolution */ int np; /* Number of planes */ unsigned char *red; /* Colormap red */ @@ -632,7 +632,7 @@ pnmsaverow_raw_indexed (PNMRowInfo *ri, unsigned char *data) { int i; - unsigned char *rbcur = ri->rowbuf; + char *rbcur = ri->rowbuf; for (i = 0; i < ri->xres; i++) { @@ -649,7 +649,7 @@ pnmsaverow_ascii (PNMRowInfo *ri, unsigned char *data) { int i; - unsigned char *rbcur = ri->rowbuf; + char *rbcur = ri->rowbuf; for (i = 0; i < ri->xres*ri->np; i++) { @@ -665,7 +665,7 @@ pnmsaverow_ascii_indexed (PNMRowInfo *ri, unsigned char *data) { int i; - unsigned char *rbcur = ri->rowbuf; + char *rbcur = ri->rowbuf; for (i = 0; i < ri->xres; i++) { @@ -693,7 +693,7 @@ save_image (char *filename, unsigned char grn[256]; unsigned char blu[256]; unsigned char *data, *d; - unsigned char *rowbuf; + char *rowbuf; char buf[BUFLEN]; char *temp; int np; diff --git a/plug-ins/common/zealouscrop.c b/plug-ins/common/zealouscrop.c index 4d0b9fa800..8ab9318aba 100644 --- a/plug-ins/common/zealouscrop.c +++ b/plug-ins/common/zealouscrop.c @@ -23,7 +23,7 @@ static void run(char *name, GParam * param, int *nreturn_vals, GParam ** return_vals); -static inline int colours_equal(guchar *col1, gchar *col2, int bytes); +static inline int colours_equal(guchar *col1, guchar *col2, int bytes); static void do_zcrop(GDrawable *drawable, gint32); @@ -265,7 +265,7 @@ static void do_zcrop(GDrawable *drawable, gint32 image_id) } -static inline int colours_equal(guchar *col1, gchar *col2, int bytes) +static inline int colours_equal(guchar *col1, guchar *col2, int bytes) { int b; diff --git a/plug-ins/gfig/gfig.c b/plug-ins/gfig/gfig.c index de286cca25..7741e757cd 100644 --- a/plug-ins/gfig/gfig.c +++ b/plug-ins/gfig/gfig.c @@ -891,7 +891,7 @@ plug_in_parse_gfig_path() Tkane from gflare plugin */ void -gfig_name_encode (gchar *dest, guchar *src) +gfig_name_encode (gchar *dest, gchar *src) { int cnt = MAX_LOAD_LINE - 1; @@ -912,7 +912,7 @@ gfig_name_encode (gchar *dest, guchar *src) Translate "\\040" to SPACE, etc. */ void -gfig_name_decode (gchar *dest, guchar *src) +gfig_name_decode (gchar *dest, gchar *src) { int cnt = MAX_LOAD_LINE - 1; int tmp; diff --git a/plug-ins/gfli/gfli.c b/plug-ins/gfli/gfli.c index 8aa5a7a128..749e165a48 100644 --- a/plug-ins/gfli/gfli.c +++ b/plug-ins/gfli/gfli.c @@ -202,7 +202,7 @@ void fli_read_header(FILE *f, s_fli_header *fli_header) } } -void fli_read_frame(FILE *f, s_fli_header *fli_header, guchar *framebuf, gchar *cmap) +void fli_read_frame(FILE *f, s_fli_header *fli_header, guchar *framebuf, guchar *cmap) { s_fli_frame fli_frame; unsigned long framepos; diff --git a/plug-ins/pagecurl/pagecurl.c b/plug-ins/pagecurl/pagecurl.c index 7f9d5cb370..f053103f1c 100644 --- a/plug-ins/pagecurl/pagecurl.c +++ b/plug-ins/pagecurl/pagecurl.c @@ -177,7 +177,7 @@ guchar back_color[3]; /***** Functions *****/ /****/ -MAIN (); +MAIN () /****/ /*************************/ @@ -616,7 +616,7 @@ static int do_dialog (void) { gtk_signal_connect (GTK_OBJECT (button), "toggled", (GtkSignalFunc) dialog_toggle_update, - (gpointer) i + 5); + (gpointer) (i + 5)); gtk_box_pack_start (GTK_BOX (orhbox2), button, TRUE, FALSE, 0); gtk_widget_show (button); @@ -745,7 +745,7 @@ static void init_calculation () { static void do_curl_effect (void) { gint x, y, color_image; - guint x1, y1, k; + gint x1, y1, k; guint alpha_pos, progress, max_progress; gdouble intensity, alpha; vector_t v, dl, dr; diff --git a/plug-ins/palette/palette.c b/plug-ins/palette/palette.c index 8cdcb9ae0e..ea170d490e 100644 --- a/plug-ins/palette/palette.c +++ b/plug-ins/palette/palette.c @@ -24,7 +24,7 @@ static void run (char *name, int nparams, GParam *param, int *nreturn_vals, GPlugInInfo PLUG_IN_INFO = { NULL, NULL, query, run, }; static int running= FALSE; -static guchar *filename; /* Filename of palette file */ +static gchar *filename; /* Filename of palette file */ MAIN () @@ -63,10 +63,10 @@ static int palette_dialog(); /* AFAIK This should be part of libgimp (sigh) */ -static guchar* gimp_gimprc_query(guchar *key) { +static gchar* gimp_gimprc_query(gchar *key) { GParam *return_vals; int nreturn_vals; - guchar *value; + gchar *value; return_vals = gimp_run_procedure ("gimp_gimprc_query", &nreturn_vals, PARAM_STRING, key, PARAM_END); @@ -179,7 +179,7 @@ static int palette_dialog() { gchar **argv; gint argc; GtkWidget *dialog; - guchar *directory, *data; + gchar *directory, *data; argc = 1; argv = g_new (gchar *, 1); diff --git a/plug-ins/pnm/pnm.c b/plug-ins/pnm/pnm.c index b30c3759d0..b92e984139 100644 --- a/plug-ins/pnm/pnm.c +++ b/plug-ins/pnm/pnm.c @@ -66,7 +66,7 @@ typedef struct _PNMInfo { /* Contains the information needed to write out PNM rows */ typedef struct _PNMRowInfo { int fd; /* File descriptor */ - unsigned char *rowbuf; /* Buffer for writing out rows */ + char *rowbuf; /* Buffer for writing out rows */ int xres; /* X resolution */ int np; /* Number of planes */ unsigned char *red; /* Colormap red */ @@ -632,7 +632,7 @@ pnmsaverow_raw_indexed (PNMRowInfo *ri, unsigned char *data) { int i; - unsigned char *rbcur = ri->rowbuf; + char *rbcur = ri->rowbuf; for (i = 0; i < ri->xres; i++) { @@ -649,7 +649,7 @@ pnmsaverow_ascii (PNMRowInfo *ri, unsigned char *data) { int i; - unsigned char *rbcur = ri->rowbuf; + char *rbcur = ri->rowbuf; for (i = 0; i < ri->xres*ri->np; i++) { @@ -665,7 +665,7 @@ pnmsaverow_ascii_indexed (PNMRowInfo *ri, unsigned char *data) { int i; - unsigned char *rbcur = ri->rowbuf; + char *rbcur = ri->rowbuf; for (i = 0; i < ri->xres; i++) { @@ -693,7 +693,7 @@ save_image (char *filename, unsigned char grn[256]; unsigned char blu[256]; unsigned char *data, *d; - unsigned char *rowbuf; + char *rowbuf; char buf[BUFLEN]; char *temp; int np; diff --git a/plug-ins/print/print-util.c b/plug-ins/print/print-util.c index 635cce2302..a445c09325 100644 --- a/plug-ins/print/print-util.c +++ b/plug-ins/print/print-util.c @@ -34,6 +34,26 @@ * Revision History: * * $Log$ + * Revision 1.6 1998/04/11 05:07:46 yosh + * * app/app_procs.c: fixed up idle handler for file open (look like testgtk + * idle demo) + * + * * app/colomaps.c: fixup for visual test and use of gdk_color_alloc for some + * fixed colors (from Owen Taylor) + * + * * app/errors.h + * * app/errors.c + * * app/main.c + * * libgimp/gimp.c: redid the signal handlers so we only get a debug prompt on + * SIGSEGV, SIGBUS, and SIGFPE. + * + * * applied gimp-jbuhler-980408-0 and gimp-joke-980409-0 (warning fixups) + * + * * applied gimp-monnaux-980409-0 for configurable plugin path for multiarch + * setups + * + * -Yosh + * * Revision 1.5 1998/04/07 03:41:15 yosh * configure.in: fix for $srcdir != $builddir for data. Tightened check for * random() and add -lucb on systems that need it. Fix for xdelta.h check. Find @@ -131,8 +151,11 @@ * (currently 720) to avoid problems... */ -int error[2][4][11*720+4] = { { { 0 } } }; - +int error[2][4][11*720+4] = + { + { { 0 }, { 0 }, { 0 } , { 0 } }, + { { 0 }, { 0 }, { 0 } , { 0 } } + }; /* * 'dither_black()' - Dither grayscale pixels to black. diff --git a/plug-ins/script-fu/interp_trace.c b/plug-ins/script-fu/interp_trace.c index 59f38ac940..6c77472fbf 100644 --- a/plug-ins/script-fu/interp_trace.c +++ b/plug-ins/script-fu/interp_trace.c @@ -84,7 +84,7 @@ ltrace_1 (LISP fcn_name, LISP env) else if (TYPE (fcn) == tc_closure_traced) ; else - err ("not a closure, cannot trace", fcn); + my_err ("not a closure, cannot trace", fcn); return (NIL); } @@ -105,7 +105,7 @@ luntrace_1 (LISP fcn) else if (TYPE (fcn) == tc_closure_traced) fcn->type = tc_closure; else - err ("not a closure, cannot untrace", fcn); + my_err ("not a closure, cannot untrace", fcn); return (NIL); } diff --git a/plug-ins/script-fu/siod/trace.c b/plug-ins/script-fu/siod/trace.c index 59f38ac940..6c77472fbf 100644 --- a/plug-ins/script-fu/siod/trace.c +++ b/plug-ins/script-fu/siod/trace.c @@ -84,7 +84,7 @@ ltrace_1 (LISP fcn_name, LISP env) else if (TYPE (fcn) == tc_closure_traced) ; else - err ("not a closure, cannot trace", fcn); + my_err ("not a closure, cannot trace", fcn); return (NIL); } @@ -105,7 +105,7 @@ luntrace_1 (LISP fcn) else if (TYPE (fcn) == tc_closure_traced) fcn->type = tc_closure; else - err ("not a closure, cannot untrace", fcn); + my_err ("not a closure, cannot untrace", fcn); return (NIL); } diff --git a/plug-ins/sgi/sgi.c b/plug-ins/sgi/sgi.c index 10ae32d91e..0215c7d88a 100644 --- a/plug-ins/sgi/sgi.c +++ b/plug-ins/sgi/sgi.c @@ -34,6 +34,26 @@ * Revision History: * * $Log$ + * Revision 1.6 1998/04/11 05:07:49 yosh + * * app/app_procs.c: fixed up idle handler for file open (look like testgtk + * idle demo) + * + * * app/colomaps.c: fixup for visual test and use of gdk_color_alloc for some + * fixed colors (from Owen Taylor) + * + * * app/errors.h + * * app/errors.c + * * app/main.c + * * libgimp/gimp.c: redid the signal handlers so we only get a debug prompt on + * SIGSEGV, SIGBUS, and SIGFPE. + * + * * applied gimp-jbuhler-980408-0 and gimp-joke-980409-0 (warning fixups) + * + * * applied gimp-monnaux-980409-0 for configurable plugin path for multiarch + * setups + * + * -Yosh + * * Revision 1.5 1998/04/07 03:41:18 yosh * configure.in: fix for $srcdir != $builddir for data. Tightened check for * random() and add -lucb on systems that need it. Fix for xdelta.h check. Find @@ -265,7 +285,7 @@ run(char *name, /* I - Name of filter program. */ if (compression < 0 || compression > 2) values[0].data.d_status = STATUS_CALLING_ERROR; - }; + } break; case RUN_WITH_LAST_VALS : @@ -278,7 +298,7 @@ run(char *name, /* I - Name of filter program. */ default : break; - }; + } if (values[0].data.d_status == STATUS_SUCCESS) { @@ -287,7 +307,7 @@ run(char *name, /* I - Name of filter program. */ gimp_set_data("file_sgi_save", &compression, sizeof(compression)); else values[0].data.d_status = STATUS_EXECUTION_ERROR; - }; + } } else values[0].data.d_status = STATUS_EXECUTION_ERROR; @@ -329,7 +349,7 @@ load_image(char *filename) /* I - File to load */ { g_print("can't open image file\n"); gimp_quit(); - }; + } if (strrchr(filename, '/') != NULL) sprintf(progress, "Loading %s:", strrchr(filename, '/') + 1); @@ -363,14 +383,14 @@ load_image(char *filename) /* I - File to load */ image_type = RGB; layer_type = RGBA_IMAGE; break; - }; + } image = gimp_image_new(sgip->xsize, sgip->ysize, image_type); if (image == -1) { g_print("can't allocate new image\n"); gimp_quit(); - }; + } gimp_image_set_filename(image, filename); @@ -422,7 +442,7 @@ load_image(char *filename) /* I - File to load */ count = 0; gimp_progress_update((double)y / (double)sgip->ysize); - }; + } for (i = 0; i < sgip->zsize; i ++) if (sgiGetRow(sgip, rows[i], sgip->ysize - 1 - y, i) < 0) @@ -448,8 +468,8 @@ load_image(char *filename) /* I - File to load */ for (x = 0, pptr = pixels[count]; x < sgip->xsize; x ++) for (i = 0; i < sgip->zsize; i ++, pptr ++) *pptr = (unsigned)(rows[i][x] + 32768) >> 8; - }; - }; + } + } /* * Do the last n rows (count always > 0) @@ -527,7 +547,7 @@ save_image(char *filename, /* I - File to save to */ case RGBA_IMAGE : zsize = 4; break; - }; + } /* * Open the file for writing... @@ -539,7 +559,7 @@ save_image(char *filename, /* I - File to save to */ { g_print("can't create image file\n"); gimp_quit(); - }; + } if (strrchr(filename, '/') != NULL) sprintf(progress, "Saving %s:", strrchr(filename, '/') + 1); @@ -594,10 +614,10 @@ save_image(char *filename, /* I - File to save to */ for (j = 0; j < zsize; j ++) sgiPutRow(sgip, rows[j], drawable->height - 1 - y - i, j); - }; + } gimp_progress_update((double)y / (double)drawable->height); - }; + } /* * Done with the file... @@ -748,7 +768,7 @@ save_dialog(void) (gpointer)((long)i)); gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); gtk_widget_show(button); - }; + } /* * Show everything and go... diff --git a/plug-ins/sgi/sgilib.c b/plug-ins/sgi/sgilib.c index a8ebc171c4..7369028bf3 100644 --- a/plug-ins/sgi/sgilib.c +++ b/plug-ins/sgi/sgilib.c @@ -37,6 +37,26 @@ * Revision History: * * $Log$ + * Revision 1.4 1998/04/11 05:07:50 yosh + * * app/app_procs.c: fixed up idle handler for file open (look like testgtk + * idle demo) + * + * * app/colomaps.c: fixup for visual test and use of gdk_color_alloc for some + * fixed colors (from Owen Taylor) + * + * * app/errors.h + * * app/errors.c + * * app/main.c + * * libgimp/gimp.c: redid the signal handlers so we only get a debug prompt on + * SIGSEGV, SIGBUS, and SIGFPE. + * + * * applied gimp-jbuhler-980408-0 and gimp-joke-980409-0 (warning fixups) + * + * * applied gimp-monnaux-980409-0 for configurable plugin path for multiarch + * setups + * + * -Yosh + * * Revision 1.3 1998/04/01 22:14:53 neo * Added checks for print spoolers to configure.in as suggested by Michael * Sweet. The print plug-in still needs some changes to Makefile.am to make @@ -111,19 +131,19 @@ sgiClose(sgi_t *sgip) /* I - SGI image */ i --, offset ++) if (putlong(offset[0], sgip->file) < 0) return (-1); - }; + } if (sgip->table != NULL) { free(sgip->table[0]); free(sgip->table); - }; + } if (sgip->length != NULL) { free(sgip->length[0]); free(sgip->length); - }; + } if (sgip->comp == SGI_COMP_ARLE) free(sgip->arle_row); @@ -176,7 +196,7 @@ sgiGetRow(sgi_t *sgip, /* I - SGI image */ { for (x = sgip->xsize; x > 0; x --, row ++) *row = getshort(sgip->file); - }; + } break; case SGI_COMP_RLE : @@ -189,7 +209,7 @@ sgiGetRow(sgi_t *sgip, /* I - SGI image */ else return (read_rle16(sgip->file, row, sgip->xsize)); break; - }; + } return (0); } @@ -224,13 +244,13 @@ sgiOpen(char *filename, /* I - File to open */ { free(sgip); return (NULL); - }; + } if ((sgip->file = fopen(filename, "rb")) == NULL) { free(sgip); return (NULL); - }; + } sgip->mode = SGI_READ; @@ -240,7 +260,7 @@ sgiOpen(char *filename, /* I - File to open */ fclose(sgip->file); free(sgip); return (NULL); - }; + } sgip->comp = getc(sgip->file); sgip->bpp = getc(sgip->file); @@ -267,7 +287,7 @@ sgiOpen(char *filename, /* I - File to open */ for (i = 0; i < sgip->zsize; i ++) for (j = 0; j < sgip->ysize; j ++) sgip->table[i][j] = getlong(sgip->file); - }; + } break; case SGI_WRITE : @@ -280,13 +300,13 @@ sgiOpen(char *filename, /* I - File to open */ { free(sgip); return (NULL); - }; + } if ((sgip->file = fopen(filename, "wb+")) == NULL) { free(sgip); return (NULL); - }; + } sgip->mode = SGI_WRITE; @@ -306,7 +326,7 @@ sgiOpen(char *filename, /* I - File to open */ { putlong(-32768, sgip->file); /* Minimum pixel */ putlong(32767, sgip->file); /* Maximum pixel */ - }; + } putlong(0, sgip->file); /* Reserved */ memset(name, 0, sizeof(name)); @@ -336,7 +356,7 @@ sgiOpen(char *filename, /* I - File to open */ { for (i = xsize * ysize * zsize; i > 0; i --) putshort(0, sgip->file); - }; + } break; case SGI_COMP_ARLE : /* Aggressive RLE */ @@ -362,13 +382,13 @@ sgiOpen(char *filename, /* I - File to open */ for (i = 1; i < sgip->zsize; i ++) sgip->length[i] = sgip->length[0] + i * sgip->ysize; break; - }; + } break; default : free(sgip); return (NULL); - }; + } return (sgip); } @@ -415,7 +435,7 @@ sgiPutRow(sgi_t *sgip, /* I - SGI image */ { for (x = sgip->xsize; x > 0; x --, row ++) putshort(*row, sgip->file); - }; + } break; case SGI_COMP_ARLE : @@ -437,8 +457,8 @@ sgiPutRow(sgi_t *sgip, /* I - SGI image */ sgip->table[z][y] = sgip->arle_offset; sgip->length[z][y] = sgip->arle_length; return (0); - }; - }; + } + } /* * If that didn't match, search all the previous rows... @@ -455,7 +475,7 @@ sgiPutRow(sgi_t *sgip, /* I - SGI image */ { x = 0; break; - }; + } for (x = 0; x < sgip->xsize; x ++) if (row[x] != sgip->arle_row[x]) @@ -472,14 +492,14 @@ sgiPutRow(sgi_t *sgip, /* I - SGI image */ { x = 0; break; - }; + } for (x = 0; x < sgip->xsize; x ++) if (row[x] != sgip->arle_row[x]) break; } while (x < sgip->xsize); - }; + } if (x == sgip->xsize) { @@ -509,13 +529,13 @@ sgiPutRow(sgi_t *sgip, /* I - SGI image */ sgip->arle_offset = offset; sgip->arle_length = x; memcpy(sgip->arle_row, row, sgip->xsize * sizeof(short)); - }; + } sgip->nextrow = ftell(sgip->file); sgip->length[z][y] = x; return (x); - }; + } return (0); } @@ -627,8 +647,8 @@ read_rle8(FILE *fp, /* I - File to read from */ length ++; for (i = 0; i < count; i ++, row ++, xsize --) *row = ch; - }; - }; + } + } return (xsize > 0 ? -1 : length); } @@ -672,8 +692,8 @@ read_rle16(FILE *fp, /* I - File to read from */ length ++; for (i = 0; i < count; i ++, row ++, xsize --) *row = ch; - }; - }; + } + } return (xsize > 0 ? -1 : length * 2); } @@ -706,7 +726,7 @@ write_rle8(FILE *fp, /* I - File to write to */ { row ++; x --; - }; + } row -= 2; x += 2; @@ -728,8 +748,8 @@ write_rle8(FILE *fp, /* I - File to write to */ start ++; i --; length ++; - }; - }; + } + } if (x <= 0) break; @@ -744,7 +764,7 @@ write_rle8(FILE *fp, /* I - File to write to */ { row ++; x --; - }; + } count = row - start; while (count > 0) @@ -759,8 +779,8 @@ write_rle8(FILE *fp, /* I - File to write to */ if (putc(repeat, fp) == EOF) return (-1); length ++; - }; - }; + } + } length ++; @@ -798,7 +818,7 @@ write_rle16(FILE *fp, /* I - File to write to */ { row ++; x --; - }; + } row -= 2; x += 2; @@ -820,8 +840,8 @@ write_rle16(FILE *fp, /* I - File to write to */ start ++; i --; length ++; - }; - }; + } + } if (x <= 0) break; @@ -836,7 +856,7 @@ write_rle16(FILE *fp, /* I - File to write to */ { row ++; x --; - }; + } count = row - start; while (count > 0) @@ -851,8 +871,8 @@ write_rle16(FILE *fp, /* I - File to write to */ if (putshort(repeat, fp) == EOF) return (-1); length ++; - }; - }; + } + } length ++; diff --git a/plug-ins/sinus/sinus.c b/plug-ins/sinus/sinus.c index 849ab841d3..9f55baf470 100644 --- a/plug-ins/sinus/sinus.c +++ b/plug-ins/sinus/sinus.c @@ -58,16 +58,16 @@ typedef gdouble colRGBA[4]; * This structure is used for persistent data. */ -#define B_W 0 /* colors setting */ -#define USE_FG_BG 1 -#define USE_COLORS 2 +#define B_W 0L /* colors setting */ +#define USE_FG_BG 1L +#define USE_COLORS 2L -#define LINEAR 0 /* colorization settings */ -#define BILINEAR 1 -#define SINUS 2 +#define LINEAR 0L /* colorization settings */ +#define BILINEAR 1L +#define SINUS 2L -#define IDEAL 0 /* Perturbation settings */ -#define PERTURBED 1 +#define IDEAL 0L /* Perturbation settings */ +#define PERTURBED 1L typedef struct { gdouble scalex, scaley; @@ -75,9 +75,9 @@ typedef struct { gdouble blend_power; gint seed; gint tiling; - gint perturbation; - gint colorization; - gint colors; + glong perturbation; + glong colorization; + glong colors; colRGBA col1,col2; } SinusVals; diff --git a/plug-ins/zealouscrop/zealouscrop.c b/plug-ins/zealouscrop/zealouscrop.c index 4d0b9fa800..8ab9318aba 100644 --- a/plug-ins/zealouscrop/zealouscrop.c +++ b/plug-ins/zealouscrop/zealouscrop.c @@ -23,7 +23,7 @@ static void run(char *name, GParam * param, int *nreturn_vals, GParam ** return_vals); -static inline int colours_equal(guchar *col1, gchar *col2, int bytes); +static inline int colours_equal(guchar *col1, guchar *col2, int bytes); static void do_zcrop(GDrawable *drawable, gint32); @@ -265,7 +265,7 @@ static void do_zcrop(GDrawable *drawable, gint32 image_id) } -static inline int colours_equal(guchar *col1, gchar *col2, int bytes) +static inline int colours_equal(guchar *col1, guchar *col2, int bytes) { int b;