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

ruby-changes:30583

From: nobu <ko1@a...>
Date: Fri, 23 Aug 2013 17:18:12 +0900 (JST)
Subject: [ruby-changes:30583] nobu:r42661 (trunk): win32ole.c: suppress warnings

nobu	2013-08-23 17:17:50 +0900 (Fri, 23 Aug 2013)

  New Revision: 42661

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

  Log:
    win32ole.c: suppress warnings
    
    * ext/win32ole/win32ole.c (ole_excepinfo2msg, ole_wc2vstr): get rid of
      size_t with rb_enc_str_new() to suppress warnings on x64-mswin32.

  Modified files:
    trunk/ext/win32ole/win32ole.c
Index: ext/win32ole/win32ole.c
===================================================================
--- ext/win32ole/win32ole.c	(revision 42660)
+++ ext/win32ole/win32ole.c	(revision 42661)
@@ -1171,7 +1171,7 @@ ole_excepinfo2msg(EXCEPINFO *pExInfo) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L1171
     }
     error_msg = rb_str_new2(error_code);
     if(pSource != NULL) {
-        rb_str_cat(error_msg, pSource, strlen(pSource));
+        rb_str_cat2(error_msg, pSource);
     }
     else {
         rb_str_cat(error_msg, "<Unknown>", 9);
@@ -1387,7 +1387,8 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L1387
 ole_wc2vstr(LPWSTR pw, BOOL isfree)
 {
     char *p = ole_wc2mb(pw);
-    VALUE vstr = rb_enc_str_new(p, strlen(p), cWIN32OLE_enc);
+    VALUE vstr = rb_str_new_cstr(p);
+    rb_enc_associate(vstr, cWIN32OLE_enc);
     if(isfree)
         SysFreeString(pw);
     free(p);

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

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