DEVEL15-linux-warning-reduction-20090318
[openafs.git] / src / config / stds.h
index 43bef04..3437994 100644 (file)
@@ -231,7 +231,7 @@ typedef struct afs_hyper_t {        /* unsigned 64 bit integers */
 
 #define SIGN 0x80000000
 #define hadd32(a,i) \
-    (((((a).low ^ (int)(i)) & SIGN) \
+    ((void)((((a).low ^ (int)(i)) & SIGN) \
       ? (((((a).low + (int)(i)) & SIGN) == 0) && (a).high++) \
       : (((a).low & (int)(i) & SIGN) && (a).high++)), \
      (a).low += (int)(i))
@@ -278,10 +278,13 @@ typedef struct afsUUID afsUUID;
 
 #ifdef AFS_HPUX_ENV
 #define static_inline static __inline
+#define hdr_static_inline static __inline
 #elif defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV)
 #define static_inline static
+#define hdr_static_inline
 #else
 #define static_inline static inline
+#define hdr_static_inline static inline
 #endif
 
 /* A macro that can be used when printf'ing 64 bit integers, as Unix and 
@@ -293,4 +296,11 @@ typedef struct afsUUID afsUUID;
 #define AFS_INT64_FMT "lld"
 #endif
 
+/* Functions to safely cast afs_int32 and afs_uint32 so they can be used in 
+ * printf statemements with %ld and %lu
+ */
+
+hdr_static_inline long int afs_cast_int32(afs_int32 d) { return (long int) d; }
+hdr_static_inline unsigned long int afs_cast_uint32(afs_uint32 d) { return (unsigned long int) d; }
+
 #endif /* OPENAFS_CONFIG_AFS_STDS_H */