diff --git a/ChangeLog b/ChangeLog index 9afa6db2d4..302575d1d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-07-17 Sven Neumann + + * plug-ins/common/nlfilt.c + * plug-ins/common/pat.c + * plug-ins/common/svg.c + * plug-ins/common/tiff.c + * plug-ins/common/tile.c + * plug-ins/common/uniteditor.c + * plug-ins/common/wmf.c: fixed signedness warnings. + 2005-07-17 Sven Neumann * app/widgets/gimpdnd-xds.c: added missing casts. diff --git a/plug-ins/common/nlfilt.c b/plug-ins/common/nlfilt.c index b996c15e52..63841a129f 100644 --- a/plug-ins/common/nlfilt.c +++ b/plug-ins/common/nlfilt.c @@ -904,7 +904,7 @@ nlfilter (GimpDrawable *drawable, guchar *srcbuf, *dstbuf; guchar *lastrow, *thisrow, *nextrow, *temprow; gint x1, x2, y1, y2; - guint width, height, bpp; + gint width, height, bpp; gint filtno, y, rowsize, exrowsize, p_update; if (preview) @@ -920,6 +920,7 @@ nlfilter (GimpDrawable *drawable, width = x2 - x1; height = y2 - y1; } + bpp = drawable->bpp; rowsize = width * bpp; diff --git a/plug-ins/common/pat.c b/plug-ins/common/pat.c index 1f2fcc6867..787f129e0e 100644 --- a/plug-ins/common/pat.c +++ b/plug-ins/common/pat.c @@ -125,7 +125,8 @@ query (void) load_args, load_return_vals); gimp_plugin_icon_register ("file_pat_load", - GIMP_ICON_TYPE_STOCK_ID, GIMP_STOCK_PATTERN); + GIMP_ICON_TYPE_STOCK_ID, + (const guchar *) GIMP_STOCK_PATTERN); gimp_register_file_handler_mime ("file_pat_load", "image/x-gimp-pat"); gimp_register_magic_load_handler ("file_pat_load", "pat", @@ -146,7 +147,8 @@ query (void) save_args, NULL); gimp_plugin_icon_register ("file_pat_save", - GIMP_ICON_TYPE_STOCK_ID, GIMP_STOCK_PATTERN); + GIMP_ICON_TYPE_STOCK_ID, + (const guchar *) GIMP_STOCK_PATTERN); gimp_register_file_handler_mime ("file_pat_save", "image/x-gimp-pat"); gimp_register_save_handler ("file_pat_save", "pat", ""); } diff --git a/plug-ins/common/svg.c b/plug-ins/common/svg.c index 0f7a7d98ca..45c27f7ee5 100644 --- a/plug-ins/common/svg.c +++ b/plug-ins/common/svg.c @@ -294,7 +294,7 @@ load_image (const gchar *filename) GimpDrawable *drawable; GimpPixelRgn rgn; GdkPixbuf *pixbuf; - gchar *pixels; + guchar *pixels; gint width; gint height; gint rowstride; @@ -439,7 +439,7 @@ load_rsvg_pixbuf (const gchar *filename, while (success && status != G_IO_STATUS_EOF) { - guchar buf[8192]; + gchar buf[8192]; gsize len; status = g_io_channel_read_chars (io, buf, sizeof (buf), &len, error); @@ -453,7 +453,8 @@ load_rsvg_pixbuf (const gchar *filename, success = rsvg_handle_close (handle, error); break; case G_IO_STATUS_NORMAL: - success = rsvg_handle_write (handle, buf, len, error); + success = rsvg_handle_write (handle, + (const guchar *) buf, len, error); break; case G_IO_STATUS_AGAIN: break; @@ -535,7 +536,7 @@ load_rsvg_size (const gchar *filename, while (success && status != G_IO_STATUS_EOF && vals->resolution > 0.0) { - guchar buf[1024]; + gchar buf[1024]; gsize len; status = g_io_channel_read_chars (io, buf, sizeof (buf), &len, error); @@ -549,7 +550,8 @@ load_rsvg_size (const gchar *filename, success = rsvg_handle_close (handle, error); break; case G_IO_STATUS_NORMAL: - success = rsvg_handle_write (handle, buf, len, error); + success = rsvg_handle_write (handle, + (const guchar *) buf, len, error); break; case G_IO_STATUS_AGAIN: break; diff --git a/plug-ins/common/tiff.c b/plug-ins/common/tiff.c index dc2268fbca..00a9f919ba 100644 --- a/plug-ins/common/tiff.c +++ b/plug-ins/common/tiff.c @@ -502,6 +502,8 @@ load_image (const gchar *filename) GimpParasite *parasite; guint16 tmp; + gchar *name; + gboolean flip_horizontal = FALSE; gboolean flip_vertical = FALSE; @@ -510,10 +512,6 @@ load_image (const gchar *filename) guchar *icc_profile; #endif - gboolean uselayername = FALSE; - guchar *tmp_name; - gchar *name; - gimp_rgb_set (&color, 0.0, 0.0, 0.0); @@ -865,29 +863,17 @@ load_image (const gchar *filename) channel = g_new0 (channel_data, extra + 1); /* try and use layer name from tiff file */ - name = NULL; - uselayername = FALSE; - - if (TIFFGetField (tif, TIFFTAG_PAGENAME, &name)) + if (! TIFFGetField (tif, TIFFTAG_PAGENAME, &name) || + ! g_utf8_validate (name, -1, NULL)) { - tmp_name = name; - uselayername = TRUE; - for (tmp_name = name ; *tmp_name ; tmp_name++) - { - if (*tmp_name > 127) - { - uselayername = FALSE; - break; - } - } + name = NULL; } - if (uselayername) + if (name) { layer = gimp_layer_new (image, name, cols, rows, layer_type, 100, GIMP_NORMAL_MODE); - name = NULL; } else { diff --git a/plug-ins/common/tile.c b/plug-ins/common/tile.c index a6b1b08d9e..0ce1b663fb 100644 --- a/plug-ins/common/tile.c +++ b/plug-ins/common/tile.c @@ -124,8 +124,8 @@ run (const gchar *name, { static GimpParam values[3]; GimpRunMode run_mode; - GimpPDBStatusType status = GIMP_PDB_SUCCESS; - gint32 new_layer; + GimpPDBStatusType status = GIMP_PDB_SUCCESS; + gint32 new_layer = -1; gint width; gint height; diff --git a/plug-ins/common/uniteditor.c b/plug-ins/common/uniteditor.c index 141a32ff82..bde1f863c9 100644 --- a/plug-ins/common/uniteditor.c +++ b/plug-ins/common/uniteditor.c @@ -155,7 +155,8 @@ query (void) gimp_plugin_menu_register ("plug_in_unit_editor", "/Xtns/Extensions"); gimp_plugin_icon_register ("plug_in_unit_editor", - GIMP_ICON_TYPE_STOCK_ID, GIMP_STOCK_TOOL_MEASURE); + GIMP_ICON_TYPE_STOCK_ID, + (const guchar *) GIMP_STOCK_TOOL_MEASURE); } static void diff --git a/plug-ins/common/wmf.c b/plug-ins/common/wmf.c index 2e56886956..38ce76d834 100644 --- a/plug-ins/common/wmf.c +++ b/plug-ins/common/wmf.c @@ -66,8 +66,8 @@ static guchar *wmf_get_pixbuf (const gchar *filename, gint *width, gint *height); static guchar *wmf_load_file (const gchar *filename, - gint *width, - gint *height); + guint *width, + guint *height); GimpPlugInInfo PLUG_IN_INFO = { @@ -291,8 +291,8 @@ load_wmf_size (const gchar *filename, wmfAPI *API = NULL; wmfAPI_Options api_options; wmfD_Rect bbox; - gint width; - gint height; + guint width; + guint height; gboolean success = TRUE; width = height = -1; @@ -757,8 +757,8 @@ wmf_get_pixbuf (const gchar *filename, wmf_gd_t *ddata = NULL; wmfAPI *API = NULL; wmfAPI_Options api_options; - gint file_width; - gint file_height; + guint file_width; + guint file_height; wmfD_Rect bbox; gint *gd_pixels = NULL; @@ -847,8 +847,8 @@ wmf_get_pixbuf (const gchar *filename, static guchar * wmf_load_file (const gchar *filename, - gint *width, - gint *height) + guint *width, + guint *height) { guchar *pixels = NULL; @@ -935,7 +935,7 @@ load_image (const gchar *filename) gint i, rowstride; guchar *pixels, *buf; - gint width, height; + guint width, height; pixels = buf = wmf_load_file (filename, &width, &height); rowstride = width * 4;