[Kde-bindings] KDE/kdebindings/csharp/qyoto

Richard Dale Richard_Dale at tipitina.demon.co.uk
Mon May 28 14:42:41 UTC 2007


SVN commit 669114 by rdale:

* Attempted to add a QyotoHash function that will compile on 64 bit 
  machines

CCMAIL: kde-bindings at kde.org



 M  +2 -0      ChangeLog  
 M  +13 -1     src/qyoto.cpp  


--- trunk/KDE/kdebindings/csharp/qyoto/ChangeLog #669113:669114
@@ -9,6 +9,8 @@
 	  before the method call, the value after the method call doesn't need
 	  to be copied back.
 	* Added a marshaller for 'short&' and 'short*' arg types
+	* Attempted to add a QyotoHash function that will compile on 64 bit 
+	  machines
 
 2007-05-27  Arno Rehn  <arno at arnorehn.de>
 
--- trunk/KDE/kdebindings/csharp/qyoto/src/qyoto.cpp #669113:669114
@@ -1646,6 +1646,18 @@
 	application_terminated = true;
 }
 
+/* 
+	Based on this function from QtCore/qhash.h:
+
+	inline uint qHash(ulong key)
+	{
+		if (sizeof(ulong) > sizeof(uint)) {
+			return uint((key >> (8 * sizeof(uint) - 1)) ^ key);
+		} else {
+			return uint(key);
+		}
+	}
+*/
 int 
 QyotoHash(void * obj)
 {
@@ -1656,7 +1668,7 @@
 		qint64 key = (qint64) o->ptr;
 		return (int) ((key >> (8 * sizeof(int) - 1)) ^ key);
 	} else {
-		return (int) o->ptr;
+		return (int) (o->ptr & 0xFFFFFFFF);
 	}
 }
 



More information about the Kde-bindings mailing list