stock-icons broken cross-platform ?



the deserialization GdkPixdata fails (at least on win32 with msvc) because
the guint32 istream pointer is only incremented by 1 byte, if it is done
within the g_ntohl() macro.
 
the following patch cures the problem. 
Is it ok to apply, though it probably works around a compiler bug?

Thanks,
	Hans

--- from-cvs/gtk+/gdk-pixbuf/gdk-pixdata.c	Fri Jun 29 03:59:00 2001
+++ my-gtk/gtk+/gdk-pixbuf/gdk-pixdata.c	Sun Jul 01 18:59:46 2001
@@ -192,14 +192,14 @@
 
   /* deserialize header */
   istream = (guint32*) stream;
-  pixdata->magic = g_ntohl (*istream++);
-  pixdata->length = g_ntohl (*istream++);
+  pixdata->magic = g_ntohl (*istream); istream++;
+  pixdata->length = g_ntohl (*istream); istream++;
   if (pixdata->magic != GDK_PIXBUF_MAGIC_NUMBER || pixdata->length <
GDK_PIXDATA_HEADER_LENGTH)
     return_header_corrupt (error);
-  pixdata->pixdata_type = g_ntohl (*istream++);
-  pixdata->rowstride = g_ntohl (*istream++);
-  pixdata->width = g_ntohl (*istream++);
-  pixdata->height = g_ntohl (*istream++);
+  pixdata->pixdata_type = g_ntohl (*istream); istream++;
+  pixdata->rowstride = g_ntohl (*istream); istream++;
+  pixdata->width = g_ntohl (*istream); istream++;
+  pixdata->height = g_ntohl (*istream);  istream++;
   if (pixdata->width < 1 || pixdata->height < 1 ||
       pixdata->rowstride < pixdata->width)
     return_header_corrupt (error);


-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert




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