From b6d3fccfffcf8fceeabf1db98e06f75fb4a9743d Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Fri, 17 Jun 2005 17:38:36 +0000 Subject: - Update to 0.3.2 PR: ports/82277 Submitted by: KATO Tsuguru --- math/gracetmpl/files/patch-pygracetmpl.cc | 57 ++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 13 deletions(-) (limited to 'math/gracetmpl/files/patch-pygracetmpl.cc') 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 --#include --#include /* numerical python header */ -- - #include - #include - #include -+#include -+#include /* numerical python header */ ++#include ++#include ++#include ++ + /* python headers */ + #include + /* numarray headers */ + #include + #include +-#include +-#include +-#include +- /********************************************************/ /******************* 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, -- cgit v1.2.3