ruby-changes:18132
From: akr <ko1@a...>
Date: Fri, 10 Dec 2010 10:24:33 +0900 (JST)
Subject: [ruby-changes:18132] Ruby:r30150 (trunk): * dln.c: parenthesize macro arguments.
akr 2010-12-09 19:26:14 +0900 (Thu, 09 Dec 2010) New Revision: 30150 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30150 Log: * dln.c: parenthesize macro arguments. Modified files: trunk/ChangeLog trunk/dln.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30149) +++ ChangeLog (revision 30150) @@ -1,3 +1,7 @@ +Thu Dec 9 19:25:49 2010 Tanaka Akira <akr@f...> + + * dln.c: parenthesize macro arguments. + Thu Dec 9 18:51:06 2010 Tanaka Akira <akr@f...> * lib/webrick/accesslog.rb (WEBrick::AccessLog#format): support Index: dln.c =================================================================== --- dln.c (revision 30149) +++ dln.c (revision 30150) @@ -57,7 +57,7 @@ #include <sys/stat.h> #ifndef S_ISDIR -# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif #ifdef HAVE_SYS_PARAM_H @@ -137,7 +137,7 @@ static const char funcname_prefix[sizeof(FUNCNAME_PREFIX) - 1] = FUNCNAME_PREFIX; #define init_funcname(buf, file) do {\ - const char *base = file;\ + const char *base = (file);\ const size_t flen = init_funcname_len(&base);\ const size_t plen = sizeof(funcname_prefix);\ char *const tmp = ALLOCA_N(char, plen+flen+1);\ @@ -147,7 +147,7 @@ memcpy(tmp, funcname_prefix, plen);\ memcpy(tmp+plen, base, flen);\ tmp[plen+flen] = '\0';\ - *buf = tmp;\ + *(buf) = tmp;\ } while (0) #ifdef USE_DLN_A_OUT @@ -1132,7 +1132,7 @@ #define format_message(sublang) FormatMessage(\ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, \ - NULL, error, MAKELANGID(LANG_NEUTRAL, sublang), \ + NULL, error, MAKELANGID(LANG_NEUTRAL, (sublang)), \ message + len, size - len, NULL) if (format_message(SUBLANG_ENGLISH_US) == 0) format_message(SUBLANG_DEFAULT); @@ -1180,7 +1180,7 @@ { char *message[1024], errbuf[1024]; int i; -#define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1) +#define ERRBUF_APPEND(s) strncat(errbuf, (s), sizeof(errbuf)-strlen(errbuf)-1) snprintf(errbuf, sizeof(errbuf), "load failed - %s. ", pathname); if (loadquery(L_GETMESSAGES, &message[0], sizeof(message)) != -1) { @@ -1237,7 +1237,7 @@ do { \ *p++ = ((c = *file++) == '/') ? DLN_NEEDS_ALT_SEPARATOR : c; \ } while (c); \ - src = tmp; \ + (src) = tmp; \ } while (0) #else #define translit_separator(str) (void)(str) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/