Author: breser
Date: Wed May 28 17:51:46 2014
New Revision: 1598085

URL: http://svn.apache.org/r1598085
Log:
swig bindings: typecast the thunks for the callback macros.

SWIG deliberately drops the qualifiers from the type for the temporary
variable it uses.  This generates warnings.  So let's just cast to
the proper type so we don't get warnings about dropping qualifiers.

* subversion/bindings/swig/include/svn_types.swg
  (%callback_typemap, %callback_typemap_maybenull): Add casts to
    the type of the variable we're assinging to when setting the thunk.

Modified:
    subversion/trunk/subversion/bindings/swig/include/svn_types.swg

Modified: subversion/trunk/subversion/bindings/swig/include/svn_types.swg
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/include/svn_types.swg?rev=1598085&r1=1598084&r2=1598085&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/include/svn_types.swg (original)
+++ subversion/trunk/subversion/bindings/swig/include/svn_types.swg Wed May 28 
17:51:46 2014
@@ -262,7 +262,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
 %define %callback_typemap(CallbackFunction, CallbackBaton,
                           PythonThunk, PerlThunk, RubyThunk)
 %typemap(in) (CallbackFunction, CallbackBaton) {
-  $1 = PythonThunk;
+  $1 = ($1_ltype) PythonThunk;
   $2 = $input;
 }
 %enddef
@@ -270,7 +270,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
                                     PythonThunk, PerlThunk, RubyThunk)
 %typemap(in) (CallbackFunction, CallbackBaton) {
   /* FIXME: Handle the NULL case. */
-  $1 = PythonThunk;
+  $1 = ($1_ltype) PythonThunk;
   $2 = $input;
 }
 %enddef
@@ -280,7 +280,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
 %define %callback_typemap(CallbackFunction, CallbackBaton,
                           PythonThunk, PerlThunk, RubyThunk)
 %typemap(in) (CallbackFunction, CallbackBaton) {
-  $1 = PerlThunk;
+  $1 = ($1_ltype) PerlThunk;
   $2 = $input;
 }
 %enddef
@@ -288,10 +288,10 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
                                     PythonThunk, PerlThunk, RubyThunk)
 %typemap(in) (CallbackFunction, CallbackBaton) {
   if (SvOK($input)) {
-    $1 = PerlThunk;
+    $1 = ($1_ltype) PerlThunk;
     $2 = $input;
   } else {
-    $1 = NULL;
+    $1 = ($1_ltype) NULL;
     $2 = NULL;
   }
 }
@@ -302,7 +302,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
 %define %callback_typemap(CallbackFunction, CallbackBaton,
                           PythonThunk, PerlThunk, RubyThunk)
 %typemap(in) (CallbackFunction, CallbackBaton) {
-  $1 = RubyThunk;
+  $1 = ($1_ltype) RubyThunk;
   $2 = (void *)svn_swig_rb_make_baton($input, _global_svn_swig_rb_pool);
 }
 %enddef
@@ -310,10 +310,10 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
                                     PythonThunk, PerlThunk, RubyThunk)
 %typemap(in) (CallbackFunction, CallbackBaton) {
   if (NIL_P($input)) {
-    $1 = NULL;
+    $1 = ($1_ltype) NULL;
     $2 = NULL;
   } else {
-    $1 = RubyThunk;
+    $1 = ($1_ltype) RubyThunk;
     $2 = (void *)svn_swig_rb_make_baton($input, _global_svn_swig_rb_pool);
   }
 }


Reply via email to