applied gimp-joke-981006-0, portability patch

-Yosh
This commit is contained in:
Manish Singh 1998-10-25 05:55:36 +00:00
parent 79589009bd
commit 0963a109c3
34 changed files with 61 additions and 47 deletions

View File

@ -1,3 +1,7 @@
Sat Oct 24 22:42:10 PDT 1998 Manish Singh <yosh@gimp.org>
* applied gimp-joke-981006-0, portabilty patch
Sat Oct 24 22:05:16 PDT 1998 Manish Singh <yosh@gimp.org>
* configure.in: sinclude by hand to work around automake 1.3 bug

View File

@ -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;
}

View File

@ -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

View File

@ -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 *

View File

@ -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__ */

View File

@ -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;
}

View File

@ -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);

View File

@ -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 */

View File

@ -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 */

View File

@ -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);

View File

@ -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);

View File

@ -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){

View File

@ -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);

View File

@ -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 */

View File

@ -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 */

View File

@ -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);

View File

@ -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);

View File

@ -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));

View File

@ -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 *

View File

@ -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__ */

View File

@ -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... */
}

View File

@ -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));

View File

@ -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);

View File

@ -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

View File

@ -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 *

View File

@ -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__ */

View File

@ -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 *

View File

@ -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__ */

View File

@ -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... */
}

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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;

View File

@ -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;