Hi,

When I compile if_ruby.c with MSVC10 and Ruby 2.1, the following warnings
occur:

if_ruby.c(425) : warning C4098: 'rb_gc_writebarrier_unprotect_promoted_stub' : 
'void' function returning a value
if_ruby.c(766) : warning C4047: 'function' : 'char ***' differs in levels of 
indirection from 'char *(*)[1]'
if_ruby.c(766) : warning C4024: 'dll_NtInitialize' : different types for formal 
and actual parameter 2


Attached patch fixes them. (Indentation is also fixed.)

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent 5c6ae892be21510cb67c2802bce60d638907ef02

diff --git a/src/if_ruby.c b/src/if_ruby.c
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -96,11 +96,11 @@
 # define rb_num2int rb_num2int_stub
 #endif
 
-# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21
+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21
 /* Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses
  * rb_gc_writebarrier_unprotect_promoted if USE_RGENGC  */
-#  define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
-# endif
+# define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
+#endif
 
 #include <ruby.h>
 #ifdef RUBY19_OR_LATER
@@ -422,7 +422,7 @@ VALUE rb_num2ulong(VALUE x)
 # if defined(USE_RGENGC) && USE_RGENGC && !defined(PROTO)
 void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj)
 {
-    return dll_rb_gc_writebarrier_unprotect_promoted(obj);
+    dll_rb_gc_writebarrier_unprotect_promoted(obj);
 }
 # endif
 
@@ -763,7 +763,8 @@ static int ensure_ruby_initialized(void)
 	    /* suggested by Ariya Mizutani */
 	    int argc = 1;
 	    char *argv[] = {"gvim.exe"};
-	    NtInitialize(&argc, &argv);
+	    char **argvp = argv;
+	    NtInitialize(&argc, &argvp);
 #endif
 	    {
 #if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)

Raspunde prin e-mail lui