[Zodb-checkins] CVS: ZODB4/ZODB - TimeStamp.c:1.18.12.1

Jeremy Hylton jeremy@zope.com
Tue, 10 Dec 2002 11:26:33 -0500


Update of /cvs-repository/ZODB4/ZODB
In directory cvs.zope.org:/tmp/cvs-serv3038

Modified Files:
      Tag: ZODB4-Q-branch
	TimeStamp.c 
Log Message:
Backport fix for cmp() from ZODB3.

Return only -1, 0, 1.


=== ZODB4/ZODB/TimeStamp.c 1.18 => 1.18.12.1 ===
--- ZODB4/ZODB/TimeStamp.c:1.18	Mon Nov 25 16:52:27 2002
+++ ZODB4/ZODB/TimeStamp.c	Tue Dec 10 11:26:32 2002
@@ -105,7 +105,10 @@
 static int
 TimeStamp_compare(TimeStamp *v, TimeStamp *w)
 {
-    return memcmp(v->data, w->data, 8);
+    int cmp = memcmp(v->data, w->data, 8);
+    if (cmp < 0) return -1;
+    if (cmp > 0) return 1;
+    return 0;
 }
 
 static long