Bugzilla bug #21428: fixed LL_CMP and LL_UCMP so that they can be used ANDREAS_URL2_BASE
authorwtc%netscape.com
Mon, 31 Jan 2000 21:41:08 +0000
changeset 1124 1db2390649b8e5ff44a95024865f04a7caa07078
parent 1117 bb58dea01c82284903dba2d07a1370a811d26d86
child 1125 447e1ce2ea5e3d440489a03a0e8355da4d8c0f56
child 1129 1d403fb1a470959b1170c17113d8e0267d735535
push idunknown
push userunknown
push dateunknown
bugs21428
Bugzilla bug #21428: fixed LL_CMP and LL_UCMP so that they can be used with the <= and >= operators when HAVE_LONG_LONG is not defined. The fix is contributed by John G. Myers <jgmyers@netscape.com>. r=wtc@netscape.com.
pr/include/prlong.h
--- a/pr/include/prlong.h
+++ b/pr/include/prlong.h
@@ -183,20 +183,20 @@ NSPR_API(PRInt64) LL_Zero(void);
 #define LL_INIT(hi, lo) {PR_INT32(hi), PR_INT32(lo)}
 #endif
 
 #define LL_IS_ZERO(a)        (((a).hi == 0) && ((a).lo == 0))
 #define LL_EQ(a, b)        (((a).hi == (b).hi) && ((a).lo == (b).lo))
 #define LL_NE(a, b)        (((a).hi != (b).hi) || ((a).lo != (b).lo))
 #define LL_GE_ZERO(a)        (((a).hi >> 31) == 0)
 
-#define LL_CMP(a, op, b)    (((PRInt32)(a).hi op (PRInt32)(b).hi) || \
-                 (((a).hi == (b).hi) && ((a).lo op (b).lo)))
-#define LL_UCMP(a, op, b)    (((a).hi op (b).hi) || \
-                 (((a).hi == (b).hi) && ((a).lo op (b).lo)))
+#define LL_CMP(a, op, b)    (((a).hi == (b).hi) ? ((a).lo op (b).lo) : \
+                 ((PRInt32)(a).hi op (PRInt32)(b).hi))
+#define LL_UCMP(a, op, b)    (((a).hi == (b).hi) ? ((a).lo op (b).lo) : \
+                 ((a).hi op (b).hi))
 
 #define LL_AND(r, a, b)        ((r).lo = (a).lo & (b).lo, \
                  (r).hi = (a).hi & (b).hi)
 #define LL_OR(r, a, b)        ((r).lo = (a).lo | (b).lo, \
                  (r).hi = (a).hi | (b).hi)
 #define LL_XOR(r, a, b)        ((r).lo = (a).lo ^ (b).lo, \
                  (r).hi = (a).hi ^ (b).hi)
 #define LL_OR2(r, a)        ((r).lo = (r).lo | (a).lo, \