Commit 115ba5e9 authored by Manish Singh's avatar Manish Singh

treat INT8s are guint8 internally, as a bandaid to address bug #2208 and

friends.

-Yosh
parent c34edd8f
Mon Nov 8 16:20:02 PST 1999 Manish Singh <yosh@gimp.org>
* tools/pdbgen/pdb.pl
* tools/pdbgen/pdb/brushes.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/gimage.pdb
* tools/pdbgen/pdb/patterns.pdb
* tools/pdbgen/pdb/procedural_db.pdb: treat INT8s are guint8
internally, as a bandaid to address bug #2208 and friends.
Mon Nov 8 23:06:06 GMT 1999 Andy Thomas <alt@gimp.org>
* app/gimprc.c
......
......@@ -496,7 +496,7 @@ brushes_get_brush_data_invoker (Argument *args)
Argument *return_args;
gchar *name;
gint32 length = 0;
gint8 *mask_data = NULL;
guint8 *mask_data = NULL;
GimpBrushP brushp = NULL;
name = (gchar *) args[0].value.pdb_pointer;
......@@ -530,7 +530,7 @@ brushes_get_brush_data_invoker (Argument *args)
if (success)
{
length = brushp->mask->height * brushp->mask->width;
mask_data = g_new (gint8, length);
mask_data = g_new (guint8, length);
g_memmove (mask_data, temp_buf_data (brushp->mask), length);
}
}
......
......@@ -539,7 +539,7 @@ curves_spline_invoker (Argument *args)
GimpDrawable *drawable;
gint32 channel;
gint32 num_points;
gint8 *control_pts;
guint8 *control_pts;
CurvesDialog cd;
int x1, y1, x2, y2;
int i, j;
......@@ -557,7 +557,7 @@ curves_spline_invoker (Argument *args)
if (num_points <= 3 || num_points > 32)
success = FALSE;
control_pts = (gint8 *) args[3].value.pdb_pointer;
control_pts = (guint8 *) args[3].value.pdb_pointer;
if (success)
{
......@@ -658,7 +658,7 @@ curves_explicit_invoker (Argument *args)
GimpDrawable *drawable;
gint32 channel;
gint32 num_bytes;
gint8 *curve;
guint8 *curve;
CurvesDialog cd;
int x1, y1, x2, y2;
int i, j;
......@@ -676,7 +676,7 @@ curves_explicit_invoker (Argument *args)
if (num_bytes <= 0)
success = FALSE;
curve = (gint8 *) args[3].value.pdb_pointer;
curve = (guint8 *) args[3].value.pdb_pointer;
if (success)
{
......
......@@ -1032,8 +1032,8 @@ drawable_get_pixel_invoker (Argument *args)
gint32 x;
gint32 y;
gint32 num_channels = 0;
gint8 *pixel = NULL;
gint8 *p;
guint8 *pixel = NULL;
guint8 *p;
gint b;
Tile *tile;
......@@ -1054,7 +1054,7 @@ drawable_get_pixel_invoker (Argument *args)
if (x < drawable_width (drawable) && y < drawable_height (drawable))
{
num_channels = drawable_bytes (drawable);
pixel = g_new (gint8, num_channels);
pixel = g_new (guint8, num_channels);
tile = tile_manager_get_tile (drawable_data (drawable), x, y,
TRUE, TRUE);
......@@ -1140,8 +1140,8 @@ drawable_set_pixel_invoker (Argument *args)
gint32 x;
gint32 y;
gint32 num_channels;
gint8 *pixel;
gint8 *p;
guint8 *pixel;
guint8 *p;
gint b;
Tile *tile;
......@@ -1159,7 +1159,7 @@ drawable_set_pixel_invoker (Argument *args)
num_channels = args[3].value.pdb_int;
pixel = (gint8 *) args[4].value.pdb_pointer;
pixel = (guint8 *) args[4].value.pdb_pointer;
if (success)
{
......@@ -1293,7 +1293,7 @@ drawable_thumbnail_invoker (Argument *args)
gint32 height = 0;
gint32 bpp = 0;
gint32 num_pixels = 0;
gint8 *thumbnail_data = NULL;
guint8 *thumbnail_data = NULL;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
......@@ -1329,7 +1329,7 @@ drawable_thumbnail_invoker (Argument *args)
buf = channel_preview (GIMP_CHANNEL (drawable), req_width, req_height);
num_pixels = buf->height * buf->width * buf->bytes;
thumbnail_data = g_new (gint8, num_pixels);
thumbnail_data = g_new (guint8, num_pixels);
g_memmove (thumbnail_data, temp_buf_data (buf), num_pixels);
width = buf->width;
height = buf->height;
......
......@@ -1773,7 +1773,7 @@ image_get_cmap_invoker (Argument *args)
Argument *return_args;
GimpImage *gimage;
gint32 num_bytes = 0;
gint8 *cmap = NULL;
guint8 *cmap = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
......@@ -1782,7 +1782,7 @@ image_get_cmap_invoker (Argument *args)
if (success)
{
num_bytes = gimage->num_cols * 3;
cmap = g_new (gint8, num_bytes);
cmap = g_new (guint8, num_bytes);
memcpy (cmap, gimage_cmap (gimage), num_bytes);
}
......@@ -1842,7 +1842,7 @@ image_set_cmap_invoker (Argument *args)
gboolean success = TRUE;
GimpImage *gimage;
gint32 num_bytes;
gint8 *cmap;
guint8 *cmap;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
......@@ -1852,7 +1852,7 @@ image_set_cmap_invoker (Argument *args)
if (num_bytes < 0 || num_bytes > 768)
success = FALSE;
cmap = (gint8 *) args[2].value.pdb_pointer;
cmap = (guint8 *) args[2].value.pdb_pointer;
if (success)
{
......@@ -2309,7 +2309,7 @@ image_thumbnail_invoker (Argument *args)
gint32 height = 0;
gint32 bpp = 0;
gint32 num_pixels = 0;
gint8 *thumbnail_data = NULL;
guint8 *thumbnail_data = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
......@@ -2343,7 +2343,7 @@ image_thumbnail_invoker (Argument *args)
req_width,
req_height);
num_pixels = buf->height * buf->width * buf->bytes;
thumbnail_data = g_new (gint8, num_pixels);
thumbnail_data = g_new (guint8, num_pixels);
g_memmove (thumbnail_data, temp_buf_data (buf), num_pixels);
width = buf->width;
height = buf->height;
......
......@@ -222,7 +222,7 @@ patterns_get_pattern_data_invoker (Argument *args)
Argument *return_args;
gchar *name;
gint32 length = 0;
gint8 *mask_data = NULL;
guint8 *mask_data = NULL;
GPatternP patternp = NULL;
name = (gchar *) args[0].value.pdb_pointer;
......@@ -257,7 +257,7 @@ patterns_get_pattern_data_invoker (Argument *args)
{
length = patternp->mask->height * patternp->mask->width *
patternp->mask->bytes;
mask_data = g_new (gint8, length);
mask_data = g_new (guint8, length);
g_memmove (mask_data, temp_buf_data (patternp->mask), length);
}
}
......
......@@ -732,7 +732,7 @@ procedural_db_get_data_invoker (Argument *args)
gboolean success = TRUE;
Argument *return_args;
gchar *identifier;
gint8 *data_copy = NULL;
guint8 *data_copy = NULL;
PDBData *data = NULL;
GList *list;
......@@ -752,7 +752,7 @@ procedural_db_get_data_invoker (Argument *args)
if (!strcmp (data->identifier, identifier))
{
data_copy = g_new (char, data->bytes);
data_copy = g_new (guint8, data->bytes);
memcpy (data_copy, data->data, data->bytes);
success = TRUE;
......@@ -890,7 +890,7 @@ procedural_db_set_data_invoker (Argument *args)
gboolean success = TRUE;
gchar *identifier;
gint32 bytes;
gint8 *data_src;
guint8 *data_src;
PDBData *data = NULL;
GList *list;
......@@ -902,7 +902,7 @@ procedural_db_set_data_invoker (Argument *args)
if (bytes <= 0)
success = FALSE;
data_src = (gint8 *) args[2].value.pdb_pointer;
data_src = (guint8 *) args[2].value.pdb_pointer;
if (success)
{
......
......@@ -20,14 +20,14 @@ package Gimp::CodeGen::pdb;
%arg_types = (
int32 => { name => 'INT32', type => 'gint32 ' },
int16 => { name => 'INT16', type => 'gint16 ' },
int8 => { name => 'INT8' , type => 'gint8 ' },
int8 => { name => 'INT8' , type => 'guint8 ' },
float => { name => 'FLOAT' , type => 'gdouble ' },
string => { name => 'STRING', type => 'gchar *' },
int32array => { name => 'INT32ARRAY' , type => 'gint32 *' , array => 1 },
int16array => { name => 'INT16ARRAY' , type => 'gint16 *' , array => 1 },
int8array => { name => 'INT8ARRAY' , type => 'gint8 *' , array => 1 },
int8array => { name => 'INT8ARRAY' , type => 'guint8 *' , array => 1 },
floatarray => { name => 'FLOATARRAY' , type => 'gdouble *', array => 1 },
stringarray => { name => 'STRINGARRAY', type => 'gchar **' , array => 1 },
......
......@@ -346,7 +346,7 @@ HELP
if (success)
{
length = brushp->mask->height * brushp->mask->width;
mask_data = g_new (gint8, length);
mask_data = g_new (guint8, length);
g_memmove (mask_data, temp_buf_data (brushp->mask), length);
}
}
......
......@@ -342,13 +342,13 @@ HELP
$outargs[0]->{init} = $outargs[0]->{array}->{init} = 1;
%invoke = (
vars => [ 'gint8 *p', 'gint b', 'Tile *tile' ],
vars => [ 'guint8 *p', 'gint b', 'Tile *tile' ],
code => <<'CODE'
{
if (x < drawable_width (drawable) && y < drawable_height (drawable))
{
num_channels = drawable_bytes (drawable);
pixel = g_new (gint8, num_channels);
pixel = g_new (guint8, num_channels);
tile = tile_manager_get_tile (drawable_data (drawable), x, y,
TRUE, TRUE);
......@@ -385,7 +385,7 @@ HELP
push @inargs, &pixel_arg();
%invoke = (
vars => [ 'gint8 *p', 'gint b', 'Tile *tile' ],
vars => [ 'guint8 *p', 'gint b', 'Tile *tile' ],
code => <<'CODE'
{
if (x < drawable_width (drawable) && y < drawable_height (drawable) &&
......@@ -495,7 +495,7 @@ HELP
buf = channel_preview (GIMP_CHANNEL (drawable), req_width, req_height);
num_pixels = buf->height * buf->width * buf->bytes;
thumbnail_data = g_new (gint8, num_pixels);
thumbnail_data = g_new (guint8, num_pixels);
g_memmove (thumbnail_data, temp_buf_data (buf), num_pixels);
width = buf->width;
height = buf->height;
......
......@@ -768,7 +768,7 @@ HELP
code => <<'CODE'
{
num_bytes = gimage->num_cols * 3;
cmap = g_new (gint8, num_bytes);
cmap = g_new (guint8, num_bytes);
memcpy (cmap, gimage_cmap (gimage), num_bytes);
}
CODE
......@@ -1288,7 +1288,7 @@ HELP
req_width,
req_height);
num_pixels = buf->height * buf->width * buf->bytes;
thumbnail_data = g_new (gint8, num_pixels);
thumbnail_data = g_new (guint8, num_pixels);
g_memmove (thumbnail_data, temp_buf_data (buf), num_pixels);
width = buf->width;
height = buf->height;
......
......@@ -768,7 +768,7 @@ HELP
code => <<'CODE'
{
num_bytes = gimage->num_cols * 3;
cmap = g_new (gint8, num_bytes);
cmap = g_new (guint8, num_bytes);
memcpy (cmap, gimage_cmap (gimage), num_bytes);
}
CODE
......@@ -1288,7 +1288,7 @@ HELP
req_width,
req_height);
num_pixels = buf->height * buf->width * buf->bytes;
thumbnail_data = g_new (gint8, num_pixels);
thumbnail_data = g_new (guint8, num_pixels);
g_memmove (thumbnail_data, temp_buf_data (buf), num_pixels);
width = buf->width;
height = buf->height;
......
......@@ -208,7 +208,7 @@ HELP
{
length = patternp->mask->height * patternp->mask->width *
patternp->mask->bytes;
mask_data = g_new (gint8, length);
mask_data = g_new (guint8, length);
g_memmove (mask_data, temp_buf_data (patternp->mask), length);
}
}
......
......@@ -290,7 +290,7 @@ HELP
if (!strcmp (data->identifier, identifier))
{
data_copy = g_new (char, data->bytes);
data_copy = g_new (guint8, data->bytes);
memcpy (data_copy, data->data, data->bytes);
success = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment