[前][次][番号順一覧][スレッド一覧]

ruby-changes:27472

From: nobu <ko1@a...>
Date: Wed, 27 Feb 2013 13:47:21 +0900 (JST)
Subject: [ruby-changes:27472] nobu:r39524 (trunk): win32.c: suppress warnings

nobu	2013-02-27 13:47:12 +0900 (Wed, 27 Feb 2013)

  New Revision: 39524

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39524

  Log:
    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.

  Modified files:
    trunk/win32/win32.c

Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 39523)
+++ win32/win32.c	(revision 39524)
@@ -482,8 +482,8 @@ init_env(void) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L482
     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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]