summaryrefslogtreecommitdiff
path: root/ext/sdbm
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-24 13:49:26 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-24 13:49:26 +0000
commit9de5f281cdcddcdb9479a4418f8dc2c7d415625a (patch)
tree1ddeefcadd87b3130385bb3f40cd51013d26e825 /ext/sdbm
parent3a16cc24e84704e5b3939f886ba036ea6c4c77c6 (diff)
* ext/sdbm/_sdbm.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/sdbm')
-rw-r--r--ext/sdbm/_sdbm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index efab2dc..5e2b8cc 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -30,9 +30,9 @@
#ifdef BSD42
#define SEEK_SET L_SET
-#define memset(s,c,n) bzero(s, n) /* only when c is zero */
-#define memcpy(s1,s2,n) bcopy(s2, s1, n)
-#define memcmp(s1,s2,n) bcmp(s1,s2,n)
+#define memset(s,c,n) bzero((s), (n)) /* only when c is zero */
+#define memcpy(s1,s2,n) bcopy((s2), (s1), (n))
+#define memcmp(s1,s2,n) bcmp((s1),(s2),(n))
#endif
/*
@@ -60,8 +60,8 @@
#define GET_SHORT(p, i) (((unsigned)((unsigned char *)(p))[(i)*2] << 8) + (((unsigned char *)(p))[(i)*2 + 1]))
#define PUT_SHORT(p, i, s) (((unsigned char *)(p))[(i)*2] = (unsigned char)((s) >> 8), ((unsigned char *)(p))[(i)*2 + 1] = (unsigned char)(s))
#else
-#define GET_SHORT(p, i) ((p)[i])
-#define PUT_SHORT(p, i, s) ((p)[i] = (s))
+#define GET_SHORT(p, i) ((p)[(i)])
+#define PUT_SHORT(p, i, s) ((p)[(i)] = (s))
#endif
/*#include "pair.h"*/