summaryrefslogtreecommitdiff
path: root/math/gracetmpl/files/patch-pygracetmpl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'math/gracetmpl/files/patch-pygracetmpl.cc')
-rw-r--r--math/gracetmpl/files/patch-pygracetmpl.cc57
1 files changed, 44 insertions, 13 deletions
diff --git a/math/gracetmpl/files/patch-pygracetmpl.cc b/math/gracetmpl/files/patch-pygracetmpl.cc
index 74dcc3abfd7c..a08a80be48bf 100644
--- a/math/gracetmpl/files/patch-pygracetmpl.cc
+++ b/math/gracetmpl/files/patch-pygracetmpl.cc
@@ -1,21 +1,43 @@
---- python/src/pygracetmpl.cc.orig Sat Oct 12 05:12:57 2002
-+++ python/src/pygracetmpl.cc Sun Dec 5 12:35:53 2004
-@@ -1,11 +1,10 @@
+--- python/src/pygracetmpl.cc.orig Mon Sep 27 16:59:49 2004
++++ python/src/pygracetmpl.cc Sat Jun 18 00:44:43 2005
+@@ -1,15 +1,15 @@
#include <gracetmpl.h>
--#include <Python.h>
--#include <Numeric/arrayobject.h> /* numerical python header */
--
- #include <string.h>
- #include <complex>
- #include <set>
-+#include <Python.h>
-+#include <Numeric/arrayobject.h> /* numerical python header */
++#include <string.h>
++#include <complex>
++#include <set>
++
+ /* python headers */
+ #include <Python.h>
+ /* numarray headers */
+ #include <numarray/numarray.h>
+ #include <numarray/arrayobject.h>
+-#include <string.h>
+-#include <complex>
+-#include <set>
+-
/********************************************************/
/******************* graceTMPL.data type ***************/
-@@ -179,7 +178,7 @@
- int rows = dataArray->dimensions[1];
+ /********************************************************/
+@@ -159,6 +159,7 @@
+ PyArrayObject *dataArray = 0;
+ GraceTMPL::Data *newData = 0;
+ graceTMPL_dataObject *dataObject = 0;
++ int cols, rows;
+
+ if (!PyArg_ParseTuple(args, "sO:graceTMPL.graph.addData(name, dataArray)",
+ &name, &oDataArray)){
+@@ -178,12 +179,12 @@
+ "data array has to have at least dimension 2 in first axis");
+ return NULL;
+ }
+- PyArray_INCREF(dataArray);
+- int cols = dataArray->dimensions[0];
+- int rows = dataArray->dimensions[1];
++ XXX_PyArray_INCREF(dataArray);
++ cols = dataArray->dimensions[0];
++ rows = dataArray->dimensions[1];
if(cols > 4)
cols = 4;
- double **data = new (double *)[cols];
@@ -23,3 +45,12 @@
for(int c = 0; c < cols; ++c){
data[c] = new double[rows];
for(int r = 0; r < rows; ++r)
+@@ -191,7 +192,7 @@
+ c * dataArray->strides[0] +
+ r * dataArray->strides[1]);
+ }
+- PyArray_XDECREF(dataArray);
++ XXX_PyArray_XDECREF(dataArray);
+ switch(cols){
+ case 2:
+ newData = new GraceTMPL::Data(std::string(name), rows,