glib r6316 - trunk/gio



Author: alexl
Date: Tue Jan 15 11:47:04 2008
New Revision: 6316
URL: http://svn.gnome.org/viewvc/glib?rev=6316&view=rev

Log:
2008-01-15  Alexander Larsson  <alexl redhat com>

        * gmemoryinputstream.c:
        * gmemoryoutputstream.c:
	Don't do pointer arithmetic on void * (#508602)
	Patch from Kazuki IWAMOTO



Modified:
   trunk/gio/ChangeLog
   trunk/gio/gmemoryinputstream.c
   trunk/gio/gmemoryoutputstream.c

Modified: trunk/gio/gmemoryinputstream.c
==============================================================================
--- trunk/gio/gmemoryinputstream.c	(original)
+++ trunk/gio/gmemoryinputstream.c	Tue Jan 15 11:47:04 2008
@@ -283,7 +283,7 @@
       chunk = (Chunk *)l->data;
       size = MIN (rest, chunk->len - start);
 
-      memcpy (buffer + (count - rest), chunk->data + start, size);
+      memcpy ((guint8 *)buffer + (count - rest), chunk->data + start, size);
       rest -= size;
 
       start = 0;

Modified: trunk/gio/gmemoryoutputstream.c
==============================================================================
--- trunk/gio/gmemoryoutputstream.c	(original)
+++ trunk/gio/gmemoryoutputstream.c	Tue Jan 15 11:47:04 2008
@@ -313,7 +313,7 @@
     }
 
   if (size > len)
-    memset (data + len, 0, size - len);
+    memset ((guint8 *)data + len, 0, size - len);
 
   priv->data = data;
   priv->len = size;
@@ -365,7 +365,7 @@
      only added part of the required memory */
   count = MIN (count, priv->len - priv->pos);
   
-  dest = priv->data + priv->pos;
+  dest = (guint8 *)priv->data + priv->pos;
   memcpy (dest, buffer, count); 
   priv->pos += count;
 



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