[gimp/gimp-2-8] Bug 695980 - Dereferencing type-punned pointer compile warning



commit 2893b1199c5289a5e91439c7615c35e9a833131b
Author: Michael Natterer <mitch gimp org>
Date:   Sat Mar 23 00:04:51 2013 +0100

    Bug 695980 - Dereferencing type-punned pointer compile warning
    
    Use local variables to avoid type-punned pointer warning.

 app/core/gimp-transform-region.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/app/core/gimp-transform-region.c b/app/core/gimp-transform-region.c
index 9f7d5b2..87714c8 100644
--- a/app/core/gimp-transform-region.c
+++ b/app/core/gimp-transform-region.c
@@ -863,7 +863,12 @@ sample_bi (TileManager  *tm,
    *  out of bounds.
    */
   for (i = 0; i < 4; i++)
-    *(guint*) (&C[i]) = *(guint*) (bg_color);
+    {
+      guint *src = (guint *) bg_color;
+      guint *dst = (guint *) &C[i];
+
+      *dst = *src;
+    }
 
   tile_manager_read_pixel_data_1 (tm, x0, y0, C[0]);
   tile_manager_read_pixel_data_1 (tm, x1, y0, C[2]);


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