OSDN Git Service

2008-05-14 Jeff Johnston <jjohnstn@redhat.com>
authorjjohnstn <jjohnstn>
Wed, 14 May 2008 22:09:10 +0000 (22:09 +0000)
committerjjohnstn <jjohnstn>
Wed, 14 May 2008 22:09:10 +0000 (22:09 +0000)
        * libc/include/sys/reent.h: Change _REENT_INIT... macros to
        access macro parameter with parentheses around it.

newlib/libc/include/sys/reent.h

index 37fad56..0daa6cb 100644 (file)
@@ -430,35 +430,35 @@ extern const struct __sFILE_fake __sf_fake_stderr;
   }
 
 #define _REENT_INIT_PTR(var) \
-  { var->_stdin = (__FILE *)&__sf_fake_stdin; \
-    var->_stdout = (__FILE *)&__sf_fake_stdout; \
-    var->_stderr = (__FILE *)&__sf_fake_stderr; \
-    var->_errno = 0; \
-    var->_inc = 0; \
-    var->_emergency = _NULL; \
-    var->__sdidinit = 0; \
-    var->_current_category = 0; \
-    var->_current_locale = "C"; \
-    var->_mp = _NULL; \
-    var->__cleanup = _NULL; \
-    var->_gamma_signgam = 0; \
-    var->_cvtlen = 0; \
-    var->_cvtbuf = _NULL; \
-    var->_r48 = _NULL; \
-    var->_localtime_buf = _NULL; \
-    var->_asctime_buf = _NULL; \
-    var->_sig_func = _NULL; \
-    var->_atexit = _NULL; \
-    var->_atexit0._next = _NULL; \
-    var->_atexit0._ind = 0; \
-    var->_atexit0._fns[0] = _NULL; \
-    var->_atexit0._on_exit_args_ptr = _NULL; \
-    var->__sglue._next = _NULL; \
-    var->__sglue._niobs = 0; \
-    var->__sglue._iobs = _NULL; \
-    var->__sf = 0; \
-    var->_misc = _NULL; \
-    var->_signal_buf = _NULL; \
+  { (var)->_stdin = (__FILE *)&__sf_fake_stdin; \
+    (var)->_stdout = (__FILE *)&__sf_fake_stdout; \
+    (var)->_stderr = (__FILE *)&__sf_fake_stderr; \
+    (var)->_errno = 0; \
+    (var)->_inc = 0; \
+    (var)->_emergency = _NULL; \
+    (var)->__sdidinit = 0; \
+    (var)->_current_category = 0; \
+    (var)->_current_locale = "C"; \
+    (var)->_mp = _NULL; \
+    (var)->__cleanup = _NULL; \
+    (var)->_gamma_signgam = 0; \
+    (var)->_cvtlen = 0; \
+    (var)->_cvtbuf = _NULL; \
+    (var)->_r48 = _NULL; \
+    (var)->_localtime_buf = _NULL; \
+    (var)->_asctime_buf = _NULL; \
+    (var)->_sig_func = _NULL; \
+    (var)->_atexit = _NULL; \
+    (var)->_atexit0._next = _NULL; \
+    (var)->_atexit0._ind = 0; \
+    (var)->_atexit0._fns[0] = _NULL; \
+    (var)->_atexit0._on_exit_args_ptr = _NULL; \
+    (var)->__sglue._next = _NULL; \
+    (var)->__sglue._niobs = 0; \
+    (var)->__sglue._iobs = _NULL; \
+    (var)->__sf = 0; \
+    (var)->_misc = _NULL; \
+    (var)->_signal_buf = _NULL; \
   }
 
 /* Only built the assert() calls if we are built with debugging.  */
@@ -651,9 +651,9 @@ struct _reent
 
 #define _REENT_INIT(var) \
   { 0, \
-    &var.__sf[0], \
-    &var.__sf[1], \
-    &var.__sf[2], \
+    &(var).__sf[0], \
+    &(var).__sf[1], \
+    &(var).__sf[2], \
     0, \
     "", \
     0, \
@@ -699,65 +699,65 @@ struct _reent
   }
 
 #define _REENT_INIT_PTR(var) \
-  { var->_errno = 0; \
-    var->_stdin = &var->__sf[0]; \
-    var->_stdout = &var->__sf[1]; \
-    var->_stderr = &var->__sf[2]; \
-    var->_inc = 0; \
-    memset(&var->_emergency, 0, sizeof(var->_emergency)); \
-    var->_current_category = 0; \
-    var->_current_locale = "C"; \
-    var->__sdidinit = 0; \
-    var->__cleanup = _NULL; \
-    var->_result = _NULL; \
-    var->_result_k = 0; \
-    var->_p5s = _NULL; \
-    var->_freelist = _NULL; \
-    var->_cvtlen = 0; \
-    var->_cvtbuf = _NULL; \
-    var->_new._reent._unused_rand = 0; \
-    var->_new._reent._strtok_last = _NULL; \
-    var->_new._reent._asctime_buf[0] = 0; \
-    memset(&var->_new._reent._localtime_buf, 0, sizeof(var->_new._reent._localtime_buf)); \
-    var->_new._reent._gamma_signgam = 0; \
-    var->_new._reent._rand_next = 1; \
-    var->_new._reent._r48._seed[0] = _RAND48_SEED_0; \
-    var->_new._reent._r48._seed[1] = _RAND48_SEED_1; \
-    var->_new._reent._r48._seed[2] = _RAND48_SEED_2; \
-    var->_new._reent._r48._mult[0] = _RAND48_MULT_0; \
-    var->_new._reent._r48._mult[1] = _RAND48_MULT_1; \
-    var->_new._reent._r48._mult[2] = _RAND48_MULT_2; \
-    var->_new._reent._r48._add = _RAND48_ADD; \
-    var->_new._reent._mblen_state.__count = 0; \
-    var->_new._reent._mblen_state.__value.__wch = 0; \
-    var->_new._reent._mbtowc_state.__count = 0; \
-    var->_new._reent._mbtowc_state.__value.__wch = 0; \
-    var->_new._reent._wctomb_state.__count = 0; \
-    var->_new._reent._wctomb_state.__value.__wch = 0; \
-    var->_new._reent._mbrlen_state.__count = 0; \
-    var->_new._reent._mbrlen_state.__value.__wch = 0; \
-    var->_new._reent._mbrtowc_state.__count = 0; \
-    var->_new._reent._mbrtowc_state.__value.__wch = 0; \
-    var->_new._reent._mbsrtowcs_state.__count = 0; \
-    var->_new._reent._mbsrtowcs_state.__value.__wch = 0; \
-    var->_new._reent._wcrtomb_state.__count = 0; \
-    var->_new._reent._wcrtomb_state.__value.__wch = 0; \
-    var->_new._reent._wcsrtombs_state.__count = 0; \
-    var->_new._reent._wcsrtombs_state.__value.__wch = 0; \
-    var->_new._reent._l64a_buf[0] = '\0'; \
-    var->_new._reent._signal_buf[0] = '\0'; \
-    var->_new._reent._getdate_err = 0; \
-    var->_atexit = _NULL; \
-    var->_atexit0._next = _NULL; \
-    var->_atexit0._ind = 0; \
-    var->_atexit0._fns[0] = _NULL; \
-    var->_atexit0._on_exit_args._fntypes = 0; \
-    var->_atexit0._on_exit_args._fnargs[0] = _NULL; \
-    var->_sig_func = _NULL; \
-    var->__sglue._next = _NULL; \
-    var->__sglue._niobs = 0; \
-    var->__sglue._iobs = _NULL; \
-    memset(&var->__sf, 0, sizeof(var->__sf)); \
+  { (var)->_errno = 0; \
+    (var)->_stdin = &(var)->__sf[0]; \
+    (var)->_stdout = &(var)->__sf[1]; \
+    (var)->_stderr = &(var)->__sf[2]; \
+    (var)->_inc = 0; \
+    memset(&(var)->_emergency, 0, sizeof((var)->_emergency)); \
+    (var)->_current_category = 0; \
+    (var)->_current_locale = "C"; \
+    (var)->__sdidinit = 0; \
+    (var)->__cleanup = _NULL; \
+    (var)->_result = _NULL; \
+    (var)->_result_k = 0; \
+    (var)->_p5s = _NULL; \
+    (var)->_freelist = _NULL; \
+    (var)->_cvtlen = 0; \
+    (var)->_cvtbuf = _NULL; \
+    (var)->_new._reent._unused_rand = 0; \
+    (var)->_new._reent._strtok_last = _NULL; \
+    (var)->_new._reent._asctime_buf[0] = 0; \
+    memset(&(var)->_new._reent._localtime_buf, 0, sizeof((var)->_new._reent._localtime_buf)); \
+    (var)->_new._reent._gamma_signgam = 0; \
+    (var)->_new._reent._rand_next = 1; \
+    (var)->_new._reent._r48._seed[0] = _RAND48_SEED_0; \
+    (var)->_new._reent._r48._seed[1] = _RAND48_SEED_1; \
+    (var)->_new._reent._r48._seed[2] = _RAND48_SEED_2; \
+    (var)->_new._reent._r48._mult[0] = _RAND48_MULT_0; \
+    (var)->_new._reent._r48._mult[1] = _RAND48_MULT_1; \
+    (var)->_new._reent._r48._mult[2] = _RAND48_MULT_2; \
+    (var)->_new._reent._r48._add = _RAND48_ADD; \
+    (var)->_new._reent._mblen_state.__count = 0; \
+    (var)->_new._reent._mblen_state.__value.__wch = 0; \
+    (var)->_new._reent._mbtowc_state.__count = 0; \
+    (var)->_new._reent._mbtowc_state.__value.__wch = 0; \
+    (var)->_new._reent._wctomb_state.__count = 0; \
+    (var)->_new._reent._wctomb_state.__value.__wch = 0; \
+    (var)->_new._reent._mbrlen_state.__count = 0; \
+    (var)->_new._reent._mbrlen_state.__value.__wch = 0; \
+    (var)->_new._reent._mbrtowc_state.__count = 0; \
+    (var)->_new._reent._mbrtowc_state.__value.__wch = 0; \
+    (var)->_new._reent._mbsrtowcs_state.__count = 0; \
+    (var)->_new._reent._mbsrtowcs_state.__value.__wch = 0; \
+    (var)->_new._reent._wcrtomb_state.__count = 0; \
+    (var)->_new._reent._wcrtomb_state.__value.__wch = 0; \
+    (var)->_new._reent._wcsrtombs_state.__count = 0; \
+    (var)->_new._reent._wcsrtombs_state.__value.__wch = 0; \
+    (var)->_new._reent._l64a_buf[0] = '\0'; \
+    (var)->_new._reent._signal_buf[0] = '\0'; \
+    (var)->_new._reent._getdate_err = 0; \
+    (var)->_atexit = _NULL; \
+    (var)->_atexit0._next = _NULL; \
+    (var)->_atexit0._ind = 0; \
+    (var)->_atexit0._fns[0] = _NULL; \
+    (var)->_atexit0._on_exit_args._fntypes = 0; \
+    (var)->_atexit0._on_exit_args._fnargs[0] = _NULL; \
+    (var)->_sig_func = _NULL; \
+    (var)->__sglue._next = _NULL; \
+    (var)->__sglue._niobs = 0; \
+    (var)->__sglue._iobs = _NULL; \
+    memset(&(var)->__sf, 0, sizeof((var)->__sf)); \
   }
 
 #define _REENT_CHECK_RAND48(ptr)       /* nothing */