subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1480442 - /subversion/trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
Date Wed, 08 May 2013 20:35:42 GMT
Author: pburba
Date: Wed May  8 20:35:42 2013
New Revision: 1480442

URL: http://svn.apache.org/r1480442
Log:
Follow-up to r1442063: Fix broken ruby bindings build on Windows.

r1442063 turned the Windows compiler warning C4204 "nonstandard extension
used : non-constant aggregate initializer" into an error.  The Ruby bindings
uses a few such offending initializers and thus needs some minor tweaks to
be build again. 

* subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
  (rb_set_pool_if_swig_type_object,
   r2c_hash,
   invoke_callback): Declare and initialize arrays/structs in separate
   statements.


Modified:
    subversion/trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c

Modified: subversion/trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c?rev=1480442&r1=1480441&r2=1480442&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c Wed May
 8 20:35:42 2013
@@ -735,7 +735,9 @@ svn_swig_rb_get_pool(int argc, VALUE *ar
 static svn_boolean_t
 rb_set_pool_if_swig_type_object(VALUE target, VALUE pool)
 {
-  VALUE targets[1] = {target};
+  VALUE targets[1];
+  
+  targets[0] = target;
 
   if (!NIL_P(find_swig_type_object(1, targets))) {
     rb_set_pool(target, pool);
@@ -1530,15 +1532,14 @@ r2c_hash(VALUE hash, r2c_func func, void
     return NULL;
   } else {
     apr_hash_t *apr_hash;
-    hash_to_apr_hash_data_t data = {
-      NULL,
-      func,
-      ctx,
-      pool
-    };
+    hash_to_apr_hash_data_t data;
 
     apr_hash = apr_hash_make(pool);
     data.apr_hash = apr_hash;
+    data.ctx = ctx;
+    data.func = func;
+    data.pool = pool;
+
     rb_hash_foreach(hash, r2c_hash_i, (VALUE)&data);
 
     return apr_hash;
@@ -1637,8 +1638,9 @@ invoke_callback(VALUE baton, VALUE pool)
 {
   callback_baton_t *cbb = (callback_baton_t *)baton;
   VALUE sub_pool;
-  VALUE argv[] = {pool};
+  VALUE argv[1];
 
+  argv[0] = pool;
   svn_swig_rb_get_pool(1, argv, Qnil, &sub_pool, NULL);
   cbb->pool = sub_pool;
   return rb_ensure(callback, baton, callback_ensure, sub_pool);



Mime
View raw message