widl #19: better guid hash

Huw D M Davies h.davies1 at physics.ox.ac.uk
Thu Jan 20 12:16:48 CST 2005


        Huw Davies <huw at codeweavers.com>
        Better guid hash.
Index: tools/widl//write_msft.c
===================================================================
RCS file: /home/wine/wine/tools/widl/write_msft.c,v
retrieving revision 1.13
diff -u -p -r1.13 write_msft.c
--- tools/widl//write_msft.c	19 Jan 2005 19:08:01 -0000	1.13
+++ tools/widl//write_msft.c	20 Jan 2005 18:14:43 -0000
@@ -181,7 +181,7 @@ static void ctl2_init_segdir(
  *  The hash key for the GUID.
  */
 static int ctl2_hash_guid(
-	REFGUID guid)                /* [I] The guid to find. */
+	REFGUID guid)                /* [I] The guid to hash. */
 {
     int hash;
     int i;
@@ -191,7 +191,7 @@ static int ctl2_hash_guid(
 	hash ^= ((const short *)guid)[i];
     }
 
-    return (hash & 0xf) | ((hash & 0x10) & (0 - !!(hash & 0xe0)));
+    return hash & 0x1f;
 }
 
 /****************************************************************************



More information about the wine-patches mailing list