File plplot-5.15.0-swig-4.3.patch of Package plplot
diff -Naur plplot-5.15.0-original/bindings/java/plplotjavac.i plplot-5.15.0/bindings/java/plplotjavac.i
--- plplot-5.15.0-original/bindings/java/plplotjavac.i 2024-10-08 20:04:53.157286783 +0100
+++ plplot-5.15.0/bindings/java/plplotjavac.i 2024-10-08 20:41:43.220215246 +0100
@@ -2128,9 +2128,9 @@
%typemap( argout ) PLGraphicsIn * gin {
PyObject *o;
o = PyFloat_FromDouble( $1->wX );
- resultobj = t_output_helper( resultobj, o );
+ resultobj = SWIG_AppendOutput( resultobj, o );
o = PyFloat_FromDouble( $1->wY );
- resultobj = t_output_helper( resultobj, o );
+ resultobj = SWIG_AppendOutput( resultobj, o );
}
#endif
diff -Naur plplot-5.15.0-original/bindings/octave/plplot_octave.i plplot-5.15.0/bindings/octave/plplot_octave.i
--- plplot-5.15.0-original/bindings/octave/plplot_octave.i 2024-10-08 20:04:53.149286728 +0100
+++ plplot-5.15.0/bindings/octave/plplot_octave.i 2024-10-08 20:08:31.766682937 +0100
@@ -770,7 +770,7 @@
}
%typemap ( argout ) ( const PLFLT * ArrayY, PLINT ny, PLFLT * OutMatrixCk )
{
- $result = SWIG_Octave_AppendOutput( $result, retval$argnum( 0 ) );
+ $result = SWIG_AppendOutput( $result, retval$argnum( 0 ) );
}
%typemap ( freearg ) ( const PLFLT * ArrayY, PLINT ny, PLFLT * OutMatrixCk )
{
@@ -796,7 +796,7 @@
local_charMatrix = charMatrix( 1, local_string_length );
local_charMatrix.insert( local_string$argnum, 0, 0 );
retval( 0 ) = octave_value( local_charMatrix );
- $result = SWIG_Octave_AppendOutput( $result, retval( 0 ) );
+ $result = SWIG_AppendOutput( $result, retval( 0 ) );
}
typedef PLINT ( *defined_func )( PLFLT, PLFLT );
diff -Naur plplot-5.15.0-original/bindings/python/fragments.i plplot-5.15.0/bindings/python/fragments.i
--- plplot-5.15.0-original/bindings/python/fragments.i 2024-10-08 20:04:53.161286811 +0100
+++ plplot-5.15.0/bindings/python/fragments.i 2024-10-08 20:41:07.703954787 +0100
@@ -1,29 +1,2 @@
/* Helper function to return tuples */
-
-%fragment("t_output_helper","header") %{
- static PyObject* t_output_helper(PyObject* target, PyObject* o) {
- PyObject* o2;
- PyObject* o3;
-
- if (!target) {
- target = o;
- } else if (target == Py_None) {
- Py_DECREF(Py_None);
- target = o;
- } else {
- if (!PyTuple_Check(target)) {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
- }
- o3 = PyTuple_New(1);
- PyTuple_SetItem(o3, 0, o);
-
- o2 = target;
- target = PySequence_Concat(o2, o3);
- Py_DECREF(o2);
- Py_DECREF(o3);
- }
- return target;
-}
-%}
+/* Legacy - file can be deleted */
diff -Naur plplot-5.15.0-original/bindings/python/plplotc.i plplot-5.15.0/bindings/python/plplotc.i
--- plplot-5.15.0-original/bindings/python/plplotc.i 2024-10-08 20:04:53.161286811 +0100
+++ plplot-5.15.0/bindings/python/plplotc.i 2024-10-08 20:41:10.963978913 +0100
@@ -682,7 +682,7 @@
}
%typemap ( argout ) ( const PLFLT * ArrayY, PLINT ny, PLFLT **OutMatrixCk )
{
- $result = SWIG_Python_AppendOutput( $result, array$argnum );
+ $result = SWIG_AppendOutput( $result, array$argnum );
}
//**************************
@@ -749,9 +749,9 @@
{
$1 = buff;
}
-%typemap( argout, fragment = "t_output_helper" ) char *OUTPUT {
+%typemap( argout ) char *OUTPUT {
PyObject *o = PyString_FromString( $1 );
- $result = t_output_helper( $result, o );
+ $result = SWIG_AppendOutput( $result, o );
}
//**************************
@@ -1662,9 +1662,9 @@
%typemap( argout ) PLGraphicsIn * gin {
PyObject *o;
o = PyFloat_FromDouble( $1->wX );
- resultobj = t_output_helper( resultobj, o );
+ resultobj = SWIG_AppendOutput( resultobj, o );
o = PyFloat_FromDouble( $1->wY );
- resultobj = t_output_helper( resultobj, o );
+ resultobj = SWIG_AppendOutput( resultobj, o );
}
#endif