summaryrefslogtreecommitdiff
path: root/security/mhash/files/patch-include-mutils-mutils.h
blob: a5418c03fd80b748b01f3ce30a81f5262eb9dbdd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
diff -urN -x .svn ../../branches/mhash-dist/include/mutils/mutils.h ./include/mutils/mutils.h
--- ../../branches/mhash-dist/include/mutils/mutils.h	2008-01-16 02:34:17.000000000 +0200
+++ ./include/mutils/mutils.h	2008-01-16 02:42:32.000000000 +0200
@@ -103,22 +103,22 @@
 #endif
 
 #if defined(false)
-#define MUTILS_FALSE (mutils_boolean) false
+#define MUTILS_FALSE ((mutils_boolean) false)
 #else
 #if defined(FALSE)
-#define MUTILS_FALSE (mutils_boolean) FALSE
+#define MUTILS_FALSE ((mutils_boolean) FALSE)
 #else
-#define MUTILS_FALSE (mutils_boolean) 0
+#define MUTILS_FALSE ((mutils_boolean) 0)
 #endif /* FALSE */
 #endif /* false */
 
 #if defined(true)
-#define MUTILS_TRUE (mutils_boolean) true
+#define MUTILS_TRUE ((mutils_boolean) true)
 #else
 #if defined(TRUE)
-#define MUTILS_TRUE (mutils_boolean) TRUE
+#define MUTILS_TRUE ((mutils_boolean) TRUE)
 #else
-#define MUTILS_TRUE (mutils_boolean) -1
+#define MUTILS_TRUE ((mutils_boolean) -1)
 #endif /* TRUE */
 #endif /* true */
 
@@ -167,16 +167,16 @@
 
 #define mutils_swapendian32(a) \
 	((mutils_word32) \
-		(((a & (mutils_word32) 0x000000ffU) << 24) | \
-		 ((a & (mutils_word32) 0x0000ff00U) << 8)  | \
-		 ((a & (mutils_word32) 0x00ff0000U) >> 8)  | \
-		 ((a & (mutils_word32) 0xff000000U) >> 24))  \
+		((((a) & (mutils_word32) 0x000000ffU) << 24) | \
+		 (((a) & (mutils_word32) 0x0000ff00U) << 8)  | \
+		 (((a) & (mutils_word32) 0x00ff0000U) >> 8)  | \
+		 (((a) & (mutils_word32) 0xff000000U) >> 24))  \
 	)
 
 #define mutils_swapendian16(a) \
 	((mutils_word16) \
-		(((a & (mutils_word16) 0x00ffU) << 8) | \
-		 ((a & (mutils_word16) 0xff00U) >> 8))  \
+		((((a) & (mutils_word16) 0x00ffU) << 8) | \
+		 (((a) & (mutils_word16) 0xff00U) >> 8))  \
 	 )
 
 
@@ -193,30 +193,30 @@
 #define mutils_lend32(n) mutils_swapendian32(n)
 #define mutils_lend16(n) mutils_swapendian16(n)
 
-#define mutils_bend64(n) n
-#define mutils_bend32(n) n
-#define mutils_bend16(n) n
+#define mutils_bend64(n) (n)
+#define mutils_bend32(n) (n)
+#define mutils_bend16(n) (n)
 
 #define mutils_lend2sys64(n) mutils_swapendian64(n)
 #define mutils_lend2sys32(n) mutils_swapendian32(n)
 #define mutils_lend2sys16(n) mutils_swapendian16(n)
 
-#define mutils_bend2sys32(n) n
-#define mutils_bend2sys16(n) n
+#define mutils_bend2sys32(n) (n)
+#define mutils_bend2sys16(n) (n)
 
 #else
 
-#define mutils_lend64(n) n
-#define mutils_lend32(n) n
-#define mutils_lend16(n) n
+#define mutils_lend64(n) (n)
+#define mutils_lend32(n) (n)
+#define mutils_lend16(n) (n)
 
 #define mutils_bend64(n) mutils_swapendian64(n)
 #define mutils_bend32(n) mutils_swapendian32(n)
 #define mutils_bend16(n) mutils_swapendian16(n)
 
-#define mutils_lend2sys64(n) n
-#define mutils_lend2sys32(n) n
-#define mutils_lend2sys16(n) n
+#define mutils_lend2sys64(n) (n)
+#define mutils_lend2sys32(n) (n)
+#define mutils_lend2sys16(n) (n)
 
 #define mutils_bend2sys64(n) mutils_swapendian64(n)
 #define mutils_bend2sys32(n) mutils_swapendian32(n)