From 013e30db540da243fe882e7fc520310e04f58517 Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Sun, 5 Jan 2003 20:38:21 +0000 Subject: [PATCH] app/undo_history.c app/core/gimpbrush.c app/core/gimpimage-new.c 2003-01-05 Manish Singh * app/undo_history.c * app/core/gimpbrush.c * app/core/gimpimage-new.c * app/core/gimpobject.c * app/core/gimppalette-import.c * app/core/gimppattern.c * app/plug-in/plug-in.c * app/tools/gimpbezierselecttool.c * libgimpwidgets/gimpunitmenu.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/convmatrix.c * plug-ins/common/curve_bend.c * plug-ins/common/sample_colorize.c * plug-ins/common/tiff.c * plug-ins/flame/flame.c * plug-ins/gflare/gflare.c * plug-ins/gimpressionist/general.c * plug-ins/gimpressionist/orientation.c * plug-ins/gimpressionist/preview.c * plug-ins/gimpressionist/size.c * plug-ins/imagemap/imap_grid.c * plug-ins/imagemap/imap_menu.c * plug-ins/maze/algorithms.c * plug-ins/script-fu/interp_regex.c * plug-ins/script-fu/interp_sliba.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-server.c * plug-ins/webbrowser/webbrowser.c: added GINT_TO_POINTER and friends, fixed format strings, for 64-bitness. * modules/colorsel_triangle.c * plug-ins/tools/tool-safe-mode-plug-in.c: #include missing header files --- ChangeLog | 36 +++++++++++++++++++++++++ app/core/gimpbrush-load.c | 2 +- app/core/gimpbrush.c | 2 +- app/core/gimpimage-new.c | 4 +-- app/core/gimpobject.c | 2 +- app/core/gimppalette-import.c | 5 ++-- app/core/gimppattern-load.c | 2 +- app/core/gimppattern.c | 2 +- app/plug-in/gimpplugin-message.c | 2 +- app/plug-in/gimpplugin.c | 2 +- app/plug-in/gimppluginmanager-call.c | 2 +- app/plug-in/gimppluginmanager-run.c | 2 +- app/plug-in/gimppluginshm.c | 2 +- app/plug-in/plug-in-message.c | 2 +- app/plug-in/plug-in-run.c | 2 +- app/plug-in/plug-in-shm.c | 2 +- app/plug-in/plug-in.c | 2 +- app/tools/gimpbezierselecttool.c | 2 +- app/undo_history.c | 2 +- libgimpproxy/gimpobject.c | 2 +- libgimpwidgets/gimpunitmenu.c | 3 ++- modules/colorsel_triangle.c | 2 ++ plug-ins/MapObject/mapobject_ui.c | 4 +-- plug-ins/common/convmatrix.c | 4 +-- plug-ins/common/curve_bend.c | 6 ++--- plug-ins/common/sample_colorize.c | 8 +++--- plug-ins/common/tiff.c | 4 +-- plug-ins/flame/flame.c | 6 ++--- plug-ins/gflare/gflare.c | 2 +- plug-ins/gimpressionist/general.c | 2 +- plug-ins/gimpressionist/orientation.c | 2 +- plug-ins/gimpressionist/preview.c | 2 +- plug-ins/gimpressionist/size.c | 2 +- plug-ins/imagemap/imap_grid.c | 2 +- plug-ins/imagemap/imap_menu.c | 2 +- plug-ins/maze/algorithms.c | 20 +++++++------- plug-ins/script-fu/interp_regex.c | 2 +- plug-ins/script-fu/interp_sliba.c | 14 +++++----- plug-ins/script-fu/script-fu-console.c | 2 +- plug-ins/script-fu/script-fu-server.c | 7 ++--- plug-ins/script-fu/siod/regex.c | 2 +- plug-ins/script-fu/siod/sliba.c | 14 +++++----- plug-ins/tools/tool-safe-mode-plug-in.c | 2 ++ plug-ins/webbrowser/webbrowser.c | 2 +- 44 files changed, 119 insertions(+), 76 deletions(-) diff --git a/ChangeLog b/ChangeLog index a319ccbbdf..a66a7dc3d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2003-01-05 Manish Singh + + * app/undo_history.c + * app/core/gimpbrush.c + * app/core/gimpimage-new.c + * app/core/gimpobject.c + * app/core/gimppalette-import.c + * app/core/gimppattern.c + * app/plug-in/plug-in.c + * app/tools/gimpbezierselecttool.c + * libgimpwidgets/gimpunitmenu.c + * plug-ins/MapObject/mapobject_ui.c + * plug-ins/common/convmatrix.c + * plug-ins/common/curve_bend.c + * plug-ins/common/sample_colorize.c + * plug-ins/common/tiff.c + * plug-ins/flame/flame.c + * plug-ins/gflare/gflare.c + * plug-ins/gimpressionist/general.c + * plug-ins/gimpressionist/orientation.c + * plug-ins/gimpressionist/preview.c + * plug-ins/gimpressionist/size.c + * plug-ins/imagemap/imap_grid.c + * plug-ins/imagemap/imap_menu.c + * plug-ins/maze/algorithms.c + * plug-ins/script-fu/interp_regex.c + * plug-ins/script-fu/interp_sliba.c + * plug-ins/script-fu/script-fu-console.c + * plug-ins/script-fu/script-fu-server.c + * plug-ins/webbrowser/webbrowser.c: added GINT_TO_POINTER and friends, + fixed format strings, for 64-bitness. + + * modules/colorsel_triangle.c + * plug-ins/tools/tool-safe-mode-plug-in.c: #include missing header + files + 2003-01-05 Michael Natterer * configure.in: changed --with-gnome-desktop to --with-gnome-datadir diff --git a/app/core/gimpbrush-load.c b/app/core/gimpbrush-load.c index c0e6582546..9713063c98 100644 --- a/app/core/gimpbrush-load.c +++ b/app/core/gimpbrush-load.c @@ -512,7 +512,7 @@ gimp_brush_load_brush (gint fd, { g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, _("Could not read %d bytes from '%s': %s"), - sizeof (header), filename, g_strerror (errno)); + (gint) sizeof (header), filename, g_strerror (errno)); return NULL; } diff --git a/app/core/gimpbrush.c b/app/core/gimpbrush.c index c0e6582546..9713063c98 100644 --- a/app/core/gimpbrush.c +++ b/app/core/gimpbrush.c @@ -512,7 +512,7 @@ gimp_brush_load_brush (gint fd, { g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, _("Could not read %d bytes from '%s': %s"), - sizeof (header), filename, g_strerror (errno)); + (gint) sizeof (header), filename, g_strerror (errno)); return NULL; } diff --git a/app/core/gimpimage-new.c b/app/core/gimpimage-new.c index e39a03c4d7..8a22c63062 100644 --- a/app/core/gimpimage-new.c +++ b/app/core/gimpimage-new.c @@ -111,7 +111,7 @@ gimp_image_new_get_memsize_string (gsize memsize) { if (memsize < 4096) { - return g_strdup_printf (_("%d Bytes"), memsize); + return g_strdup_printf (_("%lu Bytes"), memsize); } else if (memsize < 1024 * 10) { @@ -123,7 +123,7 @@ gimp_image_new_get_memsize_string (gsize memsize) } else if (memsize < 1024 * 1024) { - return g_strdup_printf (_("%d KB"), memsize / 1024); + return g_strdup_printf (_("%lu KB"), memsize / 1024); } else if (memsize < 1024 * 1024 * 10) { diff --git a/app/core/gimpobject.c b/app/core/gimpobject.c index 249edc40a9..88b4c53d4f 100644 --- a/app/core/gimpobject.c +++ b/app/core/gimpobject.c @@ -290,7 +290,7 @@ gimp_object_get_memsize (GimpObject *object) indent_buf[i] = '\0'; - object_size = g_strdup_printf ("%s%s \"%s\": %d\n", + object_size = g_strdup_printf ("%s%s \"%s\": %lu\n", indent_buf, g_type_name (G_TYPE_FROM_INSTANCE (object)), object->name, diff --git a/app/core/gimppalette-import.c b/app/core/gimppalette-import.c index f49f137044..54b4dbf307 100644 --- a/app/core/gimppalette-import.c +++ b/app/core/gimppalette-import.c @@ -104,7 +104,8 @@ gimp_palette_import_store_colors (GHashTable *h_array, } else { - found_color = g_hash_table_lookup (h_array, (gpointer) key_colors); + found_color = g_hash_table_lookup (h_array, + GUINT_TO_POINTER (key_colors)); } if (found_color == NULL) @@ -127,7 +128,7 @@ gimp_palette_import_store_colors (GHashTable *h_array, new_color->g = colors[1]; new_color->b = colors[2]; - g_hash_table_insert (h_array, (gpointer) key_colors, new_color); + g_hash_table_insert (h_array, GUINT_TO_POINTER (key_colors), new_color); } else { diff --git a/app/core/gimppattern-load.c b/app/core/gimppattern-load.c index c00d00e2be..8f35a1d8e3 100644 --- a/app/core/gimppattern-load.c +++ b/app/core/gimppattern-load.c @@ -309,7 +309,7 @@ gimp_pattern_load (const gchar *filename, { g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, _("Could not read %d bytes from '%s': %s"), - sizeof (header), filename, g_strerror (errno)); + (gint) sizeof (header), filename, g_strerror (errno)); goto error; } diff --git a/app/core/gimppattern.c b/app/core/gimppattern.c index c00d00e2be..8f35a1d8e3 100644 --- a/app/core/gimppattern.c +++ b/app/core/gimppattern.c @@ -309,7 +309,7 @@ gimp_pattern_load (const gchar *filename, { g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, _("Could not read %d bytes from '%s': %s"), - sizeof (header), filename, g_strerror (errno)); + (gint) sizeof (header), filename, g_strerror (errno)); goto error; } diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c index 8b7e25c6c1..4aeb7766b7 100644 --- a/app/plug-in/gimpplugin-message.c +++ b/app/plug-in/gimpplugin-message.c @@ -1655,7 +1655,7 @@ plug_in_flush (GIOChannel *channel, GIOStatus status; GError *error = NULL; gint count; - guint bytes; + gsize bytes; plug_in = (PlugIn *) user_data; diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c index 8b7e25c6c1..4aeb7766b7 100644 --- a/app/plug-in/gimpplugin.c +++ b/app/plug-in/gimpplugin.c @@ -1655,7 +1655,7 @@ plug_in_flush (GIOChannel *channel, GIOStatus status; GError *error = NULL; gint count; - guint bytes; + gsize bytes; plug_in = (PlugIn *) user_data; diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index 8b7e25c6c1..4aeb7766b7 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -1655,7 +1655,7 @@ plug_in_flush (GIOChannel *channel, GIOStatus status; GError *error = NULL; gint count; - guint bytes; + gsize bytes; plug_in = (PlugIn *) user_data; diff --git a/app/plug-in/gimppluginmanager-run.c b/app/plug-in/gimppluginmanager-run.c index 8b7e25c6c1..4aeb7766b7 100644 --- a/app/plug-in/gimppluginmanager-run.c +++ b/app/plug-in/gimppluginmanager-run.c @@ -1655,7 +1655,7 @@ plug_in_flush (GIOChannel *channel, GIOStatus status; GError *error = NULL; gint count; - guint bytes; + gsize bytes; plug_in = (PlugIn *) user_data; diff --git a/app/plug-in/gimppluginshm.c b/app/plug-in/gimppluginshm.c index 8b7e25c6c1..4aeb7766b7 100644 --- a/app/plug-in/gimppluginshm.c +++ b/app/plug-in/gimppluginshm.c @@ -1655,7 +1655,7 @@ plug_in_flush (GIOChannel *channel, GIOStatus status; GError *error = NULL; gint count; - guint bytes; + gsize bytes; plug_in = (PlugIn *) user_data; diff --git a/app/plug-in/plug-in-message.c b/app/plug-in/plug-in-message.c index 8b7e25c6c1..4aeb7766b7 100644 --- a/app/plug-in/plug-in-message.c +++ b/app/plug-in/plug-in-message.c @@ -1655,7 +1655,7 @@ plug_in_flush (GIOChannel *channel, GIOStatus status; GError *error = NULL; gint count; - guint bytes; + gsize bytes; plug_in = (PlugIn *) user_data; diff --git a/app/plug-in/plug-in-run.c b/app/plug-in/plug-in-run.c index 8b7e25c6c1..4aeb7766b7 100644 --- a/app/plug-in/plug-in-run.c +++ b/app/plug-in/plug-in-run.c @@ -1655,7 +1655,7 @@ plug_in_flush (GIOChannel *channel, GIOStatus status; GError *error = NULL; gint count; - guint bytes; + gsize bytes; plug_in = (PlugIn *) user_data; diff --git a/app/plug-in/plug-in-shm.c b/app/plug-in/plug-in-shm.c index 8b7e25c6c1..4aeb7766b7 100644 --- a/app/plug-in/plug-in-shm.c +++ b/app/plug-in/plug-in-shm.c @@ -1655,7 +1655,7 @@ plug_in_flush (GIOChannel *channel, GIOStatus status; GError *error = NULL; gint count; - guint bytes; + gsize bytes; plug_in = (PlugIn *) user_data; diff --git a/app/plug-in/plug-in.c b/app/plug-in/plug-in.c index 8b7e25c6c1..4aeb7766b7 100644 --- a/app/plug-in/plug-in.c +++ b/app/plug-in/plug-in.c @@ -1655,7 +1655,7 @@ plug_in_flush (GIOChannel *channel, GIOStatus status; GError *error = NULL; gint count; - guint bytes; + gsize bytes; plug_in = (PlugIn *) user_data; diff --git a/app/tools/gimpbezierselecttool.c b/app/tools/gimpbezierselecttool.c index f46c1ad7f2..c33122c62a 100644 --- a/app/tools/gimpbezierselecttool.c +++ b/app/tools/gimpbezierselecttool.c @@ -3460,7 +3460,7 @@ bezier_stroke (GimpBezierSelectTool *bezier_sel, procedural_db_run_proc (gdisp->gimage->gimp, pdb_string, &nreturn_vals, - GIMP_PDB_DRAWABLE, (GimpDrawable *) gimp_item_get_ID (GIMP_ITEM (drawable)), + GIMP_PDB_DRAWABLE, gimp_item_get_ID (GIMP_ITEM (drawable)), GIMP_PDB_INT32, (gint32) rpnts->num_stroke_points * 2, GIMP_PDB_FLOATARRAY, rpnts->stroke_points, GIMP_PDB_END); diff --git a/app/undo_history.c b/app/undo_history.c index e97322c01b..7ddfea7da5 100644 --- a/app/undo_history.c +++ b/app/undo_history.c @@ -428,7 +428,7 @@ undo_history_set_pixmap (GtkCList *clist, { static idle_preview_args idle; - if (!size || ((gint)gtk_clist_get_row_data (clist, row)) == 2) + if (!size || (GPOINTER_TO_INT (gtk_clist_get_row_data (clist, row))) == 2) return; idle.clist = clist; diff --git a/libgimpproxy/gimpobject.c b/libgimpproxy/gimpobject.c index 7526d6ba7f..18f0bf0622 100644 --- a/libgimpproxy/gimpobject.c +++ b/libgimpproxy/gimpobject.c @@ -295,7 +295,7 @@ gimp_object_get_memsize (GimpObject *object) indent_buf[i] = '\0'; - object_size = g_strdup_printf ("%s%s \"%s\": %d\n", + object_size = g_strdup_printf ("%s%s \"%s\": %lu\n", indent_buf, g_type_name (G_TYPE_FROM_INSTANCE (object)), object->name, diff --git a/libgimpwidgets/gimpunitmenu.c b/libgimpwidgets/gimpunitmenu.c index 4a357961f4..a4d08c9645 100644 --- a/libgimpwidgets/gimpunitmenu.c +++ b/libgimpwidgets/gimpunitmenu.c @@ -630,7 +630,8 @@ gimp_unit_menu_callback (GtkWidget *widget, GimpUnit new_unit; gum = data; - new_unit = (guint) g_object_get_data (G_OBJECT (widget), "gimp_unit_menu"); + new_unit = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget), + "gimp_unit_menu")); if (gum->unit == new_unit) return; diff --git a/modules/colorsel_triangle.c b/modules/colorsel_triangle.c index 5df04a80a3..b87366d193 100644 --- a/modules/colorsel_triangle.c +++ b/modules/colorsel_triangle.c @@ -22,6 +22,8 @@ #include "config.h" +#include + #ifdef __GNUC__ #warning GTK_DISABLE_DEPRECATED #endif diff --git a/plug-ins/MapObject/mapobject_ui.c b/plug-ins/MapObject/mapobject_ui.c index 6492fd9707..54c438a6fb 100644 --- a/plug-ins/MapObject/mapobject_ui.c +++ b/plug-ins/MapObject/mapobject_ui.c @@ -387,7 +387,7 @@ box_drawable_callback (gint32 id, { gint i; - i = (gint) g_object_get_data (G_OBJECT (data), "_mapwid_id"); + i = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (data), "_mapwid_id")); mapvals.boxmap_id[i] = id; } @@ -410,7 +410,7 @@ cylinder_drawable_callback (gint32 id, { gint i; - i = (gint) g_object_get_data (G_OBJECT (data), "_mapwid_id"); + i = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (data), "_mapwid_id")); mapvals.cylindermap_id[i] = id; } diff --git a/plug-ins/common/convmatrix.c b/plug-ins/common/convmatrix.c index 39b80316a6..684e1f5fb8 100644 --- a/plug-ins/common/convmatrix.c +++ b/plug-ins/common/convmatrix.c @@ -831,7 +831,7 @@ static void my_bmode_callback (GtkWidget *widget, gpointer data) { - my_config.bmode = (int) data - 1; + my_config.bmode = GPOINTER_TO_INT (data) - 1; } static gint @@ -1010,7 +1010,7 @@ dialog (void) g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (my_bmode_callback), - (gpointer) (i + 1)); + GINT_TO_POINTER (i + 1)); } gtk_widget_show (box); diff --git a/plug-ins/common/curve_bend.c b/plug-ins/common/curve_bend.c index cada562da9..bb059ebb61 100644 --- a/plug-ins/common/curve_bend.c +++ b/plug-ins/common/curve_bend.c @@ -2832,8 +2832,8 @@ void p_end_gdrw (t_GDRW *gdrw) { if(gb_debug) - printf ("\np_end_gdrw: drawable %x ID: %d\n", - (int)gdrw->drawable, (int)gdrw->drawable->drawable_id); + printf ("\np_end_gdrw: drawable %p ID: %d\n", + gdrw->drawable, (int)gdrw->drawable->drawable_id); if(gdrw->tile) { @@ -2858,7 +2858,7 @@ p_init_gdrw (t_GDRW *gdrw, gint32 l_sel_channel_id; gint l_offsetx, l_offsety; - if(gb_debug) printf("\np_init_gdrw: drawable %x ID: %d\n", (int)drawable, (int)drawable->drawable_id); + if(gb_debug) printf("\np_init_gdrw: drawable %p ID: %d\n", drawable, (int)drawable->drawable_id); gdrw->drawable = drawable; gdrw->tile = NULL; diff --git a/plug-ins/common/sample_colorize.c b/plug-ins/common/sample_colorize.c index de9ad7a10a..cd41a7ba88 100644 --- a/plug-ins/common/sample_colorize.c +++ b/plug-ins/common/sample_colorize.c @@ -507,7 +507,7 @@ p_smp_toggle_callback (GtkWidget *widget, void p_gradient_callback(GtkWidget *w, gint32 id) { - if(g_Sdebug) printf("GRADIENT_MENU_CB: wiget %x, id: %d\n", (int)w, (int)id); + if(g_Sdebug) printf("GRADIENT_MENU_CB: widget %p, id: %d\n", w, (int)id); if((id == SMP_GRADIENT) || (id == SMP_INV_GRADIENT)) { @@ -527,7 +527,7 @@ p_smp_menu_callback(gint32 id, gpointer data) { gint32 *id_ptr; - if(g_Sdebug) printf("MENU_CB: data %x, dst: %x, samp %x\n", (int)data, (int)&g_values.sample_id, (int)&g_values.dst_id); + if(g_Sdebug) printf("MENU_CB: data %p, dst: %x, samp %x\n", data, (int)&g_values.sample_id, (int)&g_values.dst_id); if((id_ptr = (gint32 *)data) != NULL) { @@ -2590,7 +2590,7 @@ p_end_gdrw(t_GDRW *gdrw) { t_GDRW *l_sel_gdrw; - if(g_Sdebug) printf("\np_end_gdrw: drawable %x ID: %d\n", (int)gdrw->drawable, (int)gdrw->drawable->drawable_id); + if(g_Sdebug) printf("\np_end_gdrw: drawable %p ID: %d\n", gdrw->drawable, (int)gdrw->drawable->drawable_id); if(gdrw->tile) { @@ -2628,7 +2628,7 @@ p_init_gdrw(t_GDRW *gdrw, GimpDrawable *drawable, gint dirty, gint shadow) t_GDRW *l_sel_gdrw; gint32 non_empty; - if(g_Sdebug) printf("\np_init_gdrw: drawable %x ID: %d\n", (int)drawable, (int)drawable->drawable_id); + if(g_Sdebug) printf("\np_init_gdrw: drawable %p ID: %d\n", drawable, (int)drawable->drawable_id); gdrw->drawable = drawable; gdrw->tile = NULL; diff --git a/plug-ins/common/tiff.c b/plug-ins/common/tiff.c index 93851bc15c..56d43d03c9 100644 --- a/plug-ins/common/tiff.c +++ b/plug-ins/common/tiff.c @@ -698,13 +698,13 @@ load_rgba (TIFF *tif, channel_data *channel) { uint32 imageWidth, imageLength; uint32 row; - gulong *buffer; + uint32 *buffer; TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &imageWidth); TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imageLength); gimp_pixel_rgn_init (&(channel[0].pixel_rgn), channel[0].drawable, 0, 0, imageWidth, imageLength, TRUE, FALSE); - buffer = g_new(gulong, imageWidth * imageLength); + buffer = g_new(uint32, imageWidth * imageLength); channel[0].pixels = (guchar*) buffer; if (buffer == NULL) { g_message("TIFF Unable to allocate temporary buffer\n"); diff --git a/plug-ins/flame/flame.c b/plug-ins/flame/flame.c index 357c6dc9cb..612925de47 100644 --- a/plug-ins/flame/flame.c +++ b/plug-ins/flame/flame.c @@ -583,7 +583,7 @@ static void preview_clicked (GtkWidget *widget, gpointer data) { - gint mut = (gint) data; + gint mut = GPOINTER_TO_INT (data); if (mut == 4) { @@ -874,7 +874,7 @@ static void gradient_cb (GtkWidget *widget, gpointer data) { - config.cmap_drawable = (gint) data; + config.cmap_drawable = GPOINTER_TO_INT (data); set_cmap_preview(); set_flame_preview(); /* set_edit_preview(); */ @@ -1149,7 +1149,7 @@ dialog (void) menuitem = gtk_menu_item_new_with_label (names[i]); g_signal_connect (G_OBJECT (menuitem), "activate", G_CALLBACK (gradient_cb), - (gpointer) d); + GINT_TO_POINTER (d)); gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem); if (d == save_drawable) gtk_menu_set_active (GTK_MENU (menu), 0); diff --git a/plug-ins/gflare/gflare.c b/plug-ins/gflare/gflare.c index e71b1aac18..7296e52a13 100644 --- a/plug-ins/gflare/gflare.c +++ b/plug-ins/gflare/gflare.c @@ -4310,7 +4310,7 @@ ed_ientry_callback (GtkWidget *widget, gpointer data) static void ed_page_map_callback (GtkWidget *widget, gpointer data) { - gint page_num = (gint) data; + gint page_num = GPOINTER_TO_INT (data); DEBUG_PRINT(("ed_page_map_callback\n")); diff --git a/plug-ins/gimpressionist/general.c b/plug-ins/gimpressionist/general.c index a292a601f3..69b2d7686a 100644 --- a/plug-ins/gimpressionist/general.c +++ b/plug-ins/gimpressionist/general.c @@ -32,7 +32,7 @@ void generalbgchange(GtkWidget *wg, void *d, int num) int n; if(wg) { - n = (int) d; + n = GPOINTER_TO_INT (d); if(!img_has_alpha && (n == 3)) n = 1; pcvals.generalbgtype = n; diff --git a/plug-ins/gimpressionist/orientation.c b/plug-ins/gimpressionist/orientation.c index ef3dbc0cbd..ecaf889a16 100644 --- a/plug-ins/gimpressionist/orientation.c +++ b/plug-ins/gimpressionist/orientation.c @@ -32,7 +32,7 @@ GtkWidget *orientradio[NUMORIENTRADIO]; void orientchange(GtkWidget *wg, void *d, int num) { if (wg) { - pcvals.orienttype = (int) d; + pcvals.orienttype = GPOINTER_TO_INT (d); } else { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(orientradio[num]), TRUE); } diff --git a/plug-ins/gimpressionist/preview.c b/plug-ins/gimpressionist/preview.c index c9b4c8ec2d..a8b0b0659f 100644 --- a/plug-ins/gimpressionist/preview.c +++ b/plug-ins/gimpressionist/preview.c @@ -82,7 +82,7 @@ void updatepreviewprev(GtkWidget *wg, gpointer d) if(d) { storevals(); - if((gint) d != 2) + if(GPOINTER_TO_INT(d) != 2) repaint(&p, &a); } if(img_has_alpha) diff --git a/plug-ins/gimpressionist/size.c b/plug-ins/gimpressionist/size.c index 7f7b803124..93ca35e546 100644 --- a/plug-ins/gimpressionist/size.c +++ b/plug-ins/gimpressionist/size.c @@ -28,7 +28,7 @@ GtkWidget *sizeradio[NUMSIZERADIO]; void sizechange(GtkWidget *wg, void *d, int num) { if(wg) { - pcvals.sizetype = (int) d; + pcvals.sizetype = GPOINTER_TO_INT (d); } else { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(sizeradio[num]), TRUE); } diff --git a/plug-ins/imagemap/imap_grid.c b/plug-ins/imagemap/imap_grid.c index 5085c8c536..07a761b953 100644 --- a/plug-ins/imagemap/imap_grid.c +++ b/plug-ins/imagemap/imap_grid.c @@ -112,7 +112,7 @@ static void type_toggled_cb(GtkWidget *widget, gpointer data) { if (GTK_WIDGET_STATE(widget) & GTK_STATE_SELECTED) { - grid_type = (gint) data; + grid_type = GPOINTER_TO_INT (data); redraw_preview(); } } diff --git a/plug-ins/imagemap/imap_menu.c b/plug-ins/imagemap/imap_menu.c index 557c4ce86c..7cbf0f18e4 100644 --- a/plug-ins/imagemap/imap_menu.c +++ b/plug-ins/imagemap/imap_menu.c @@ -89,7 +89,7 @@ static void menu_zoom_to(GtkWidget *widget, gpointer data) { if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { - gint factor = (gint) data; + gint factor = GPOINTER_TO_INT (data); if (_menu_callback_lock) { _menu_callback_lock--; diff --git a/plug-ins/maze/algorithms.c b/plug-ins/maze/algorithms.c index 6e209e6be7..2fc9a97a65 100644 --- a/plug-ins/maze/algorithms.c +++ b/plug-ins/maze/algorithms.c @@ -477,19 +477,19 @@ prim_tileable(gchar *maz, guint x, guint y) maz[up]=maz[down]=maz[left]=maz[right]=FRONTIER; - front_cells=g_slist_append(front_cells,(gpointer)up); - front_cells=g_slist_append(front_cells,(gpointer)down); - front_cells=g_slist_append(front_cells,(gpointer)left); - front_cells=g_slist_append(front_cells,(gpointer)right); + front_cells=g_slist_append(front_cells,GINT_TO_POINTER(up)); + front_cells=g_slist_append(front_cells,GINT_TO_POINTER(down)); + front_cells=g_slist_append(front_cells,GINT_TO_POINTER(left)); + front_cells=g_slist_append(front_cells,GINT_TO_POINTER(right)); /* While frontier is not empty do the following... */ while(g_slist_length(front_cells) > 0) { /* Remove one cell at random from frontier and place it in IN. */ current = g_rand_int_range (gr, 0, g_slist_length(front_cells)); - pos = (guint)g_slist_nth(front_cells,current)->data; + pos = GPOINTER_TO_UINT(g_slist_nth(front_cells,current)->data); - front_cells=g_slist_remove(front_cells,(gpointer)pos); + front_cells=g_slist_remove(front_cells,GUINT_TO_POINTER(pos)); maz[pos]=IN; /* If the cell has any neighbors in OUT, remove them from @@ -504,7 +504,7 @@ prim_tileable(gchar *maz, guint x, guint y) switch (maz[up]) { case OUT: maz[up]=FRONTIER; - front_cells=g_slist_append(front_cells,(gpointer)up); + front_cells=g_slist_append(front_cells,GINT_TO_POINTER(up)); break; case IN: d=1; @@ -515,7 +515,7 @@ prim_tileable(gchar *maz, guint x, guint y) switch (maz[down]) { case OUT: maz[down]=FRONTIER; - front_cells=g_slist_append(front_cells,(gpointer)down); + front_cells=g_slist_append(front_cells,GINT_TO_POINTER(down)); break; case IN: d=d|2; @@ -526,7 +526,7 @@ prim_tileable(gchar *maz, guint x, guint y) switch (maz[left]) { case OUT: maz[left]=FRONTIER; - front_cells=g_slist_append(front_cells,(gpointer)left); + front_cells=g_slist_append(front_cells,GINT_TO_POINTER(left)); break; case IN: d=d|4; @@ -537,7 +537,7 @@ prim_tileable(gchar *maz, guint x, guint y) switch (maz[right]) { case OUT: maz[right]=FRONTIER; - front_cells=g_slist_append(front_cells,(gpointer)right); + front_cells=g_slist_append(front_cells,GINT_TO_POINTER(right)); break; case IN: d=d|8; diff --git a/plug-ins/script-fu/interp_regex.c b/plug-ins/script-fu/interp_regex.c index 63e93195da..b6bfde039b 100644 --- a/plug-ins/script-fu/interp_regex.c +++ b/plug-ins/script-fu/interp_regex.c @@ -141,7 +141,7 @@ regex_prin1 (LISP ptr, struct gen_printio *f) char buffer[256]; regex_t *p; p = get_tc_regex (ptr)->r; - sprintf (buffer, "#re_nsub); gput_st (f, buffer); gput_st (f, ">"); diff --git a/plug-ins/script-fu/interp_sliba.c b/plug-ins/script-fu/interp_sliba.c index 638f02b471..216bfde54d 100644 --- a/plug-ins/script-fu/interp_sliba.c +++ b/plug-ins/script-fu/interp_sliba.c @@ -1489,19 +1489,19 @@ number2string (LISP x, LISP b, LISP w, LISP p) if ((width >= 0) && (prec >= 0)) sprintf (format, - NULLP (b) ? "%%%d.%dg" : - EQ (sym_e, b) ? "%%%d.%dd" : "%%%d.%df", + NULLP (b) ? "%%%ld.%ldg" : + EQ (sym_e, b) ? "%%%ld.%ldd" : "%%%ld.%ldf", width, prec); else if (width >= 0) sprintf (format, - NULLP (b) ? "%%%dg" : EQ (sym_e, b) ? "%%%de" : "%%%df", + NULLP (b) ? "%%%ldg" : EQ (sym_e, b) ? "%%%lde" : "%%%ldf", width); else if (prec >= 0) sprintf (format, - NULLP (b) ? "%%.%dg" : EQ (sym_e, b) ? "%%.%de" : "%%.%df", + NULLP (b) ? "%%.%ldg" : EQ (sym_e, b) ? "%%.%lde" : "%%.%ldf", prec); else - sprintf (format, NULLP (b) ? "%g" : EQ (sym_e, b) ? "%e" : "%f"); + sprintf (format, NULLP (b) ? "%%g" : EQ (sym_e, b) ? "%%e" : "%%f"); g_ascii_formatd (buffer, sizeof(buffer), format, y); } @@ -1510,7 +1510,7 @@ number2string (LISP x, LISP b, LISP w, LISP p) if (width >= 0) sprintf (buffer, (base == 10) ? "%0*ld" : (base == 8) ? "%0*lo" : "%0*lX", - width, + (int) width, (long) y); else sprintf (buffer, @@ -2304,7 +2304,7 @@ fast_save (LISP fname, LISP forms, LISP nohash, LISP comment) sprintf (msgbuff, "# Siod Binary Object Save File\n"); fput_st (f, msgbuff); sprintf (msgbuff, "# sizeof(long) = %d\n# sizeof(double) = %d\n", - sizeof (long), sizeof (double)); + (int) sizeof (long), (int) sizeof (double)); fput_st (f, msgbuff); shexstr (databuff, &l_one, sizeof (l_one)); sprintf (msgbuff, "# 1 = %s\n", databuff); diff --git a/plug-ins/script-fu/script-fu-console.c b/plug-ins/script-fu/script-fu-console.c index fe8dfdd53d..aca00bd5bf 100644 --- a/plug-ins/script-fu/script-fu-console.c +++ b/plug-ins/script-fu/script-fu-console.c @@ -391,7 +391,7 @@ script_fu_siod_read (GIOChannel *channel, GIOCondition cond, gpointer data) { - gint count; + gsize count; GIOStatus status; GError *error = NULL; GtkTextIter cursor; diff --git a/plug-ins/script-fu/script-fu-server.c b/plug-ins/script-fu/script-fu-server.c index 79c6bcd132..de64d34625 100644 --- a/plug-ins/script-fu/script-fu-server.c +++ b/plug-ins/script-fu/script-fu-server.c @@ -268,7 +268,7 @@ script_fu_server_listen (gint timeout) /* Associate the client address with the socket */ g_hash_table_insert (clientname_ht, - (gpointer) new, + GINT_TO_POINTER (new), g_strdup (inet_ntoa (clientname.sin_addr))); /* server_log ("Server: connect from host %s, port %d.\n", @@ -283,7 +283,7 @@ script_fu_server_listen (gint timeout) if (read_from_client (i) < 0) { /* Disassociate the client address with the socket */ - g_hash_table_remove (clientname_ht, (gpointer) i); + g_hash_table_remove (clientname_ht, GINT_TO_POINTER (i)); /* server_log ("Server: disconnect from host %s, port %d.\n", @@ -490,7 +490,8 @@ read_from_client (gint filedes) queue_length ++; /* Get the client address from the address/socket table */ - clientaddr = g_hash_table_lookup (clientname_ht, (gpointer) cmd->filedes); + clientaddr = g_hash_table_lookup (clientname_ht, + GINT_TO_POINTER (cmd->filedes)); time (&clock); server_log ("Received request #%d from IP address %s: %s on %s," "[Request queue length: %d]", diff --git a/plug-ins/script-fu/siod/regex.c b/plug-ins/script-fu/siod/regex.c index 63e93195da..b6bfde039b 100644 --- a/plug-ins/script-fu/siod/regex.c +++ b/plug-ins/script-fu/siod/regex.c @@ -141,7 +141,7 @@ regex_prin1 (LISP ptr, struct gen_printio *f) char buffer[256]; regex_t *p; p = get_tc_regex (ptr)->r; - sprintf (buffer, "#re_nsub); gput_st (f, buffer); gput_st (f, ">"); diff --git a/plug-ins/script-fu/siod/sliba.c b/plug-ins/script-fu/siod/sliba.c index 638f02b471..216bfde54d 100644 --- a/plug-ins/script-fu/siod/sliba.c +++ b/plug-ins/script-fu/siod/sliba.c @@ -1489,19 +1489,19 @@ number2string (LISP x, LISP b, LISP w, LISP p) if ((width >= 0) && (prec >= 0)) sprintf (format, - NULLP (b) ? "%%%d.%dg" : - EQ (sym_e, b) ? "%%%d.%dd" : "%%%d.%df", + NULLP (b) ? "%%%ld.%ldg" : + EQ (sym_e, b) ? "%%%ld.%ldd" : "%%%ld.%ldf", width, prec); else if (width >= 0) sprintf (format, - NULLP (b) ? "%%%dg" : EQ (sym_e, b) ? "%%%de" : "%%%df", + NULLP (b) ? "%%%ldg" : EQ (sym_e, b) ? "%%%lde" : "%%%ldf", width); else if (prec >= 0) sprintf (format, - NULLP (b) ? "%%.%dg" : EQ (sym_e, b) ? "%%.%de" : "%%.%df", + NULLP (b) ? "%%.%ldg" : EQ (sym_e, b) ? "%%.%lde" : "%%.%ldf", prec); else - sprintf (format, NULLP (b) ? "%g" : EQ (sym_e, b) ? "%e" : "%f"); + sprintf (format, NULLP (b) ? "%%g" : EQ (sym_e, b) ? "%%e" : "%%f"); g_ascii_formatd (buffer, sizeof(buffer), format, y); } @@ -1510,7 +1510,7 @@ number2string (LISP x, LISP b, LISP w, LISP p) if (width >= 0) sprintf (buffer, (base == 10) ? "%0*ld" : (base == 8) ? "%0*lo" : "%0*lX", - width, + (int) width, (long) y); else sprintf (buffer, @@ -2304,7 +2304,7 @@ fast_save (LISP fname, LISP forms, LISP nohash, LISP comment) sprintf (msgbuff, "# Siod Binary Object Save File\n"); fput_st (f, msgbuff); sprintf (msgbuff, "# sizeof(long) = %d\n# sizeof(double) = %d\n", - sizeof (long), sizeof (double)); + (int) sizeof (long), (int) sizeof (double)); fput_st (f, msgbuff); shexstr (databuff, &l_one, sizeof (l_one)); sprintf (msgbuff, "# 1 = %s\n", databuff); diff --git a/plug-ins/tools/tool-safe-mode-plug-in.c b/plug-ins/tools/tool-safe-mode-plug-in.c index 6c9e3948b6..cf68b7a0ef 100644 --- a/plug-ins/tools/tool-safe-mode-plug-in.c +++ b/plug-ins/tools/tool-safe-mode-plug-in.c @@ -20,6 +20,8 @@ #include "config.h" +#include + #include #include diff --git a/plug-ins/webbrowser/webbrowser.c b/plug-ins/webbrowser/webbrowser.c index 9033bac19c..125af18382 100644 --- a/plug-ins/webbrowser/webbrowser.c +++ b/plug-ins/webbrowser/webbrowser.c @@ -369,7 +369,7 @@ new_window_callback (GtkWidget *widget, { if (GTK_TOGGLE_BUTTON (widget)->active) { - url_info.new_window = (gint) data; + url_info.new_window = GPOINTER_TO_INT (data); } }