mirror of https://github.com/GNOME/gimp.git
libgimpmath/gimpmd5.c libgimpmath/test-md5.c plug-ins/common/CEL.c
2005-08-03 Sven Neumann <sven@gimp.org> * libgimpmath/gimpmd5.c * libgimpmath/test-md5.c * plug-ins/common/CEL.c * plug-ins/common/cartoon.c * plug-ins/common/emboss.c * plug-ins/common/exchange.c * plug-ins/common/gifload.c * plug-ins/common/poppler.c * plug-ins/jpeg/jpeg-save.c * plug-ins/jpeg/jpeg-save.h * plug-ins/metadata/interface.c * plug-ins/metadata/metadata.c * plug-ins/metadata/xmp-model.c * plug-ins/script-fu/siod/sliba.c: fixed signedness warnings.
This commit is contained in:
parent
19e317e2d2
commit
a40f35b7e2
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
|||
2005-08-03 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimpmath/gimpmd5.c
|
||||
* libgimpmath/test-md5.c
|
||||
* plug-ins/common/CEL.c
|
||||
* plug-ins/common/cartoon.c
|
||||
* plug-ins/common/emboss.c
|
||||
* plug-ins/common/exchange.c
|
||||
* plug-ins/common/gifload.c
|
||||
* plug-ins/common/poppler.c
|
||||
* plug-ins/jpeg/jpeg-save.c
|
||||
* plug-ins/jpeg/jpeg-save.h
|
||||
* plug-ins/metadata/interface.c
|
||||
* plug-ins/metadata/metadata.c
|
||||
* plug-ins/metadata/xmp-model.c
|
||||
* plug-ins/script-fu/siod/sliba.c: fixed signedness warnings.
|
||||
|
||||
2005-08-03 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimpcolor/gimprgb.[ch]: deprecated RGB intensity functions
|
||||
|
|
|
@ -43,7 +43,7 @@ static void gimp_md5_init (GimpMD5Context *ctx);
|
|||
static void gimp_md5_transform (guint32 buf[4],
|
||||
const guint32 in[16]);
|
||||
static void gimp_md5_update (GimpMD5Context *ctx,
|
||||
const guchar *buf,
|
||||
const gchar *buf,
|
||||
guint32 len);
|
||||
static void gimp_md5_final (GimpMD5Context *ctx,
|
||||
guchar digest[16]);
|
||||
|
@ -111,7 +111,7 @@ gimp_md5_init (GimpMD5Context *ctx)
|
|||
|
||||
static void
|
||||
gimp_md5_update (GimpMD5Context *ctx,
|
||||
const guchar *buf,
|
||||
const gchar *buf,
|
||||
guint32 len)
|
||||
{
|
||||
guint32 t;
|
||||
|
|
|
@ -41,7 +41,7 @@ main (void)
|
|||
|
||||
for (j = 0; j < 16; j++)
|
||||
{
|
||||
guchar buf[4];
|
||||
gchar buf[4];
|
||||
|
||||
g_snprintf (buf, 3, "%02x", digest[j]);
|
||||
g_print (buf);
|
||||
|
|
|
@ -308,12 +308,12 @@ load_image (const gchar *file,
|
|||
|
||||
fread (header, 4, 1, fp);
|
||||
|
||||
if (strncmp (header, "KiSS", 4))
|
||||
if (strncmp ((const gchar *) header, "KiSS", 4))
|
||||
{
|
||||
colours= 16;
|
||||
bpp = 4;
|
||||
width= header[0] + (256 * header[1]);
|
||||
height= header[2] + (256 * header[3]);
|
||||
width = header[0] + (256 * header[1]);
|
||||
height = header[2] + (256 * header[3]);
|
||||
offx= 0;
|
||||
offy= 0;
|
||||
}
|
||||
|
@ -493,14 +493,14 @@ load_palette (FILE *fp,
|
|||
int i, bpp, colours= 0;
|
||||
|
||||
fread (header, 4, 1, fp);
|
||||
if (!strncmp(header, "KiSS", 4))
|
||||
if (!strncmp ((const gchar *) header, "KiSS", 4))
|
||||
{
|
||||
fread (header+4, 28, 1, fp);
|
||||
bpp = header[5];
|
||||
colours = header[8] + header[9] * 256;
|
||||
if (bpp == 12)
|
||||
{
|
||||
for (i= 0; i < colours; ++i)
|
||||
for (i = 0; i < colours; ++i)
|
||||
{
|
||||
fread (buffer, 1, 2, fp);
|
||||
palette[i*3]= buffer[0] & 0xf0;
|
||||
|
@ -578,7 +578,7 @@ save_image (const gchar *file,
|
|||
|
||||
/* Headers */
|
||||
memset (header, 0, 32);
|
||||
strcpy (header, "KiSS");
|
||||
strcpy ((gchar *) header, "KiSS");
|
||||
header[4]= 0x20;
|
||||
|
||||
/* Work out whether to save as 8bit or 4bit */
|
||||
|
|
|
@ -286,7 +286,7 @@ cartoon (GimpDrawable *drawable,
|
|||
gdouble std_dev1;
|
||||
gdouble std_dev2;
|
||||
gdouble ramp;
|
||||
gchar *preview_buffer = NULL;
|
||||
guchar *preview_buffer = NULL;
|
||||
|
||||
if (preview)
|
||||
{
|
||||
|
@ -498,7 +498,8 @@ cartoon (GimpDrawable *drawable,
|
|||
}
|
||||
else
|
||||
{
|
||||
gimp_pixel_rgn_init (&dest_rgn, drawable, x1, y1, width, height, TRUE, TRUE);
|
||||
gimp_pixel_rgn_init (&dest_rgn, drawable,
|
||||
x1, y1, width, height, TRUE, TRUE);
|
||||
pr = gimp_pixel_rgns_register (2, &src_rgn, &dest_rgn);
|
||||
}
|
||||
|
||||
|
|
|
@ -340,7 +340,7 @@ emboss (GimpDrawable *drawable,
|
|||
gint p_update;
|
||||
gint y;
|
||||
gint x1, y1, x2, y2;
|
||||
guint width, height;
|
||||
gint width, height;
|
||||
gint bypp, rowsize, has_alpha;
|
||||
guchar *srcbuf, *dstbuf;
|
||||
|
||||
|
|
|
@ -651,10 +651,10 @@ exchange (GimpDrawable *drawable,
|
|||
guchar from_red, from_green, from_blue;
|
||||
guchar to_red, to_green, to_blue;
|
||||
guchar *src_row, *dest_row;
|
||||
guint x, y, bpp = drawable->bpp;
|
||||
gint x, y, bpp = drawable->bpp;
|
||||
gboolean has_alpha;
|
||||
gint x1, y1, x2, y2;
|
||||
guint width, height;
|
||||
gint width, height;
|
||||
GimpRGB min;
|
||||
GimpRGB max;
|
||||
|
||||
|
@ -702,6 +702,7 @@ exchange (GimpDrawable *drawable,
|
|||
for (y = y1; y < y2; y++)
|
||||
{
|
||||
gimp_pixel_rgn_get_row (&srcPR, src_row, x1, y, width);
|
||||
|
||||
for (x = 0; x < width; x++)
|
||||
{
|
||||
guchar pixel_red, pixel_green, pixel_blue;
|
||||
|
@ -731,6 +732,7 @@ exchange (GimpDrawable *drawable,
|
|||
pixel_green - from_green : from_green - pixel_green;
|
||||
blue_delta = pixel_blue > from_blue ?
|
||||
pixel_blue - from_blue : from_blue - pixel_blue;
|
||||
|
||||
new_red = CLAMP (to_red + red_delta, 0, 255);
|
||||
new_green = CLAMP (to_green + green_delta, 0, 255);
|
||||
new_blue = CLAMP (to_blue + blue_delta, 0, 255);
|
||||
|
@ -759,8 +761,8 @@ exchange (GimpDrawable *drawable,
|
|||
gimp_progress_update ((gdouble) y / (gdouble) height);
|
||||
}
|
||||
|
||||
g_free(src_row);
|
||||
g_free(dest_row);
|
||||
g_free (src_row);
|
||||
g_free (dest_row);
|
||||
|
||||
if (preview)
|
||||
{
|
||||
|
|
|
@ -450,9 +450,9 @@ ReadColorMap (FILE *fd,
|
|||
CMap buffer,
|
||||
int *format)
|
||||
{
|
||||
int i;
|
||||
unsigned char rgb[3];
|
||||
int flag;
|
||||
guchar rgb[3];
|
||||
gint flag;
|
||||
gint i;
|
||||
|
||||
flag = TRUE;
|
||||
|
||||
|
@ -480,7 +480,7 @@ static int
|
|||
DoExtension (FILE *fd,
|
||||
int label)
|
||||
{
|
||||
static guchar buf[256];
|
||||
static gchar buf[256];
|
||||
gchar *str;
|
||||
|
||||
switch (label)
|
||||
|
@ -529,7 +529,7 @@ DoExtension (FILE *fd,
|
|||
|
||||
comment_parasite = gimp_parasite_new ("gimp-comment",
|
||||
GIMP_PARASITE_PERSISTENT,
|
||||
strlen(buf) + 1, buf);
|
||||
strlen (buf) + 1, buf);
|
||||
#else
|
||||
if (showComment)
|
||||
g_print ("GIF: gif comment: %s\n", buf);
|
||||
|
|
|
@ -376,7 +376,7 @@ layer_from_pixbuf (gint32 image,
|
|||
gint height;
|
||||
gint rowstride;
|
||||
gint bpp;
|
||||
gchar *pixels;
|
||||
guchar *pixels;
|
||||
|
||||
gdouble progress = 0;
|
||||
|
||||
|
|
|
@ -70,6 +70,15 @@ static void make_preview (void);
|
|||
static void save_restart_update (GtkAdjustment *adjustment,
|
||||
GtkWidget *toggle);
|
||||
|
||||
#ifdef HAVE_EXIF
|
||||
|
||||
static gint create_thumbnail (gint32 image_ID,
|
||||
gint32 drawable_ID,
|
||||
gdouble quality,
|
||||
guchar **thumbnail_buffer);
|
||||
|
||||
#endif /* HAVE_EXIF */
|
||||
|
||||
|
||||
static GtkWidget *restart_markers_scale = NULL;
|
||||
static GtkWidget *restart_markers_label = NULL;
|
||||
|
@ -201,7 +210,7 @@ save_image (const gchar *filename,
|
|||
gint rowstride, yend;
|
||||
gint i, j;
|
||||
#ifdef HAVE_EXIF
|
||||
gchar *thumbnail_buffer = NULL;
|
||||
guchar *thumbnail_buffer = NULL;
|
||||
gint thumbnail_buffer_length = 0;
|
||||
#endif
|
||||
|
||||
|
@ -488,7 +497,7 @@ save_image (const gchar *filename,
|
|||
{
|
||||
const gchar *xmp_data;
|
||||
glong xmp_data_size;
|
||||
gchar *app_block;
|
||||
guchar *app_block;
|
||||
|
||||
xmp_data = ((const gchar *) gimp_parasite_data (parasite)) + 10;
|
||||
xmp_data_size = gimp_parasite_data_size (parasite) - 10;
|
||||
|
@ -1038,15 +1047,15 @@ save_restart_update (GtkAdjustment *adjustment,
|
|||
|
||||
#ifdef HAVE_EXIF
|
||||
|
||||
static gchar *tbuffer = NULL;
|
||||
static gchar *tbuffer2 = NULL;
|
||||
static guchar *tbuffer = NULL;
|
||||
static guchar *tbuffer2 = NULL;
|
||||
|
||||
static gint tbuffer_count = 0;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct jpeg_destination_mgr pub; /* public fields */
|
||||
gchar *buffer;
|
||||
guchar *buffer;
|
||||
gint size;
|
||||
} my_destination_mgr;
|
||||
|
||||
|
@ -1063,7 +1072,7 @@ empty_output_buffer (j_compress_ptr cinfo)
|
|||
my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
|
||||
|
||||
tbuffer_count = tbuffer_count + 16384;
|
||||
tbuffer = (gchar *) g_realloc(tbuffer, tbuffer_count);
|
||||
tbuffer = g_renew (guchar, tbuffer, tbuffer_count);
|
||||
g_memmove (tbuffer + tbuffer_count - 16384, tbuffer2, 16384);
|
||||
|
||||
dest->pub.next_output_byte = tbuffer2;
|
||||
|
@ -1079,15 +1088,16 @@ term_destination (j_compress_ptr cinfo)
|
|||
|
||||
tbuffer_count = (tbuffer_count + 16384) - (dest->pub.free_in_buffer);
|
||||
|
||||
tbuffer = (gchar *) g_realloc (tbuffer, tbuffer_count);
|
||||
g_memmove(tbuffer + tbuffer_count - (16384 - dest->pub.free_in_buffer), tbuffer2, 16384 - dest->pub.free_in_buffer);
|
||||
tbuffer = g_renew (guchar, tbuffer, tbuffer_count);
|
||||
g_memmove (tbuffer + tbuffer_count - (16384 - dest->pub.free_in_buffer),
|
||||
tbuffer2, 16384 - dest->pub.free_in_buffer);
|
||||
}
|
||||
|
||||
gint
|
||||
static gint
|
||||
create_thumbnail (gint32 image_ID,
|
||||
gint32 drawable_ID,
|
||||
gdouble quality,
|
||||
gchar **thumbnail_buffer)
|
||||
guchar **thumbnail_buffer)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
gint req_width, req_height, bpp, rbpp;
|
||||
|
@ -1124,7 +1134,7 @@ create_thumbnail (gint32 image_ID,
|
|||
}
|
||||
|
||||
buf = g_new (guchar, req_width * bpp);
|
||||
tbuffer2 = g_new (gchar, 16384);
|
||||
tbuffer2 = g_new (guchar, 16384);
|
||||
|
||||
tbuffer_count = 0;
|
||||
|
||||
|
|
|
@ -60,13 +60,3 @@ gboolean save_image (const gchar *filename,
|
|||
gboolean preview);
|
||||
|
||||
gboolean save_dialog (void);
|
||||
|
||||
#ifdef HAVE_EXIF
|
||||
|
||||
gint create_thumbnail (gint32 image_ID,
|
||||
gint32 drawable_ID,
|
||||
gdouble quality,
|
||||
gchar **thumbnail_buffer);
|
||||
|
||||
#endif /* HAVE_EXIF */
|
||||
|
||||
|
|
|
@ -449,8 +449,8 @@ import_dialog_response (GtkWidget *dlg,
|
|||
if (response_id == GTK_RESPONSE_OK)
|
||||
{
|
||||
gchar *filename;
|
||||
gchar *buffer;
|
||||
gssize buffer_length;
|
||||
guchar *buffer;
|
||||
gssize buffer_length;
|
||||
GError *error = NULL;
|
||||
|
||||
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dlg));
|
||||
|
|
|
@ -493,7 +493,7 @@ run (const gchar *name,
|
|||
else if (! strcmp (name, "plug_in_metadata_import"))
|
||||
{
|
||||
const gchar *filename;
|
||||
gchar *buffer;
|
||||
guchar *buffer;
|
||||
gssize buffer_length;
|
||||
GError *error = NULL;
|
||||
|
||||
|
|
|
@ -767,14 +767,13 @@ xmp_model_parse_file (XMPModel *xmp_model,
|
|||
const gchar *filename,
|
||||
GError **error)
|
||||
{
|
||||
gchar *buffer;
|
||||
gssize buffer_length;
|
||||
gchar *buffer;
|
||||
gsize buffer_length;
|
||||
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
if (! g_file_get_contents (filename, &buffer, &buffer_length, error))
|
||||
return FALSE;
|
||||
if (! xmp_model_parse_buffer (xmp_model, buffer, buffer_length,
|
||||
TRUE, error))
|
||||
if (! xmp_model_parse_buffer (xmp_model, buffer, buffer_length, TRUE, error))
|
||||
return FALSE;
|
||||
g_free (buffer);
|
||||
return TRUE;
|
||||
|
|
|
@ -997,7 +997,7 @@ array_sxhash (LISP a, long n)
|
|||
char_data = (unsigned char *) a->storage_as.string_array.data[i];
|
||||
if (char_data != NULL)
|
||||
{
|
||||
len = strlen (char_data);
|
||||
len = strlen ((const char *) char_data);
|
||||
for (j = 0; j < len; ++j)
|
||||
hash = HASH_COMBINE (hash, *char_data++, n);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue