[byzanz] gifenc: Fix cast-align warnings



commit 3ead9bad77e8cd3fc855de3f5038a31e8c69eef8
Author: Benjamin Otte <otte redhat com>
Date:   Wed Oct 10 19:03:37 2012 -0400

    gifenc: Fix cast-align warnings
    
    We know that the type is valid guint32-aligned data, so we can safely
    cast it. Tell gcc about it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662622

 gifenc/gifenc.c   |    4 ++--
 gifenc/quantize.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gifenc/gifenc.c b/gifenc/gifenc.c
index 50c98d5..561250d 100644
--- a/gifenc/gifenc.c
+++ b/gifenc/gifenc.c
@@ -487,7 +487,7 @@ gifenc_dither_rgb (guint8* target, guint target_rowstride,
   this_error = g_new0 (gint, (width + 2) * 3);
   next_error = g_new (gint, (width + 2) * 3);
   for (y = 0; y < height; y++) {
-    const guint32 *row = (const guint32 *) data;
+    const guint32 *row = (const guint32 *) (void *) data;
     gint *cur_error = this_error + 3;
     gint *cur_next_error = next_error;
     err[0] = err[1] = err[2] = 0;
@@ -546,7 +546,7 @@ gifenc_dither_rgb_with_full_image (guint8 *target, guint target_rowstride,
   this_error = g_new0 (gint, (width + 2) * 3);
   next_error = g_new (gint, (width + 2) * 3);
   for (y = 0; y < (int) height; y++) {
-    const guint32 *row = (const guint32 *) data;
+    const guint32 *row = (const guint32 *) (void *) data;
     gint *cur_error = this_error + 3;
     gint *cur_next_error = next_error;
     err[0] = err[1] = err[2] = 0;
diff --git a/gifenc/quantize.c b/gifenc/quantize.c
index 7eca4f9..1b5e9a5 100644
--- a/gifenc/quantize.c
+++ b/gifenc/quantize.c
@@ -374,7 +374,7 @@ gifenc_quantize_image (const guint8 *data, guint width, guint height,
   }
   
   for (y = 0; y < height; y++) {
-    row = (const guint32 *) data;
+    row = (const guint32 *) (void *) data;
     for (x = 0; x < width; x++) {
       gifenc_octree_add_color (&info, row[x] & 0xFFFFFF, 1);
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]