diff --git a/ChangeLog b/ChangeLog index 64849ec9aa..554a7f7d93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Mar 24 22:48:43 2011 Tanaka Akira + + * ext/sdbm/_sdbm.c: parenthesize macro arguments. + Thu Mar 24 14:45:57 2011 NARUSE, Yui * ext/openssl/ossl.c: surpress warning: shorten-64-to-32. diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c index efab2dcb79..5e2b8cc9f3 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"*/