diff --git a/ChangeLog b/ChangeLog index 4eee9df130..bb7b2a8cd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Oct 24 22:42:10 PDT 1998 Manish Singh + + * applied gimp-joke-981006-0, portabilty patch + Sat Oct 24 22:05:16 PDT 1998 Manish Singh * configure.in: sinclude by hand to work around automake 1.3 bug diff --git a/app/base/boundary.c b/app/base/boundary.c index 86b8fdea23..1eb9bbf78c 100644 --- a/app/base/boundary.c +++ b/app/base/boundary.c @@ -129,7 +129,7 @@ find_empty_segs (PixelRegion *maskPR, if (tile) tile_release (tile, FALSE); tile = tile_manager_get_tile (maskPR->tiles, x, scanline, TRUE, FALSE); - data = tile_data_pointer (tile, x % TILE_WIDTH, scanline % TILE_HEIGHT) + (tile_bpp(tile) - 1); + data = (unsigned char*)tile_data_pointer (tile, x % TILE_WIDTH, scanline % TILE_HEIGHT) + (tile_bpp(tile) - 1); tilex = x / TILE_WIDTH; } diff --git a/app/base/tile-swap.c b/app/base/tile-swap.c index 777a06f03e..fbff8e511e 100644 --- a/app/base/tile-swap.c +++ b/app/base/tile-swap.c @@ -227,6 +227,7 @@ out: #ifdef USE_PTHREADS pthread_mutex_unlock(&swapfile_mutex); #endif + return; } void @@ -330,6 +331,7 @@ out: #ifdef USE_PTHREADS pthread_mutex_unlock(&swapfile_mutex); #endif + return; } static void diff --git a/app/blob.c b/app/blob.c index b5167d8cb5..1d2c6aaad6 100644 --- a/app/blob.c +++ b/app/blob.c @@ -36,7 +36,7 @@ blob_new (int y, int height) { Blob *result; - result = g_malloc (sizeof (Blob) + sizeof(BlobSpan) * height); + result = g_malloc (sizeof (Blob) + sizeof(BlobSpan) * (height-1)); result->y = y; result->height = height; @@ -46,7 +46,7 @@ blob_new (int y, int height) typedef enum { NONE = 0, LEFT = 1 << 0, - RIGHT = 1 << 1, + RIGHT = 1 << 1 } EdgeType; Blob * diff --git a/app/blob.h b/app/blob.h index 3ef2394420..642d9845fb 100644 --- a/app/blob.h +++ b/app/blob.h @@ -36,7 +36,7 @@ struct _BlobSpan { struct _Blob { int y; int height; - BlobSpan data[0]; /* slightly in violation of ANSI-C? */ + BlobSpan data[1]; }; @@ -44,4 +44,4 @@ Blob *blob_convex_union (Blob *b1, Blob *b2); Blob *blob_ellipse (double xc, double yc, double xp, double yp, double xq, double yq); void blob_bounds(Blob *b, int *x, int *y, int *width, int *height); -#endif __BLOB_H__ +#endif /* __BLOB_H__ */ diff --git a/app/boundary.c b/app/boundary.c index 86b8fdea23..1eb9bbf78c 100644 --- a/app/boundary.c +++ b/app/boundary.c @@ -129,7 +129,7 @@ find_empty_segs (PixelRegion *maskPR, if (tile) tile_release (tile, FALSE); tile = tile_manager_get_tile (maskPR->tiles, x, scanline, TRUE, FALSE); - data = tile_data_pointer (tile, x % TILE_WIDTH, scanline % TILE_HEIGHT) + (tile_bpp(tile) - 1); + data = (unsigned char*)tile_data_pointer (tile, x % TILE_WIDTH, scanline % TILE_HEIGHT) + (tile_bpp(tile) - 1); tilex = x / TILE_WIDTH; } diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 3fe9059c57..7c13ea4eab 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -966,7 +966,7 @@ layer_pick_correlate (layer, x, y) */ tile = tile_manager_get_tile (GIMP_DRAWABLE(layer)->tiles, x, y, TRUE, FALSE); - val = * (unsigned char*) (tile_data_pointer (tile, + val = * ((unsigned char*) tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT) + tile_bpp (tile) - 1); diff --git a/app/devices.c b/app/devices.c index f1c1479b97..f932e190f5 100644 --- a/app/devices.c +++ b/app/devices.c @@ -1146,7 +1146,7 @@ device_update_brush(GimpBrushP brush,int preview_id) static void device_update_pattern(GPatternP pattern,int preview_id) { - gchar *buffer = NULL; + guchar *buffer = NULL; TempBuf * pattern_buf; unsigned char * src, *s = NULL; unsigned char *b; @@ -1160,7 +1160,7 @@ device_update_pattern(GPatternP pattern,int preview_id) /* Set the tip to be the name of the brush */ gtk_tooltips_set_tip(tool_tips,deviceD->patterns[preview_id],pattern->name,NULL); - buffer = g_new (gchar, pattern->mask->width * 3); + buffer = g_new (guchar, pattern->mask->width * 3); pattern_buf = pattern->mask; /* Limit to cell size */ diff --git a/app/devices.h b/app/devices.h index eb4f5ed039..f269117da5 100644 --- a/app/devices.h +++ b/app/devices.h @@ -27,7 +27,7 @@ typedef enum { DEVICE_BRUSH = 1 << 3, DEVICE_TOOL = 1 << 4, DEVICE_FOREGROUND = 1 << 5, - DEVICE_PATTERN = 1 << 6, + DEVICE_PATTERN = 1 << 6 } DeviceValues; /* Create device info dialog */ diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index be7513557f..c8f31c0884 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -767,7 +767,9 @@ create_display_shell (GDisplay* gdisp, gtk_widget_show (vbox); gtk_widget_show (gdisp->shell); +#ifdef __GNUC__ #warning DODGY? +#endif gtk_widget_realize (gdisp->canvas); gdk_window_set_back_pixmap(gdisp->canvas->window, NULL, 0); diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index be7513557f..c8f31c0884 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -767,7 +767,9 @@ create_display_shell (GDisplay* gdisp, gtk_widget_show (vbox); gtk_widget_show (gdisp->shell); +#ifdef __GNUC__ #warning DODGY? +#endif gtk_widget_realize (gdisp->canvas); gdk_window_set_back_pixmap(gdisp->canvas->window, NULL, 0); diff --git a/app/gimage.c b/app/gimage.c index 526935e2f8..3a28345240 100644 --- a/app/gimage.c +++ b/app/gimage.c @@ -73,7 +73,7 @@ gimage_delete (GImage *gimage) gimage->ref_count--; if (gimage->ref_count <= 0) gtk_object_unref (GTK_OBJECT(gimage)); -}; +} static void invalidate_cb(gpointer image, gpointer user_data){ diff --git a/app/gimplayer.c b/app/gimplayer.c index 3fe9059c57..7c13ea4eab 100644 --- a/app/gimplayer.c +++ b/app/gimplayer.c @@ -966,7 +966,7 @@ layer_pick_correlate (layer, x, y) */ tile = tile_manager_get_tile (GIMP_DRAWABLE(layer)->tiles, x, y, TRUE, FALSE); - val = * (unsigned char*) (tile_data_pointer (tile, + val = * ((unsigned char*) tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT) + tile_bpp (tile) - 1); diff --git a/app/gui/device-status-dialog.c b/app/gui/device-status-dialog.c index f1c1479b97..f932e190f5 100644 --- a/app/gui/device-status-dialog.c +++ b/app/gui/device-status-dialog.c @@ -1146,7 +1146,7 @@ device_update_brush(GimpBrushP brush,int preview_id) static void device_update_pattern(GPatternP pattern,int preview_id) { - gchar *buffer = NULL; + guchar *buffer = NULL; TempBuf * pattern_buf; unsigned char * src, *s = NULL; unsigned char *b; @@ -1160,7 +1160,7 @@ device_update_pattern(GPatternP pattern,int preview_id) /* Set the tip to be the name of the brush */ gtk_tooltips_set_tip(tool_tips,deviceD->patterns[preview_id],pattern->name,NULL); - buffer = g_new (gchar, pattern->mask->width * 3); + buffer = g_new (guchar, pattern->mask->width * 3); pattern_buf = pattern->mask; /* Limit to cell size */ diff --git a/app/gui/input-dialog.c b/app/gui/input-dialog.c index f1c1479b97..f932e190f5 100644 --- a/app/gui/input-dialog.c +++ b/app/gui/input-dialog.c @@ -1146,7 +1146,7 @@ device_update_brush(GimpBrushP brush,int preview_id) static void device_update_pattern(GPatternP pattern,int preview_id) { - gchar *buffer = NULL; + guchar *buffer = NULL; TempBuf * pattern_buf; unsigned char * src, *s = NULL; unsigned char *b; @@ -1160,7 +1160,7 @@ device_update_pattern(GPatternP pattern,int preview_id) /* Set the tip to be the name of the brush */ gtk_tooltips_set_tip(tool_tips,deviceD->patterns[preview_id],pattern->name,NULL); - buffer = g_new (gchar, pattern->mask->width * 3); + buffer = g_new (guchar, pattern->mask->width * 3); pattern_buf = pattern->mask; /* Limit to cell size */ diff --git a/app/interface.c b/app/interface.c index be7513557f..c8f31c0884 100644 --- a/app/interface.c +++ b/app/interface.c @@ -767,7 +767,9 @@ create_display_shell (GDisplay* gdisp, gtk_widget_show (vbox); gtk_widget_show (gdisp->shell); +#ifdef __GNUC__ #warning DODGY? +#endif gtk_widget_realize (gdisp->canvas); gdk_window_set_back_pixmap(gdisp->canvas->window, NULL, 0); diff --git a/app/layer.c b/app/layer.c index 3fe9059c57..7c13ea4eab 100644 --- a/app/layer.c +++ b/app/layer.c @@ -966,7 +966,7 @@ layer_pick_correlate (layer, x, y) */ tile = tile_manager_get_tile (GIMP_DRAWABLE(layer)->tiles, x, y, TRUE, FALSE); - val = * (unsigned char*) (tile_data_pointer (tile, + val = * ((unsigned char*) tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT) + tile_bpp (tile) - 1); diff --git a/app/paint-funcs/paint-funcs.c b/app/paint-funcs/paint-funcs.c index eddeafb55b..6fd50f6b34 100644 --- a/app/paint-funcs/paint-funcs.c +++ b/app/paint-funcs/paint-funcs.c @@ -3914,7 +3914,7 @@ thin_region(PixelRegion *src, gint16 radius) max[i][j] = 255; } max += radius; - out = (char *)g_malloc(src->w); + out = (guchar *)g_malloc(src->w); circ = (short *)g_malloc((diameter)*sizeof(gint16)); compute_border(circ, radius); @@ -4068,7 +4068,7 @@ border_region(PixelRegion *src, gint16 radius) } if (radius == 0) { - char color[] = "\0\0\0\0"; + unsigned char color[] = "\0\0\0\0"; color_region(src, color); return; } @@ -4121,7 +4121,7 @@ border_region(PixelRegion *src, gint16 radius) for (i = 0; i < radius +1; i++) { transition[i] = (guchar *)g_malloc (src->w+2*radius); - bzero(transition[i], src->w+2*radius); + memset(transition[i], 0, src->w+2*radius); transition[i] += radius; } out = (guchar *)g_malloc ((src->w)*sizeof(guchar)); diff --git a/app/paint/gimpink-blob.c b/app/paint/gimpink-blob.c index b5167d8cb5..1d2c6aaad6 100644 --- a/app/paint/gimpink-blob.c +++ b/app/paint/gimpink-blob.c @@ -36,7 +36,7 @@ blob_new (int y, int height) { Blob *result; - result = g_malloc (sizeof (Blob) + sizeof(BlobSpan) * height); + result = g_malloc (sizeof (Blob) + sizeof(BlobSpan) * (height-1)); result->y = y; result->height = height; @@ -46,7 +46,7 @@ blob_new (int y, int height) typedef enum { NONE = 0, LEFT = 1 << 0, - RIGHT = 1 << 1, + RIGHT = 1 << 1 } EdgeType; Blob * diff --git a/app/paint/gimpink-blob.h b/app/paint/gimpink-blob.h index 3ef2394420..642d9845fb 100644 --- a/app/paint/gimpink-blob.h +++ b/app/paint/gimpink-blob.h @@ -36,7 +36,7 @@ struct _BlobSpan { struct _Blob { int y; int height; - BlobSpan data[0]; /* slightly in violation of ANSI-C? */ + BlobSpan data[1]; }; @@ -44,4 +44,4 @@ Blob *blob_convex_union (Blob *b1, Blob *b2); Blob *blob_ellipse (double xc, double yc, double xp, double yp, double xq, double yq); void blob_bounds(Blob *b, int *x, int *y, int *width, int *height); -#endif __BLOB_H__ +#endif /* __BLOB_H__ */ diff --git a/app/paint_core.c b/app/paint_core.c index 35d14458ea..dc5a9ae789 100644 --- a/app/paint_core.c +++ b/app/paint_core.c @@ -681,7 +681,7 @@ paint_core_get_orig_image (paint_core, drawable, x1, y1, x2, y2) refd = 1; undo_tile = tile_manager_get_tile (undo_tiles, srcPR.x, srcPR.y, TRUE, FALSE); - s = tile_data_pointer (undo_tile, 0, 0) + + s = (unsigned char*)tile_data_pointer (undo_tile, 0, 0) + srcPR.rowstride * (srcPR.y % TILE_HEIGHT) + srcPR.bytes * (srcPR.x % TILE_WIDTH); /* dubious... */ } diff --git a/app/paint_funcs.c b/app/paint_funcs.c index eddeafb55b..6fd50f6b34 100644 --- a/app/paint_funcs.c +++ b/app/paint_funcs.c @@ -3914,7 +3914,7 @@ thin_region(PixelRegion *src, gint16 radius) max[i][j] = 255; } max += radius; - out = (char *)g_malloc(src->w); + out = (guchar *)g_malloc(src->w); circ = (short *)g_malloc((diameter)*sizeof(gint16)); compute_border(circ, radius); @@ -4068,7 +4068,7 @@ border_region(PixelRegion *src, gint16 radius) } if (radius == 0) { - char color[] = "\0\0\0\0"; + unsigned char color[] = "\0\0\0\0"; color_region(src, color); return; } @@ -4121,7 +4121,7 @@ border_region(PixelRegion *src, gint16 radius) for (i = 0; i < radius +1; i++) { transition[i] = (guchar *)g_malloc (src->w+2*radius); - bzero(transition[i], src->w+2*radius); + memset(transition[i], 0, src->w+2*radius); transition[i] += radius; } out = (guchar *)g_malloc ((src->w)*sizeof(guchar)); diff --git a/app/procedural_db.c b/app/procedural_db.c index ccee0186a6..8ddfdb3566 100644 --- a/app/procedural_db.c +++ b/app/procedural_db.c @@ -1280,7 +1280,7 @@ static gboolean id_cmp_func(gconstpointer id1, gconstpointer id2){ } static void add_cb(GimpSet* set, GimpImage* gimage, gpointer data){ - guint* id=g_new(gint,1); + guint* id=g_new(guint,1); *id=next_image_id++; gtk_object_set_data(GTK_OBJECT(gimage), "pdb_id", id); g_hash_table_insert(image_hash, id, gimage); diff --git a/app/tile_swap.c b/app/tile_swap.c index 777a06f03e..fbff8e511e 100644 --- a/app/tile_swap.c +++ b/app/tile_swap.c @@ -227,6 +227,7 @@ out: #ifdef USE_PTHREADS pthread_mutex_unlock(&swapfile_mutex); #endif + return; } void @@ -330,6 +331,7 @@ out: #ifdef USE_PTHREADS pthread_mutex_unlock(&swapfile_mutex); #endif + return; } static void diff --git a/app/tools/blob.c b/app/tools/blob.c index b5167d8cb5..1d2c6aaad6 100644 --- a/app/tools/blob.c +++ b/app/tools/blob.c @@ -36,7 +36,7 @@ blob_new (int y, int height) { Blob *result; - result = g_malloc (sizeof (Blob) + sizeof(BlobSpan) * height); + result = g_malloc (sizeof (Blob) + sizeof(BlobSpan) * (height-1)); result->y = y; result->height = height; @@ -46,7 +46,7 @@ blob_new (int y, int height) typedef enum { NONE = 0, LEFT = 1 << 0, - RIGHT = 1 << 1, + RIGHT = 1 << 1 } EdgeType; Blob * diff --git a/app/tools/blob.h b/app/tools/blob.h index 3ef2394420..642d9845fb 100644 --- a/app/tools/blob.h +++ b/app/tools/blob.h @@ -36,7 +36,7 @@ struct _BlobSpan { struct _Blob { int y; int height; - BlobSpan data[0]; /* slightly in violation of ANSI-C? */ + BlobSpan data[1]; }; @@ -44,4 +44,4 @@ Blob *blob_convex_union (Blob *b1, Blob *b2); Blob *blob_ellipse (double xc, double yc, double xp, double yp, double xq, double yq); void blob_bounds(Blob *b, int *x, int *y, int *width, int *height); -#endif __BLOB_H__ +#endif /* __BLOB_H__ */ diff --git a/app/tools/gimpinktool-blob.c b/app/tools/gimpinktool-blob.c index b5167d8cb5..1d2c6aaad6 100644 --- a/app/tools/gimpinktool-blob.c +++ b/app/tools/gimpinktool-blob.c @@ -36,7 +36,7 @@ blob_new (int y, int height) { Blob *result; - result = g_malloc (sizeof (Blob) + sizeof(BlobSpan) * height); + result = g_malloc (sizeof (Blob) + sizeof(BlobSpan) * (height-1)); result->y = y; result->height = height; @@ -46,7 +46,7 @@ blob_new (int y, int height) typedef enum { NONE = 0, LEFT = 1 << 0, - RIGHT = 1 << 1, + RIGHT = 1 << 1 } EdgeType; Blob * diff --git a/app/tools/gimpinktool-blob.h b/app/tools/gimpinktool-blob.h index 3ef2394420..642d9845fb 100644 --- a/app/tools/gimpinktool-blob.h +++ b/app/tools/gimpinktool-blob.h @@ -36,7 +36,7 @@ struct _BlobSpan { struct _Blob { int y; int height; - BlobSpan data[0]; /* slightly in violation of ANSI-C? */ + BlobSpan data[1]; }; @@ -44,4 +44,4 @@ Blob *blob_convex_union (Blob *b1, Blob *b2); Blob *blob_ellipse (double xc, double yc, double xp, double yp, double xq, double yq); void blob_bounds(Blob *b, int *x, int *y, int *width, int *height); -#endif __BLOB_H__ +#endif /* __BLOB_H__ */ diff --git a/app/tools/paint_core.c b/app/tools/paint_core.c index 35d14458ea..dc5a9ae789 100644 --- a/app/tools/paint_core.c +++ b/app/tools/paint_core.c @@ -681,7 +681,7 @@ paint_core_get_orig_image (paint_core, drawable, x1, y1, x2, y2) refd = 1; undo_tile = tile_manager_get_tile (undo_tiles, srcPR.x, srcPR.y, TRUE, FALSE); - s = tile_data_pointer (undo_tile, 0, 0) + + s = (unsigned char*)tile_data_pointer (undo_tile, 0, 0) + srcPR.rowstride * (srcPR.y % TILE_HEIGHT) + srcPR.bytes * (srcPR.x % TILE_WIDTH); /* dubious... */ } diff --git a/app/widgets/gimpdeviceinfo.c b/app/widgets/gimpdeviceinfo.c index f1c1479b97..f932e190f5 100644 --- a/app/widgets/gimpdeviceinfo.c +++ b/app/widgets/gimpdeviceinfo.c @@ -1146,7 +1146,7 @@ device_update_brush(GimpBrushP brush,int preview_id) static void device_update_pattern(GPatternP pattern,int preview_id) { - gchar *buffer = NULL; + guchar *buffer = NULL; TempBuf * pattern_buf; unsigned char * src, *s = NULL; unsigned char *b; @@ -1160,7 +1160,7 @@ device_update_pattern(GPatternP pattern,int preview_id) /* Set the tip to be the name of the brush */ gtk_tooltips_set_tip(tool_tips,deviceD->patterns[preview_id],pattern->name,NULL); - buffer = g_new (gchar, pattern->mask->width * 3); + buffer = g_new (guchar, pattern->mask->width * 3); pattern_buf = pattern->mask; /* Limit to cell size */ diff --git a/app/widgets/gimpdevices.c b/app/widgets/gimpdevices.c index f1c1479b97..f932e190f5 100644 --- a/app/widgets/gimpdevices.c +++ b/app/widgets/gimpdevices.c @@ -1146,7 +1146,7 @@ device_update_brush(GimpBrushP brush,int preview_id) static void device_update_pattern(GPatternP pattern,int preview_id) { - gchar *buffer = NULL; + guchar *buffer = NULL; TempBuf * pattern_buf; unsigned char * src, *s = NULL; unsigned char *b; @@ -1160,7 +1160,7 @@ device_update_pattern(GPatternP pattern,int preview_id) /* Set the tip to be the name of the brush */ gtk_tooltips_set_tip(tool_tips,deviceD->patterns[preview_id],pattern->name,NULL); - buffer = g_new (gchar, pattern->mask->width * 3); + buffer = g_new (guchar, pattern->mask->width * 3); pattern_buf = pattern->mask; /* Limit to cell size */ diff --git a/app/widgets/gimpdevices.h b/app/widgets/gimpdevices.h index eb4f5ed039..f269117da5 100644 --- a/app/widgets/gimpdevices.h +++ b/app/widgets/gimpdevices.h @@ -27,7 +27,7 @@ typedef enum { DEVICE_BRUSH = 1 << 3, DEVICE_TOOL = 1 << 4, DEVICE_FOREGROUND = 1 << 5, - DEVICE_PATTERN = 1 << 6, + DEVICE_PATTERN = 1 << 6 } DeviceValues; /* Create device info dialog */ diff --git a/app/xcf.c b/app/xcf.c index 2519c4402a..cb70d7d3a1 100644 --- a/app/xcf.c +++ b/app/xcf.c @@ -1150,7 +1150,7 @@ xcf_save_tile_rle (XcfInfo *info, for (i = 0; i < bpp; i++) { - data = tile_data_pointer (tile, 0, 0) + i; + data = (guchar*)tile_data_pointer (tile, 0, 0) + i; state = 0; length = 0; @@ -2046,7 +2046,7 @@ xcf_load_tile_rle (XcfInfo *info, for (i = 0; i < bpp; i++) { - data = tile_data_pointer (tile, 0, 0) + i; + data = (guchar*)tile_data_pointer (tile, 0, 0) + i; size = tile_ewidth (tile) * tile_eheight (tile); count = 0; diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index 2519c4402a..cb70d7d3a1 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -1150,7 +1150,7 @@ xcf_save_tile_rle (XcfInfo *info, for (i = 0; i < bpp; i++) { - data = tile_data_pointer (tile, 0, 0) + i; + data = (guchar*)tile_data_pointer (tile, 0, 0) + i; state = 0; length = 0; @@ -2046,7 +2046,7 @@ xcf_load_tile_rle (XcfInfo *info, for (i = 0; i < bpp; i++) { - data = tile_data_pointer (tile, 0, 0) + i; + data = (guchar*)tile_data_pointer (tile, 0, 0) + i; size = tile_ewidth (tile) * tile_eheight (tile); count = 0;