* Fix a couple of regressions introduced in 2.0.5 and 2.0.7. * Improved using declarations and using directives support. * Minor fixes/enhancements for C#, Java, Octave, Perl and Python. OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/swig?expand=0&rev=41
174 lines
9.9 KiB
Diff
174 lines
9.9 KiB
Diff
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs -x Makefile -x Makefile.in ../orig-swig-2.0.8/Doc/Manual/Ruby.html ./Doc/Manual/Ruby.html
|
|
--- ../orig-swig-2.0.8/Doc/Manual/Ruby.html 2012-08-20 23:29:52.000000000 +0200
|
|
+++ ./Doc/Manual/Ruby.html 2012-11-04 22:52:17.837133265 +0100
|
|
@@ -4926,7 +4926,7 @@
|
|
|
|
|
|
<div class="code">
|
|
-<pre>%typemap(in) (char *str, int len) {<br> $1 = STR2CSTR($input);<br> $2 = (int) RSTRING($input)->len;<br>};<br><br>int count(char c, char *str, int len);<br></pre>
|
|
+<pre>%typemap(in) (char *str, int len) {<br> $1 = StringValuePtr($input);<br> $2 = (int) RSTRING($input)->len;<br>};<br><br>int count(char c, char *str, int len);<br></pre>
|
|
|
|
|
|
|
|
@@ -7135,7 +7135,7 @@
|
|
</tr>
|
|
|
|
<tr>
|
|
- <td style="font-family: monospace;">char * STR2CSTR(String)</td>
|
|
+ <td style="font-family: monospace;">char * StringValuePtr(String)</td>
|
|
<td style="font-family: monospace;">SWIG_AsCharPtrAndSize(VALUE, char*, size_t, int* alloc)</td>
|
|
</tr>
|
|
|
|
@@ -7518,7 +7518,7 @@
|
|
|
|
|
|
<div class="code">
|
|
-<pre>%module argv<br><br>// This tells SWIG to treat char ** as a special case<br>%typemap(in) char ** {<br> /* Get the length of the array */<br> int size = RARRAY($input)->len; <br> int i;<br> $1 = (char **) malloc((size+1)*sizeof(char *));<br> /* Get the first element in memory */<br> VALUE *ptr = RARRAY($input)->ptr; <br> for (i=0; i < size; i++, ptr++)<br> /* Convert Ruby Object String to char* */<br> $1[i]= STR2CSTR(*ptr); <br> $1[i]=NULL; /* End of list */<br>}<br><br>// This cleans up the char ** array created before <br>// the function call<br><br>%typemap(freearg) char ** {<br> free((char *) $1);<br>}<br><br>// Now a test function<br>%inline %{<br>int print_args(char **argv) {<br> int i = 0;<br> while (argv[i]) {<br> printf("argv[%d] = %s\n", i,argv[i]);<br> i++;<br> }<br> return i;<br>}<br>%}<br><br></pre>
|
|
+<pre>%module argv<br><br>// This tells SWIG to treat char ** as a special case<br>%typemap(in) char ** {<br> /* Get the length of the array */<br> int size = RARRAY($input)->len; <br> int i;<br> $1 = (char **) malloc((size+1)*sizeof(char *));<br> /* Get the first element in memory */<br> VALUE *ptr = RARRAY($input)->ptr; <br> for (i=0; i < size; i++, ptr++)<br> /* Convert Ruby Object String to char* */<br> $1[i]= StringValuePtr(*ptr); <br> $1[i]=NULL; /* End of list */<br>}<br><br>// This cleans up the char ** array created before <br>// the function call<br><br>%typemap(freearg) char ** {<br> free((char *) $1);<br>}<br><br>// Now a test function<br>%inline %{<br>int print_args(char **argv) {<br> int i = 0;<br> while (argv[i]) {<br> printf("argv[%d] = %s\n", i,argv[i]);<br> i++;<br> }<br> return i;<br>}<br>%}<br><br></pre>
|
|
|
|
|
|
|
|
@@ -7796,7 +7796,7 @@
|
|
|
|
|
|
<div class="code">
|
|
-<pre>%typemap(in) (int nattributes, const char **names, const int *values)<br> (VALUE keys_arr, int i, VALUE key, VALUE val) {<br> Check_Type($input, T_HASH);<br> $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, NULL));<br> $2 = NULL;<br> $3 = NULL;<br> if ($1 > 0) {<br> $2 = (char **) malloc($1*sizeof(char *));<br> $3 = (int *) malloc($1*sizeof(int));<br> keys_arr = rb_funcall($input, rb_intern("keys"), 0, NULL);<br> for (i = 0; i < $1; i++) {<br> key = rb_ary_entry(keys_arr, i);<br> val = rb_hash_aref($input, key);<br> Check_Type(key, T_STRING);<br> Check_Type(val, T_FIXNUM);<br> <b>$2[i] = STR2CSTR(key);<br> $3[i] = NUM2INT(val);</b><br>}<br>}<br>}<br></pre>
|
|
+<pre>%typemap(in) (int nattributes, const char **names, const int *values)<br> (VALUE keys_arr, int i, VALUE key, VALUE val) {<br> Check_Type($input, T_HASH);<br> $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, NULL));<br> $2 = NULL;<br> $3 = NULL;<br> if ($1 > 0) {<br> $2 = (char **) malloc($1*sizeof(char *));<br> $3 = (int *) malloc($1*sizeof(int));<br> keys_arr = rb_funcall($input, rb_intern("keys"), 0, NULL);<br> for (i = 0; i < $1; i++) {<br> key = rb_ary_entry(keys_arr, i);<br> val = rb_hash_aref($input, key);<br> Check_Type(key, T_STRING);<br> Check_Type(val, T_FIXNUM);<br> <b>$2[i] = StringValuePtr(key);<br> $3[i] = NUM2INT(val);</b><br>}<br>}<br>}<br></pre>
|
|
|
|
|
|
|
|
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs -x Makefile -x Makefile.in ../orig-swig-2.0.8/Doc/Manual/SWIGDocumentation.html ./Doc/Manual/SWIGDocumentation.html
|
|
--- ../orig-swig-2.0.8/Doc/Manual/SWIGDocumentation.html 2012-08-20 23:29:55.000000000 +0200
|
|
+++ ./Doc/Manual/SWIGDocumentation.html 2012-11-04 22:52:17.849132571 +0100
|
|
@@ -46795,7 +46795,7 @@
|
|
example:</P>
|
|
<DIV class="code">
|
|
<PRE>%typemap(in) (char *str, int len) {
|
|
-<BR> $1 = STR2CSTR($input);
|
|
+<BR> $1 = StringValuePtr($input);
|
|
<BR> $2 = (int) RSTRING($input)->len;
|
|
<BR>};
|
|
<BR>
|
|
@@ -47429,7 +47429,7 @@
|
|
unsigned long*)</TD></TR>
|
|
<TR><TD style="font-family: monospace;">char NUM2CHR(Numeric or String)</TD><TD
|
|
style="font-family: monospace;">SWIG_AsVal_char(VALUE, int*)</TD></TR>
|
|
-<TR><TD style="font-family: monospace;">char * STR2CSTR(String)</TD><TD style="font-family: monospace;">
|
|
+<TR><TD style="font-family: monospace;">char * StringValuePtr(String)</TD><TD style="font-family: monospace;">
|
|
SWIG_AsCharPtrAndSize(VALUE, char*, size_t, int* alloc)</TD></TR>
|
|
<TR><TD style="font-family: monospace;">char * rb_str2cstr(String,
|
|
int*length)</TD><TD style="font-family: monospace;"></TD></TR>
|
|
@@ -47542,7 +47542,7 @@
|
|
<BR> VALUE *ptr = RARRAY($input)->ptr;
|
|
<BR> for (i=0; i < size; i++, ptr++)
|
|
<BR> /* Convert Ruby Object String to char* */
|
|
-<BR> $1[i]= STR2CSTR(*ptr);
|
|
+<BR> $1[i]= StringValuePtr(*ptr);
|
|
<BR> $1[i]=NULL; /* End of list */
|
|
<BR>}
|
|
<BR>
|
|
@@ -47756,7 +47756,7 @@
|
|
<BR> val = rb_hash_aref($input, key);
|
|
<BR> Check_Type(key, T_STRING);
|
|
<BR> Check_Type(val, T_FIXNUM);
|
|
-<BR> <B>$2[i] = STR2CSTR(key);
|
|
+<BR> <B>$2[i] = StringValuePtr(key);
|
|
<BR> $3[i] = NUM2INT(val);</B>
|
|
<BR>}
|
|
<BR>}
|
|
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs -x Makefile -x Makefile.in ../orig-swig-2.0.8/Examples/ruby/hashargs/example.i ./Examples/ruby/hashargs/example.i
|
|
--- ../orig-swig-2.0.8/Examples/ruby/hashargs/example.i 2008-11-26 22:54:49.000000000 +0100
|
|
+++ ./Examples/ruby/hashargs/example.i 2012-11-04 22:52:17.849132571 +0100
|
|
@@ -14,7 +14,7 @@
|
|
val = rb_hash_aref($input, key);
|
|
Check_Type(key, T_STRING);
|
|
Check_Type(val, T_FIXNUM);
|
|
- $2[i] = STR2CSTR(key);
|
|
+ $2[i] = StringValuePtr(key);
|
|
$3[i] = NUM2INT(val);
|
|
}
|
|
}
|
|
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs -x Makefile -x Makefile.in ../orig-swig-2.0.8/Examples/ruby/multimap/example.i ./Examples/ruby/multimap/example.i
|
|
--- ../orig-swig-2.0.8/Examples/ruby/multimap/example.i 2010-02-13 18:12:15.000000000 +0100
|
|
+++ ./Examples/ruby/multimap/example.i 2012-11-04 22:52:17.853132339 +0100
|
|
@@ -31,7 +31,7 @@
|
|
free($2);
|
|
SWIG_exception(SWIG_ValueError, "List items must be strings");
|
|
}
|
|
- $2[i] = STR2CSTR(s);
|
|
+ $2[i] = StringValuePtr(s);
|
|
}
|
|
$2[i] = 0;
|
|
}
|
|
@@ -46,7 +46,7 @@
|
|
if (TYPE($input) != T_STRING) {
|
|
SWIG_exception(SWIG_ValueError, "Expected a string");
|
|
}
|
|
- $1 = STR2CSTR($input);
|
|
+ $1 = StringValuePtr($input);
|
|
$2 = RSTRING_LEN($input);
|
|
}
|
|
|
|
@@ -60,7 +60,7 @@
|
|
if (TYPE($input) != T_STRING) {
|
|
SWIG_exception(SWIG_ValueError,"Expected a string");
|
|
}
|
|
- temp = STR2CSTR($input);
|
|
+ temp = StringValuePtr($input);
|
|
$2 = RSTRING_LEN($input);
|
|
$1 = (char *) malloc($2+1);
|
|
memmove($1,temp,$2);
|
|
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs -x Makefile -x Makefile.in ../orig-swig-2.0.8/Examples/test-suite/memberin1.i ./Examples/test-suite/memberin1.i
|
|
--- ../orig-swig-2.0.8/Examples/test-suite/memberin1.i 2002-11-30 23:01:28.000000000 +0100
|
|
+++ ./Examples/test-suite/memberin1.i 2012-11-04 22:52:17.853132339 +0100
|
|
@@ -47,7 +47,7 @@
|
|
#ifdef SWIGRUBY
|
|
%typemap(in) String {
|
|
Check_Type($input, T_STRING);
|
|
- $1 = String(STR2CSTR($input));
|
|
+ $1 = String(StringValuePtr($input));
|
|
}
|
|
#endif
|
|
|
|
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs -x Makefile -x Makefile.in ../orig-swig-2.0.8/Examples/test-suite/namespace_typemap.i ./Examples/test-suite/namespace_typemap.i
|
|
--- ../orig-swig-2.0.8/Examples/test-suite/namespace_typemap.i 2010-06-15 21:40:34.000000000 +0200
|
|
+++ ./Examples/test-suite/namespace_typemap.i 2012-11-04 22:52:17.853132339 +0100
|
|
@@ -100,7 +100,7 @@
|
|
#endif
|
|
#ifdef SWIGRUBY
|
|
%typemap(in) string_class * {
|
|
- $1 = new string_class(STR2CSTR($input));
|
|
+ $1 = new string_class(StringValuePtr($input));
|
|
}
|
|
%typemap(freearg) string_class * {
|
|
delete $1;
|
|
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs -x Makefile -x Makefile.in ../orig-swig-2.0.8/Lib/ruby/argcargv.i ./Lib/ruby/argcargv.i
|
|
--- ../orig-swig-2.0.8/Lib/ruby/argcargv.i 2006-09-23 23:39:09.000000000 +0200
|
|
+++ ./Lib/ruby/argcargv.i 2012-11-04 22:52:17.853132339 +0100
|
|
@@ -30,7 +30,7 @@
|
|
$2 = (char **) malloc((size+1)*sizeof(char *));
|
|
VALUE *ptr = RARRAY_PTR($input);
|
|
for (i=0; i < size; i++, ptr++) {
|
|
- $2[i]= STR2CSTR(*ptr);
|
|
+ $2[i]= StringValuePtr(*ptr);
|
|
}
|
|
$2[i]=NULL;
|
|
} else {
|
|
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs -x Makefile -x Makefile.in ../orig-swig-2.0.8/Lib/ruby/rubystrings.swg ./Lib/ruby/rubystrings.swg
|
|
--- ../orig-swig-2.0.8/Lib/ruby/rubystrings.swg 2007-04-28 06:20:28.000000000 +0200
|
|
+++ ./Lib/ruby/rubystrings.swg 2012-11-04 22:52:17.853132339 +0100
|
|
@@ -7,10 +7,10 @@
|
|
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
|
{
|
|
if (TYPE(obj) == T_STRING) {
|
|
- %#if defined(StringValuePtr)
|
|
- char *cstr = StringValuePtr(obj);
|
|
- %#else
|
|
+ %#if defined(STR2CSTR)
|
|
char *cstr = STR2CSTR(obj);
|
|
+ %#else
|
|
+ char *cstr = StringValuePtr(obj);
|
|
%#endif
|
|
size_t size = RSTRING_LEN(obj) + 1;
|
|
if (cptr) {
|