diff options
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 4 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-io.c | 4 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixdata.c | 34 | ||||
-rw-r--r-- | gdk-pixbuf/io-jpeg.c | 2 | ||||
-rw-r--r-- | gdk-pixbuf/io-pcx.c | 10 | ||||
-rw-r--r-- | gdk-pixbuf/io-png.c | 2 | ||||
-rw-r--r-- | gdk-pixbuf/io-pnm.c | 8 | ||||
-rw-r--r-- | gdk-pixbuf/io-tiff.c | 6 | ||||
-rw-r--r-- | gdk-pixbuf/io-wbmp.c | 2 | ||||
-rw-r--r-- | gdk-pixbuf/pixops/timescale.c | 9 | ||||
-rw-r--r-- | gdk-pixbuf/queryloaders.c | 2 |
11 files changed, 25 insertions, 58 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index b72ed39b2f..7da70a49f1 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,7 @@ +2006-10-08 Matthias Clasen <mclasen@redhat.com> + + * Apply a cleanup patch by Kjartan Maraas (#341812) + 2006-09-06 Matthias Clasen <mclasen@redhat.com> * io-pnm.c: Simplify and fix reading of ASCII images. diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index 95103ff95f..9b83f4b48a 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -123,7 +123,7 @@ _gdk_pixbuf_unlock (GdkPixbufModule *image_module) static GSList *file_formats = NULL; -static void gdk_pixbuf_io_init (); +static void gdk_pixbuf_io_init (void); static GSList * get_file_formats (void) @@ -1138,7 +1138,7 @@ gdk_pixbuf_new_from_file_at_scale (const char *filename, animation = gdk_pixbuf_loader_get_animation (loader); if (animation) { - iter = gdk_pixbuf_animation_get_iter (animation, 0); + iter = gdk_pixbuf_animation_get_iter (animation, NULL); if (!gdk_pixbuf_animation_iter_on_currently_loading_frame (iter)) { has_frame = TRUE; } diff --git a/gdk-pixbuf/gdk-pixdata.c b/gdk-pixbuf/gdk-pixdata.c index 024bac9d5f..f7be7780ba 100644 --- a/gdk-pixbuf/gdk-pixdata.c +++ b/gdk-pixbuf/gdk-pixdata.c @@ -620,7 +620,7 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata, GdkPixdataDumpType dump_type) { CSourceData cdata = { 0, }; - gchar *s_uint_8, *s_uint_32, *s_uint, *s_char, *s_null; + gchar *s_uint_8; guint bpp, width, height, rowstride; gboolean rle_encoded; gchar *macro_name; @@ -670,37 +670,13 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata, cdata.gstring = gstring; if (!cdata.dump_macros && cdata.dump_gtypes) - { - s_uint_8 = "guint8 "; - s_uint_32 = "guint32"; - s_uint = "guint "; - s_char = "gchar "; - s_null = "NULL"; - } + s_uint_8 = "guint8 "; else if (!cdata.dump_macros) - { - s_uint_8 = "unsigned char"; - s_uint_32 = "unsigned int "; - s_uint = "unsigned int "; - s_char = "char "; - s_null = "(char*) 0"; - } + s_uint_8 = "unsigned char"; else if (cdata.dump_macros && cdata.dump_gtypes) - { - s_uint_8 = "guint8"; - s_uint_32 = "guint32"; - s_uint = "guint"; - s_char = "gchar"; - s_null = "NULL"; - } + s_uint_8 = "guint8"; else /* cdata.dump_macros && !cdata.dump_gtypes */ - { - s_uint_8 = "unsigned char"; - s_uint_32 = "unsigned int"; - s_uint = "unsigned int"; - s_char = "char"; - s_null = "(char*) 0"; - } + s_uint_8 = "unsigned char"; /* initial comment */ diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c index 96b3453b04..3ec2292b41 100644 --- a/gdk-pixbuf/io-jpeg.c +++ b/gdk-pixbuf/io-jpeg.c @@ -808,8 +808,6 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data, continue; } } - - return TRUE; } /* Save */ diff --git a/gdk-pixbuf/io-pcx.c b/gdk-pixbuf/io-pcx.c index e6de063161..e4d375fe7c 100644 --- a/gdk-pixbuf/io-pcx.c +++ b/gdk-pixbuf/io-pcx.c @@ -236,14 +236,12 @@ pcx_chop_context_buf(struct pcx_context *context, guint size) { guint i, j; - if(size > context->buf_pos) + if (size > context->buf_pos) return FALSE; - else if(size < 0) - return FALSE; - else if(size == 0) + else if (size == 0) return TRUE; - for(i = 0, j = size; j < context->buf_pos; i++, j++) + for (i = 0, j = size; j < context->buf_pos; i++, j++) context->buf[i] = context->buf[j]; context->buf_pos -= size; @@ -629,7 +627,7 @@ gdk_pixbuf__pcx_load_increment(gpointer data, const guchar *buf, guint size, case 4: case 8: if(context->num_planes != 1) { - g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_UNKNOWN_TYPE, _("Image has unsupported number of %d-bit planes"), context->bpp); + g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_UNKNOWN_TYPE, _("Image has unsupported number of %d-bit planes"), (gint)context->bpp); return FALSE; } break; diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c index f662c07da1..f6b1bc1ede 100644 --- a/gdk-pixbuf/io-png.c +++ b/gdk-pixbuf/io-png.c @@ -660,7 +660,7 @@ png_row_callback (png_structp png_read_ptr, if (lc->fatal_error_occurred) return; - if (row_num < 0 || row_num >= lc->pixbuf->height) { + if (row_num >= lc->pixbuf->height) { lc->fatal_error_occurred = TRUE; if (lc->error && *lc->error == NULL) { g_set_error (lc->error, diff --git a/gdk-pixbuf/io-pnm.c b/gdk-pixbuf/io-pnm.c index 08489ef988..efba937444 100644 --- a/gdk-pixbuf/io-pnm.c +++ b/gdk-pixbuf/io-pnm.c @@ -108,19 +108,17 @@ explode_bitmap_into_buf (PnmLoaderContext *context) guchar *from, *to, data; gint bit; guchar *dptr; - gint wid, x, y; + gint wid, x; g_return_if_fail (context != NULL); g_return_if_fail (context->dptr != NULL); /* I'm no clever bit-hacker so I'm sure this can be optimized */ dptr = context->dptr; - y = context->output_row; wid = context->width; from = dptr + ((wid - 1) / 8); to = dptr + (wid - 1) * 3; -/* bit = 7 - (((y+1)*wid-1) % 8); */ bit = 7 - ((wid-1) % 8); /* get first byte and align properly */ @@ -892,8 +890,6 @@ gdk_pixbuf__pnm_image_load_increment (gpointer data, { PnmLoaderContext *context = (PnmLoaderContext *)data; PnmIOBuffer *inbuf; - guchar *old_byte; - guint old_nbytes; const guchar *bufhd; guint num_left, spinguard; gint retval; @@ -905,8 +901,6 @@ gdk_pixbuf__pnm_image_load_increment (gpointer data, bufhd = buf; inbuf = &context->inbuf; - old_nbytes = inbuf->nbytes; - old_byte = inbuf->byte; num_left = size; spinguard = 0; diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c index d850243321..455d3691d7 100644 --- a/gdk-pixbuf/io-tiff.c +++ b/gdk-pixbuf/io-tiff.c @@ -430,7 +430,7 @@ tiff_load_seek (thandle_t handle, toff_t offset, int whence) switch (whence) { case SEEK_SET: - if (offset > context->used || offset < 0) + if (offset > context->used) return -1; context->pos = offset; break; @@ -446,7 +446,6 @@ tiff_load_seek (thandle_t handle, toff_t offset, int whence) break; default: return -1; - break; } return context->pos; } @@ -622,8 +621,6 @@ tiff_save_seek (thandle_t handle, toff_t offset, int whence) switch (whence) { case SEEK_SET: - if (offset < 0) - return -1; context->pos = offset; break; case SEEK_CUR: @@ -634,7 +631,6 @@ tiff_save_seek (thandle_t handle, toff_t offset, int whence) break; default: return -1; - break; } return context->pos; } diff --git a/gdk-pixbuf/io-wbmp.c b/gdk-pixbuf/io-wbmp.c index 24779b97e2..94a6f61e11 100644 --- a/gdk-pixbuf/io-wbmp.c +++ b/gdk-pixbuf/io-wbmp.c @@ -166,7 +166,7 @@ static gboolean get_mbi(struct wbmp_progressive_state *context, const guchar **buf, guint *buf_size, int *val) { guchar intbuf[16]; - int i, n; + int n; gboolean rv; *val = 0; diff --git a/gdk-pixbuf/pixops/timescale.c b/gdk-pixbuf/pixops/timescale.c index 945cf8003e..b02bc3e31f 100644 --- a/gdk-pixbuf/pixops/timescale.c +++ b/gdk-pixbuf/pixops/timescale.c @@ -26,12 +26,13 @@ static GTimeVal start_time; -void start_timing (void) +static void +start_timing (void) { g_get_current_time (&start_time); } -double +static double stop_timing (const char *test, int iterations, int bytes) { GTimeVal stop_time; @@ -53,7 +54,7 @@ stop_timing (const char *test, int iterations, int bytes) return ((double)bytes * iterations) / (1000*msecs); } -void +static void init_array (double times[3][3][4]) { int i, j, k; @@ -64,7 +65,7 @@ init_array (double times[3][3][4]) times[i][j][k] = -1; } -void +static void dump_array (double times[3][3][4]) { int i, j; diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c index bec11f0d24..11be6036ca 100644 --- a/gdk-pixbuf/queryloaders.c +++ b/gdk-pixbuf/queryloaders.c @@ -38,7 +38,7 @@ #include "gdk-pixbuf/gdk-pixbuf-private.h" #include "gdk-pixbuf/gdk-pixbuf-io.h" -#if USE_LA_MODULES +#ifdef USE_LA_MODULES #define SOEXT ".la" #else #define SOEXT ("." G_MODULE_SUFFIX) |