[OpenAFS-devel] patch for stds.h

Hartmut Reuter reuter@rzg.mpg.de
Tue, 20 Aug 2002 10:40:22 +0200


Changing the length and offset fields from afs_int64 to afs_uint64 gave
strange results for CompareInt64 and SubtractInt64. Therefore it's
better to cast the values as signed in these macros.

/afs/ipp/.cs/openafs/openafs/src/config: cvs diff stds.h
Index: stds.h
===================================================================
RCS file: /cvs/openafs/src/config/stds.h,v
retrieving revision 1.7
diff -u -r1.7 stds.h
--- stds.h      2001/08/08 00:03:41     1.7
+++ stds.h      2002/08/20 08:27:39
@@ -54,8 +54,8 @@
 #define ZeroInt64(a)       (a) = 0
 #define AssignInt64(a, b)   *(a) = (b)
 #define AddInt64(a,b,c) *(c) = (a) + (b)
-#define SubtractInt64(a,b,c) *(c) = (a) - (b)
-#define CompareInt64(a,b) (a) - (b)
+#define SubtractInt64(a,b,c) *(c) = (afs_int64)(a) - (afs_int64)(b)
+#define CompareInt64(a,b) (afs_int64)(a) - (afs_int64)(b)
 #define NonZeroInt64(a)                (a)
 #define Int64ToInt32(a)    (a) & 0xFFFFFFFFL
 #define FillInt64(t,h,l) (t) = (h); (t) <<= 32; (t) |= (l);
/afs/ipp/.cs/openafs/openafs/src/config:
-- 
-----------------------------------------------------------------
Hartmut Reuter                           e-mail reuter@rzg.mpg.de
					   phone +49-89-3299-1328
RZG (Rechenzentrum Garching)               fax   +49-89-3299-1301 
Computing Center of the Max-Planck-Gesellschaft (MPG) and the
Institut fuer Plasmaphysik (IPP)
-----------------------------------------------------------------