diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-27 04:47:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-27 04:47:12 +0000 |
commit | 46e0ce84d53dbb565d6a3460b2bd37a8250ad8d7 (patch) | |
tree | 11cdce7e0dd86e4806dde9c04e01b29c999b5329 /win32/win32.c | |
parent | e881056fd63dfa72f31424c67fa0eb35c1f92e0f (diff) | |
download | ruby-46e0ce84d53dbb565d6a3460b2bd37a8250ad8d7.tar.gz |
win32.c: suppress warnings
* win32/win32.c (set_env_val): reuse size of typedef to suppress
unused-local-typedefs warnings from gcc 4.8 and reduce same
calculation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c index c4678b1593..a02ac5d9fb 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -482,8 +482,8 @@ init_env(void) BOOL f; #define env wk.val #define set_env_val(vname) do { \ - typedef char namesizecheck[numberof(wk.name) < numberof(vname) - 1 ? -1 : 1]; \ - WCHAR *const buf = wk.name + numberof(wk.name) - numberof(vname) + 1; \ + typedef char wk_name_offset[(numberof(wk.name) - numberof(vname) + 1) * 2 + 1]; \ + WCHAR *const buf = wk.name + sizeof(wk_name_offset) / 2; \ MEMCPY(buf, vname, WCHAR, numberof(vname) - 1); \ _wputenv(buf); \ } while (0) |