summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-08-30 15:07:12 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-08-30 15:07:12 +0000
commit0aa27306aa6d0cf199b7da521fa2b5fe324213d3 (patch)
tree5b747d1cae54bc761377f1bcc560c43d6d746201 /gdk-pixbuf
parent4a481c6d87bfe17753236303ba01447c78c5ef81 (diff)
downloadgdk-pixbuf-0aa27306aa6d0cf199b7da521fa2b5fe324213d3.tar.gz
Add a cast to avoid compiler warnings.
2005-08-30 Matthias Clasen <mclasen@redhat.com> * io-png.c (png_save_to_callback_write_func): Add a cast to avoid compiler warnings. * pixops/timescale.c (main): Declare src_buf, dest_buf as unsigned to avoid compiler warnings. * gdk-pixbuf-io.h: Declare the prefix and mask members of GdkPixbufModulePattern as char*, to avoid compiler warnings. * io-ani.c (ani_load_chunk): Use g_try_new() in some places.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/ChangeLog13
-rw-r--r--gdk-pixbuf/gdk-pixbuf-io.c2
-rw-r--r--gdk-pixbuf/gdk-pixbuf-io.h4
-rw-r--r--gdk-pixbuf/io-ani.c14
-rw-r--r--gdk-pixbuf/io-png.c2
-rw-r--r--gdk-pixbuf/pixops/timescale.c2
6 files changed, 24 insertions, 13 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index 7fb50a1df..b18e30f38 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,3 +1,16 @@
+2005-08-30 Matthias Clasen <mclasen@redhat.com>
+
+ * io-png.c (png_save_to_callback_write_func): Add a cast
+ to avoid compiler warnings.
+
+ * pixops/timescale.c (main): Declare src_buf, dest_buf as
+ unsigned to avoid compiler warnings.
+
+ * gdk-pixbuf-io.h: Declare the prefix and mask members of
+ GdkPixbufModulePattern as char*, to avoid compiler warnings.
+
+ * io-ani.c (ani_load_chunk): Use g_try_new() in some places.
+
2005-08-24 Matthias Clasen <mclasen@redhat.com>
* === Released 2.8.2 ===
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index f67dd0355..b330ea5ef 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -52,7 +52,7 @@ format_check (GdkPixbufModule *module, guchar *buffer, int size)
gchar m;
GdkPixbufModulePattern *pattern;
gboolean anchored;
- guchar *prefix, *mask;
+ gchar *prefix, *mask;
for (pattern = module->info->signature; pattern->prefix; pattern++) {
if (pattern->mask && pattern->mask[0] == '*') {
diff --git a/gdk-pixbuf/gdk-pixbuf-io.h b/gdk-pixbuf/gdk-pixbuf-io.h
index e64bee7e0..3fe9226c9 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.h
+++ b/gdk-pixbuf/gdk-pixbuf-io.h
@@ -75,8 +75,8 @@ typedef void (* GdkPixbufModuleUpdatedFunc) (GdkPixbuf *pixbuf,
typedef struct _GdkPixbufModulePattern GdkPixbufModulePattern;
struct _GdkPixbufModulePattern {
- unsigned char *prefix;
- unsigned char *mask;
+ char *prefix;
+ char *mask;
int relevance;
};
diff --git a/gdk-pixbuf/io-ani.c b/gdk-pixbuf/io-ani.c
index 5568ad65d..dd0ad7e40 100644
--- a/gdk-pixbuf/io-ani.c
+++ b/gdk-pixbuf/io-ani.c
@@ -366,12 +366,10 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
context->animation->width = 0;
context->animation->height = 0;
- context->animation->pixbufs = (GdkPixbuf**) g_try_malloc (sizeof (GdkPixbuf*) * context->NumFrames);
- if (context->animation->pixbufs)
- memset (context->animation->pixbufs, 0, sizeof (GdkPixbuf*) * context->NumFrames);
-
- context->animation->delay = (guint32*) g_try_malloc (sizeof (guint32) * context->NumSteps);
- context->animation->sequence = (guint32*) g_try_malloc (sizeof (guint32) * context->NumSteps);
+ context->animation->pixbufs = g_try_new0 (GdkPixbuf*, context->NumFrames);
+ context->animation->delay = g_try_new (gint, context->NumSteps);
+ context->animation->sequence = g_try_new (gint, context->NumSteps);
+
if (!context->animation->pixbufs ||
!context->animation->delay ||
!context->animation->sequence)
@@ -442,7 +440,7 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
return FALSE;
}
context->title[context->chunk_size] = 0;
- read_int8 (context, context->title, context->chunk_size);
+ read_int8 (context, (guchar *)context->title, context->chunk_size);
#ifdef DEBUG_ANI
g_print ("INAM %s\n", context->title);
#endif
@@ -461,7 +459,7 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
return FALSE;
}
context->author[context->chunk_size] = 0;
- read_int8 (context, context->author, context->chunk_size);
+ read_int8 (context, (guchar *)context->author, context->chunk_size);
#ifdef DEBUG_ANI
g_print ("IART %s\n", context->author);
#endif
diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c
index 25a2bb606..deab99ae1 100644
--- a/gdk-pixbuf/io-png.c
+++ b/gdk-pixbuf/io-png.c
@@ -754,7 +754,7 @@ png_save_to_callback_write_func (png_structp png_ptr,
{
SaveToFunctionIoPtr *ioptr = png_get_io_ptr (png_ptr);
- if (!ioptr->save_func (data, length, ioptr->error, ioptr->user_data)) {
+ if (!ioptr->save_func ((gchar *)data, length, ioptr->error, ioptr->user_data)) {
/* If save_func has already set an error, which it
should have done, this won't overwrite it. */
png_error (png_ptr, "write function failed");
diff --git a/gdk-pixbuf/pixops/timescale.c b/gdk-pixbuf/pixops/timescale.c
index a7fffc488..945cf8003 100644
--- a/gdk-pixbuf/pixops/timescale.c
+++ b/gdk-pixbuf/pixops/timescale.c
@@ -118,7 +118,7 @@ dump_array (double times[3][3][4])
int main (int argc, char **argv)
{
int src_width, src_height, dest_width, dest_height;
- char *src_buf, *dest_buf;
+ unsigned char *src_buf, *dest_buf;
int src_index, dest_index;
int i;
double scale_times[3][3][4];