OSSP CVS Repository

ossp - Check-in [4976]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4976
Date: 2005-Jan-24 15:33:12 (local)
2005-Jan-24 14:33:12 (UTC)
User:rse
Branch:
Comment: double-casting to get rid of 'cast increases required alignment of target type' warnings from GCC which are fine but not true in this case because the stuff is properly aligned
Tickets:
Inspections:
Files:
ossp-pkg/cfg/cfg_grid.c      1.7 -> 1.8     3 inserted, 3 deleted

ossp-pkg/cfg/cfg_grid.c 1.7 -> 1.8

--- cfg_grid.c   2004/12/31 19:16:25     1.7
+++ cfg_grid.c   2005/01/24 14:33:12     1.8
@@ -110,7 +110,7 @@
 #define CFG_RING_ELEM(type) \
     struct { type *next; type *prev; }
 #define CFG_RING_SENTINEL(hp, type, field) \
-    (type *)((char *)(hp) - ((size_t)(&((type *)0)->field)))
+    (type *)(void *)((char *)(hp) - ((size_t)(&((type *)0)->field)))
 #define CFG_RING_INIT(hp, type, field) \
     do { CFG_RING_FIRST((hp)) = CFG_RING_SENTINEL((hp), type, field); \
          CFG_RING_LAST((hp))  = CFG_RING_SENTINEL((hp), type, field); } while (0)
@@ -238,7 +238,7 @@
 
     /* initialize first segment */
     CFG_RING_ELEM_INIT(seg, gs_link);
-    seg->gs_tile_base = (cfg_grid_tile_t *)((char *)seg + seg_top_size);
+    seg->gs_tile_base = (cfg_grid_tile_t *)(void *)((char *)seg + seg_top_size);
     seg->gs_tile_num = tile_num;
     CFG_LIST_ELEM_INIT(seg->gs_tile_base, gt_link);
     CFG_LIST_INIT(&seg->gs_tile_free_list);
@@ -248,7 +248,7 @@
     /* initialize free tile list in first segment */
     tile = CFG_LIST_FIRST(&seg->gs_tile_free_list);
     for (i = 0; i < seg->gs_tile_free_num-1; i++) {
-        CFG_LIST_NEXT(tile, gt_link) = (cfg_grid_tile_t *)((char *)tile+tile_size);
+        CFG_LIST_NEXT(tile, gt_link) = (cfg_grid_tile_t *)(void *)((char *)tile+tile_size);
         tile = CFG_LIST_NEXT(tile, gt_link);
     }
     CFG_LIST_NEXT(tile, gt_link) = NULL;

CVSTrac 2.0.1