Commit d4250cb4 authored by Sven Neumann's avatar Sven Neumann

please picky compilers


--Sven
parent 8e950e6a
Mon Dec 6 23:39:34 MET 1999 Sven Neumann <sven@gimp.org>
* app/channel.c
* app/channel.h
* app/gimpbrushpipe.c
* app/gradient.c
* app/nav_window.c
* app/paint_funcs.c
* app/palette.c
* app/paths_dialog.c
* app/patterns.c
* app/tools.c
* app/tools.h
* libgimp/gimp.c
* libgimp/gimpcolorbutton.c
* libgimp/gimpdrawable.c
* libgimp/gimpfileselection.c
* libgimp/gimpimage.c
* libgimp/gimppatheditor.c
* libgimp/gimpsizeentry.c
* libgimp/gimpunitmenu.c
* libgimp/gimpwire.c
* libgimp/parasiteio.c
* plug-ins/script-fu/script-fu-server.c: fixed lots of wrongly typed
variables that made picky compilers complain (still some left...)
1999-12-06 Tuomas Kuosmanen <tigert@gimp.org>
* pixmaps/anchor.xpm: The Smaller Anchor Icon. Still a bit unpolished,
......
......@@ -237,7 +237,7 @@ channel_get_name (Channel *channel)
void
channel_set_color (Channel *channel,
gchar *color)
guchar *color)
{
gint i;
......@@ -248,7 +248,7 @@ channel_set_color (Channel *channel,
}
}
gchar *
guchar *
channel_get_color (Channel *channel)
{
return (GIMP_CHANNEL (channel)->col);
......
......@@ -83,8 +83,8 @@ void channel_set_name (Channel *, gchar *);
gint channel_get_opacity (Channel *);
void channel_set_opacity (Channel *, gint);
gchar * channel_get_color (Channel *);
void channel_set_color (Channel *, gchar *);
guchar * channel_get_color (Channel *);
void channel_set_color (Channel *, guchar *);
Channel * channel_get_ID (gint);
void channel_delete (Channel *);
......
......@@ -275,8 +275,8 @@ gimp_brush_pipe_load (char *filename)
GPattern *pattern;
PixPipeParams params;
FILE *fp;
guchar buf[1024];
guchar *name;
gchar buf[1024];
gchar *name;
int i;
int num_of_brushes;
int totalcells;
......
......@@ -275,8 +275,8 @@ gimp_brush_pipe_load (char *filename)
GPattern *pattern;
PixPipeParams params;
FILE *fp;
guchar buf[1024];
guchar *name;
gchar buf[1024];
gchar *name;
int i;
int num_of_brushes;
int totalcells;
......
......@@ -237,7 +237,7 @@ channel_get_name (Channel *channel)
void
channel_set_color (Channel *channel,
gchar *color)
guchar *color)
{
gint i;
......@@ -248,7 +248,7 @@ channel_set_color (Channel *channel,
}
}
gchar *
guchar *
channel_get_color (Channel *channel)
{
return (GIMP_CHANNEL (channel)->col);
......
......@@ -83,8 +83,8 @@ void channel_set_name (Channel *, gchar *);
gint channel_get_opacity (Channel *);
void channel_set_opacity (Channel *, gint);
gchar * channel_get_color (Channel *);
void channel_set_color (Channel *, gchar *);
guchar * channel_get_color (Channel *);
void channel_set_color (Channel *, guchar *);
Channel * channel_get_ID (gint);
void channel_delete (Channel *);
......
......@@ -237,7 +237,7 @@ channel_get_name (Channel *channel)
void
channel_set_color (Channel *channel,
gchar *color)
guchar *color)
{
gint i;
......@@ -248,7 +248,7 @@ channel_set_color (Channel *channel,
}
}
gchar *
guchar *
channel_get_color (Channel *channel)
{
return (GIMP_CHANNEL (channel)->col);
......
......@@ -83,8 +83,8 @@ void channel_set_name (Channel *, gchar *);
gint channel_get_opacity (Channel *);
void channel_set_opacity (Channel *, gint);
gchar * channel_get_color (Channel *);
void channel_set_color (Channel *, gchar *);
guchar * channel_get_color (Channel *);
void channel_set_color (Channel *, guchar *);
Channel * channel_get_ID (gint);
void channel_delete (Channel *);
......
......@@ -490,12 +490,12 @@ nav_window_update_preview (NavWinData *iwd)
pwidth = iwd->pwidth;
pheight = iwd->pheight;
src = (gchar *) temp_buf_data (preview_buf_notdot);
src = (guchar *) temp_buf_data (preview_buf_notdot);
preview_buf_ptr = preview_buf_notdot;
}
else
{
src = (gchar *) temp_buf_data (preview_buf);
src = (guchar *) temp_buf_data (preview_buf);
preview_buf_ptr = preview_buf;
}
......
......@@ -490,12 +490,12 @@ nav_window_update_preview (NavWinData *iwd)
pwidth = iwd->pwidth;
pheight = iwd->pheight;
src = (gchar *) temp_buf_data (preview_buf_notdot);
src = (guchar *) temp_buf_data (preview_buf_notdot);
preview_buf_ptr = preview_buf_notdot;
}
else
{
src = (gchar *) temp_buf_data (preview_buf);
src = (guchar *) temp_buf_data (preview_buf);
preview_buf_ptr = preview_buf;
}
......
......@@ -275,8 +275,8 @@ gimp_brush_pipe_load (char *filename)
GPattern *pattern;
PixPipeParams params;
FILE *fp;
guchar buf[1024];
guchar *name;
gchar buf[1024];
gchar *name;
int i;
int num_of_brushes;
int totalcells;
......
......@@ -237,7 +237,7 @@ channel_get_name (Channel *channel)
void
channel_set_color (Channel *channel,
gchar *color)
guchar *color)
{
gint i;
......@@ -248,7 +248,7 @@ channel_set_color (Channel *channel,
}
}
gchar *
guchar *
channel_get_color (Channel *channel)
{
return (GIMP_CHANNEL (channel)->col);
......
......@@ -83,8 +83,8 @@ void channel_set_name (Channel *, gchar *);
gint channel_get_opacity (Channel *);
void channel_set_opacity (Channel *, gint);
gchar * channel_get_color (Channel *);
void channel_set_color (Channel *, gchar *);
guchar * channel_get_color (Channel *);
void channel_set_color (Channel *, guchar *);
Channel * channel_get_ID (gint);
void channel_delete (Channel *);
......
......@@ -1456,7 +1456,7 @@ gradient_clist_draw_small_preview (GdkGC *gc,
gradient_t *gradient,
gint pos)
{
gchar rgb_buf[48 * 16 * 3];
guchar rgb_buf[48 * 16 * 3];
gradient_clist_fill_preview (gradient, rgb_buf, 48, 16, 0.0, 1.0);
......
......@@ -1456,7 +1456,7 @@ gradient_clist_draw_small_preview (GdkGC *gc,
gradient_t *gradient,
gint pos)
{
gchar rgb_buf[48 * 16 * 3];
guchar rgb_buf[48 * 16 * 3];
gradient_clist_fill_preview (gradient, rgb_buf, 48, 16, 0.0, 1.0);
......
......@@ -1456,7 +1456,7 @@ gradient_clist_draw_small_preview (GdkGC *gc,
gradient_t *gradient,
gint pos)
{
gchar rgb_buf[48 * 16 * 3];
guchar rgb_buf[48 * 16 * 3];
gradient_clist_fill_preview (gradient, rgb_buf, 48, 16, 0.0, 1.0);
......
......@@ -2914,7 +2914,7 @@ palette_import_image_make_palette (GHashTable *h_array,
static void
palette_import_create_from_image (GImage *gimage,
guchar *pname)
gchar *pname)
{
PixelRegion imagePR;
guchar *image_data;
......@@ -2995,7 +2995,7 @@ palette_import_create_from_image (GImage *gimage,
static void
palette_import_create_from_indexed (GImage *gimage,
guchar *pname)
gchar *pname)
{
PaletteEntries *entries;
gint samples, count;
......@@ -3042,7 +3042,7 @@ palette_import_import_callback (GtkWidget *widget,
if (import_dialog)
{
guchar *pname;
gchar *pname;
pname = gtk_entry_get_text (GTK_ENTRY (import_dialog->entry));
if (!pname || !strlen (pname))
......
......@@ -738,14 +738,14 @@ paths_set_dash_line (GdkGC *gc,
static void
clear_pixmap_preview (PathWidget *pwidget)
{
gchar *rgb_buf;
guchar *rgb_buf;
rgb_buf = g_new0(gchar,
(paths_dialog->image_width + 4)
*(paths_dialog->image_height + 4)*3);
rgb_buf = g_new0 (guchar,
(paths_dialog->image_width + 4)
*(paths_dialog->image_height + 4) * 3);
memset(rgb_buf,0xFF,(paths_dialog->image_width + 4)
*(paths_dialog->image_height + 4)*3);
memset (rgb_buf,0xFF,(paths_dialog->image_width + 4)
*(paths_dialog->image_height + 4) * 3);
gdk_draw_rgb_image (pwidget->paths_pixmap,
paths_dialog->gc,
......
......@@ -490,12 +490,12 @@ nav_window_update_preview (NavWinData *iwd)
pwidth = iwd->pwidth;
pheight = iwd->pheight;
src = (gchar *) temp_buf_data (preview_buf_notdot);
src = (guchar *) temp_buf_data (preview_buf_notdot);
preview_buf_ptr = preview_buf_notdot;
}
else
{
src = (gchar *) temp_buf_data (preview_buf);
src = (guchar *) temp_buf_data (preview_buf);
preview_buf_ptr = preview_buf;
}
......
......@@ -3983,8 +3983,8 @@ scale_region (PixelRegion *srcPR,
PixelRegion *destPR)
{
double *src[4];
unsigned char * src_tmp;
unsigned char * dest;
guchar * src_tmp;
guchar * dest;
double * row, *accum;
int bytes, b;
int width, height;
......@@ -4015,10 +4015,10 @@ scale_region (PixelRegion *srcPR,
/* the data pointers... */
for (i = 0; i < 4; i++)
src[i] = g_new(double, (width) * bytes);
dest = g_new(guchar, width * bytes);
src[i] = g_new (double, (width) * bytes);
dest = g_new (guchar, width * bytes);
src_tmp = g_new(char, orig_width * bytes);
src_tmp = g_new (guchar, orig_width * bytes);
/* offset the row pointer by 2*bytes so the range of the array
is [-2*bytes] to [(orig_width + 2)*bytes] */
......
......@@ -3983,8 +3983,8 @@ scale_region (PixelRegion *srcPR,
PixelRegion *destPR)
{
double *src[4];
unsigned char * src_tmp;
unsigned char * dest;
guchar * src_tmp;
guchar * dest;
double * row, *accum;
int bytes, b;
int width, height;
......@@ -4015,10 +4015,10 @@ scale_region (PixelRegion *srcPR,
/* the data pointers... */
for (i = 0; i < 4; i++)
src[i] = g_new(double, (width) * bytes);
dest = g_new(guchar, width * bytes);
src[i] = g_new (double, (width) * bytes);
dest = g_new (guchar, width * bytes);
src_tmp = g_new(char, orig_width * bytes);
src_tmp = g_new (guchar, orig_width * bytes);
/* offset the row pointer by 2*bytes so the range of the array
is [-2*bytes] to [(orig_width + 2)*bytes] */
......
......@@ -2914,7 +2914,7 @@ palette_import_image_make_palette (GHashTable *h_array,
static void
palette_import_create_from_image (GImage *gimage,
guchar *pname)
gchar *pname)
{
PixelRegion imagePR;
guchar *image_data;
......@@ -2995,7 +2995,7 @@ palette_import_create_from_image (GImage *gimage,
static void
palette_import_create_from_indexed (GImage *gimage,
guchar *pname)
gchar *pname)
{
PaletteEntries *entries;
gint samples, count;
......@@ -3042,7 +3042,7 @@ palette_import_import_callback (GtkWidget *widget,
if (import_dialog)
{
guchar *pname;
gchar *pname;
pname = gtk_entry_get_text (GTK_ENTRY (import_dialog->entry));
if (!pname || !strlen (pname))
......
......@@ -738,14 +738,14 @@ paths_set_dash_line (GdkGC *gc,
static void
clear_pixmap_preview (PathWidget *pwidget)
{
gchar *rgb_buf;
guchar *rgb_buf;
rgb_buf = g_new0(gchar,
(paths_dialog->image_width + 4)
*(paths_dialog->image_height + 4)*3);
rgb_buf = g_new0 (guchar,
(paths_dialog->image_width + 4)
*(paths_dialog->image_height + 4) * 3);
memset(rgb_buf,0xFF,(paths_dialog->image_width + 4)
*(paths_dialog->image_height + 4)*3);
memset (rgb_buf,0xFF,(paths_dialog->image_width + 4)
*(paths_dialog->image_height + 4) * 3);
gdk_draw_rgb_image (pwidget->paths_pixmap,
paths_dialog->gc,
......
......@@ -108,7 +108,8 @@ patterns_get_standard_pattern (void)
for (row = 0; row < standard_pattern->mask->height; row++)
for (col = 0; col < standard_pattern->mask->width; col++)
{
*data++ = *data++ = *data++ = (col % 2) && (row % 2) ? 255 : 0;
memset (data, (col % 2) && (row % 2) ? 255 : 0, 3);
data += 3;
}
}
......
......@@ -1151,10 +1151,10 @@ tool_options_reset_callback (GtkWidget *widget,
(* tool_info[(gint) active_tool->type].tool_options->reset_func) ();
}
guchar *
gchar *
tool_active_PDB_string (void)
{
guchar *toolStr = "gimp_paintbrush_default";
gchar *toolStr = "gimp_paintbrush_default";
/* Return the correct PDB function for the active tool
* The default is paintbrush if the tool is not recognised
......@@ -1195,3 +1195,7 @@ tool_active_PDB_string (void)
return toolStr;
}
......@@ -119,6 +119,6 @@ void tool_options_dialog_new (void);
void tool_options_dialog_show (void);
void tool_options_dialog_free (void);
guchar * tool_active_PDB_string (void);
gchar * tool_active_PDB_string (void);
#endif /* __TOOLS_H__ */
......@@ -1151,10 +1151,10 @@ tool_options_reset_callback (GtkWidget *widget,
(* tool_info[(gint) active_tool->type].tool_options->reset_func) ();
}
guchar *
gchar *
tool_active_PDB_string (void)
{
guchar *toolStr = "gimp_paintbrush_default";
gchar *toolStr = "gimp_paintbrush_default";
/* Return the correct PDB function for the active tool
* The default is paintbrush if the tool is not recognised
......@@ -1195,3 +1195,7 @@ tool_active_PDB_string (void)
return toolStr;
}
......@@ -119,6 +119,6 @@ void tool_options_dialog_new (void);
void tool_options_dialog_show (void);
void tool_options_dialog_free (void);
guchar * tool_active_PDB_string (void);
gchar * tool_active_PDB_string (void);
#endif /* __TOOLS_H__ */
......@@ -1456,7 +1456,7 @@ gradient_clist_draw_small_preview (GdkGC *gc,
gradient_t *gradient,
gint pos)
{
gchar rgb_buf[48 * 16 * 3];
guchar rgb_buf[48 * 16 * 3];
gradient_clist_fill_preview (gradient, rgb_buf, 48, 16, 0.0, 1.0);
......
......@@ -2914,7 +2914,7 @@ palette_import_image_make_palette (GHashTable *h_array,
static void
palette_import_create_from_image (GImage *gimage,
guchar *pname)
gchar *pname)
{
PixelRegion imagePR;
guchar *image_data;
......@@ -2995,7 +2995,7 @@ palette_import_create_from_image (GImage *gimage,
static void
palette_import_create_from_indexed (GImage *gimage,
guchar *pname)
gchar *pname)
{
PaletteEntries *entries;
gint samples, count;
......@@ -3042,7 +3042,7 @@ palette_import_import_callback (GtkWidget *widget,
if (import_dialog)
{
guchar *pname;
gchar *pname;
pname = gtk_entry_get_text (GTK_ENTRY (import_dialog->entry));
if (!pname || !strlen (pname))
......
......@@ -1211,8 +1211,8 @@ static int
gimp_flush (GIOChannel *channel)
{
GIOError error;
int count;
int bytes;
guint count;
guint bytes;
if (write_buffer_index > 0)
{
......
......@@ -112,7 +112,7 @@ enum {
LAST_SIGNAL
};
static gint gimp_color_button_signals[LAST_SIGNAL] = { 0 };
static guint gimp_color_button_signals[LAST_SIGNAL] = { 0 };
static GtkWidgetClass *parent_class = NULL;
......
......@@ -664,7 +664,7 @@ gimp_drawable_get_thumbnail_data (gint32 drawable_ID,
{
GParam *return_vals;
int nreturn_vals;
gchar *drawable_data = NULL;
guchar *drawable_data = NULL;
return_vals = gimp_run_procedure ("gimp_drawable_thumbnail",
&nreturn_vals,
......@@ -678,14 +678,13 @@ gimp_drawable_get_thumbnail_data (gint32 drawable_ID,
*width = return_vals[1].data.d_int32;
*height = return_vals[2].data.d_int32;
*bytes = return_vals[3].data.d_int32;
drawable_data = g_new (gchar,return_vals[4].data.d_int32);
g_memmove (drawable_data, return_vals[5].data.d_int32array,return_vals[4].data.d_int32);
drawable_data = g_new (guchar, return_vals[4].data.d_int32);
g_memmove (drawable_data, return_vals[5].data.d_int32array, return_vals[4].data.d_int32);
}
gimp_destroy_params (return_vals, nreturn_vals);
return drawable_data;
}
......@@ -664,7 +664,7 @@ gimp_drawable_get_thumbnail_data (gint32 drawable_ID,
{
GParam *return_vals;
int nreturn_vals;
gchar *drawable_data = NULL;
guchar *drawable_data = NULL;
return_vals = gimp_run_procedure ("gimp_drawable_thumbnail",
&nreturn_vals,
......@@ -678,14 +678,13 @@ gimp_drawable_get_thumbnail_data (gint32 drawable_ID,
*width = return_vals[1].data.d_int32;
*height = return_vals[2].data.d_int32;
*bytes = return_vals[3].data.d_int32;
drawable_data = g_new (gchar,return_vals[4].data.d_int32);
g_memmove (drawable_data, return_vals[5].data.d_int32array,return_vals[4].data.d_int32);
drawable_data = g_new (guchar, return_vals[4].data.d_int32);
g_memmove (drawable_data, return_vals[5].data.d_int32array, return_vals[4].data.d_int32);
}
gimp_destroy_params (return_vals, nreturn_vals);
return drawable_data;
}
......@@ -62,7 +62,7 @@ enum
LAST_SIGNAL
};
static gint gimp_file_selection_signals[LAST_SIGNAL] = { 0 };
static guint gimp_file_selection_signals[LAST_SIGNAL] = { 0 };
static GtkHBoxClass *parent_class = NULL;
......
......@@ -1198,7 +1198,7 @@ gimp_image_get_thumbnail_data (gint32 image_ID,
{
GParam *return_vals;
int nreturn_vals;
gchar *image_data = NULL;
guchar *image_data = NULL;
return_vals = gimp_run_procedure ("gimp_image_thumbnail",
&nreturn_vals,
......@@ -1212,8 +1212,8 @@ gimp_image_get_thumbnail_data (gint32 image_ID,
*width = return_vals[1].data.d_int32;
*height = return_vals[2].data.d_int32;
*bytes = return_vals[3].data.d_int32;
image_data = g_new (gchar,return_vals[4].data.d_int32);
g_memmove (image_data, return_vals[5].data.d_int32array,return_vals[4].data.d_int32);
image_data = g_new (guchar, return_vals[4].data.d_int32);
g_memmove (image_data, return_vals[5].data.d_int32array, return_vals[4].data.d_int32);
}
gimp_destroy_params (return_vals, nreturn_vals);
......
......@@ -1198,7 +1198,7 @@ gimp_image_get_thumbnail_data (gint32 image_ID,
{
GParam *return_vals;
int nreturn_vals;
gchar *image_data = NULL;
guchar *image_data = NULL;
return_vals = gimp_run_procedure ("gimp_image_thumbnail",
&nreturn_vals,
......@@ -1212,8 +1212,8 @@ gimp_image_get_thumbnail_data (gint32 image_ID,
*width = return_vals[1].data.d_int32;
*height = return_vals[2].data.d_int32;
*bytes = return_vals[3].data.d_int32;
image_data = g_new (gchar,return_vals[4].data.d_int32);
g_memmove (image_data, return_vals[5].data.d_int32array,return_vals[4].data.d_int32);
image_data = g_new (guchar, return_vals[4].data.d_int32);
g_memmove (image_data, return_vals[5].data.d_int32array, return_vals[4].data.d_int32);
}
gimp_destroy_params (return_vals, nreturn_vals);
......
......@@ -56,7 +56,7 @@ void
pixpipeparams_parse (gchar *string,
PixPipeParams *params)
{
guchar *p, *q, *r; /* Don't you love single-char identifiers? */
gchar *p, *q, *r; /* Don't you love single-char identifiers? */
gint i; /* No, we don't!! <Sven> */
q = string;
......
......@@ -52,7 +52,7 @@ enum
LAST_SIGNAL
};
static gint gimp_path_editor_signals[LAST_SIGNAL] = { 0 };
static guint gimp_path_editor_signals[LAST_SIGNAL] = { 0 };
static GtkVBoxClass *parent_class = NULL;
......
......@@ -67,7 +67,7 @@ struct _GimpSizeEntryField
gint stop_recursion;
};
static gint gimp_size_entry_signals[LAST_SIGNAL] = { 0 };
static guint gimp_size_entry_signals[LAST_SIGNAL] = { 0 };
static GtkTableClass *parent_class = NULL;
......
......@@ -37,7 +37,7 @@ enum
LAST_SIGNAL
};
static gint gimp_unit_menu_signals[LAST_SIGNAL] = { 0 };
static guint gimp_unit_menu_signals[LAST_SIGNAL] = { 0 };
static GtkOptionMenuClass *parent_class = NULL;
......
......@@ -121,7 +121,7 @@ wire_read (GIOChannel *channel,
else
{
GIOError error;
int bytes;
guint bytes;
while (count > 0)
{
......@@ -169,7 +169,7 @@ wire_write (GIOChannel *channel,
else
{
GIOError error;
int bytes;
guint bytes;
while (count > 0)
{
......
......@@ -56,7 +56,7 @@ void
pixpipeparams_parse (gchar *string,
PixPipeParams *params)
{
guchar *p, *q, *r; /* Don't you love single-char identifiers? */
gchar *p, *q, *r; /* Don't you love single-char identifiers? */
gint i; /* No, we don't!! <Sven> */
q = string;
......
......@@ -56,7 +56,7 @@ void
pixpipeparams_parse (gchar *string,
PixPipeParams *params)
{
guchar *p, *q, *r; /* Don't you love single-char identifiers? */
gchar *p, *q, *r; /* Don't you love single-char identifiers? */
gint i; /* No, we don't!! <Sven> */
q = string;
......
......@@ -121,7 +121,7 @@ wire_read (GIOChannel *channel,