Don't do pointer arithmetics on void*
authorHaakon Sporsheim <haakon.sporsheim@gmail.com>
Thu, 7 Jan 2010 08:12:13 +0000 (10:12 +0200)
committerTor Lillqvist <tml@iki.fi>
Thu, 7 Jan 2010 08:14:24 +0000 (10:14 +0200)
For instance MSVC doesn't like that.

Signed-off-by: Tor Lillqvist <tml@iki.fi>
gobject/gatomicarray.c

index a7b53a0..2c2a09c 100644 (file)
@@ -77,7 +77,7 @@ freelist_alloc (gsize size, gboolean reuse)
 
   real_size = sizeof (gsize) + MAX (size, sizeof (FreeListNode));
   mem = g_slice_alloc (real_size);
-  mem += sizeof (gsize);
+  mem = ((char *) mem) + sizeof (gsize);
   G_ATOMIC_ARRAY_DATA_SIZE (mem) = size;
   return mem;
 }