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

ruby-changes:27482

From: nobu <ko1@a...>
Date: Thu, 28 Feb 2013 13:30:42 +0900 (JST)
Subject: [ruby-changes:27482] nobu:r39534 (trunk): win32.c: suppress warning

nobu	2013-02-28 13:30:26 +0900 (Thu, 28 Feb 2013)

  New Revision: 39534

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

  Log:
    win32.c: suppress warning
    
    * win32/win32.c (set_env_val): get rid of intger overflow warning by
      VC 11.

  Modified files:
    trunk/win32/win32.c

Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 39533)
+++ win32/win32.c	(revision 39534)
@@ -482,7 +482,7 @@ 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 wk_name_offset[(numberof(wk.name) - numberof(vname) + 1) * 2 + 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); \

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

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