glib r6861 - in trunk: . glib



Author: ebassi
Date: Thu Apr 17 12:29:26 2008
New Revision: 6861
URL: http://svn.gnome.org/viewvc/glib?rev=6861&view=rev

Log:
2008-04-17  Emmanuele Bassi  <ebassi gnome org>

	* glib/gchecksum.c:
	(sha_byte_reverse): Use the macro GLib provides for byte-swapping
	as it can be optimized.
	
	(g_checksum_update): Fix a compiler warning.

Modified:
   trunk/ChangeLog
   trunk/glib/gchecksum.c

Modified: trunk/glib/gchecksum.c
==============================================================================
--- trunk/glib/gchecksum.c	(original)
+++ trunk/glib/gchecksum.c	Thu Apr 17 12:29:26 2008
@@ -122,10 +122,7 @@
   length /= sizeof (guint32);
   while (length--)
     {
-      *buffer = ((guint32) (((*buffer & (guint32) 0x000000ffU) << 24) |
-                            ((*buffer & (guint32) 0x0000ff00U) <<  8) |
-                            ((*buffer & (guint32) 0x00ff0000U) >>  8) |
-                            ((*buffer & (guint32) 0xff000000U) >> 24)));
+      *buffer = GUINT32_SWAP_LE_BE (*buffer);
       ++buffer;
     }
 }
@@ -1204,7 +1201,7 @@
   g_return_if_fail (data != NULL);
 
   if (length < 0)
-    length = strlen (data);
+    length = strlen ((const gchar *) data);
 
   if (checksum->digest_str)
     {



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