[Scipy-svn] r2952 - trunk/Lib/sandbox/timeseries/src
scipy-svn at scipy.org
scipy-svn at scipy.org
Wed May 2 10:29:37 EDT 2007
Author: pierregm
Date: 2007-05-02 09:29:34 -0500 (Wed, 02 May 2007)
New Revision: 2952
Modified:
trunk/Lib/sandbox/timeseries/src/cseries.c
Log:
fixed a problem of compatibility w/ python 2.5 (use Py_ssize_t instead of int)
Modified: trunk/Lib/sandbox/timeseries/src/cseries.c
===================================================================
--- trunk/Lib/sandbox/timeseries/src/cseries.c 2007-05-02 08:55:39 UTC (rev 2951)
+++ trunk/Lib/sandbox/timeseries/src/cseries.c 2007-05-02 14:29:34 UTC (rev 2952)
@@ -1453,7 +1453,7 @@
PyObject *key, *value;
- int pos = 0;
+ Py_ssize_t pos = 0;
while (PyDict_Next(source, &pos, &key, &value)) {
PyObject *tuple_iter;
@@ -1461,7 +1461,7 @@
if((tuple_iter = PyObject_GetIter(value)) == NULL) return INT_ERR_CODE;
- while (item = PyIter_Next(tuple_iter)) {
+ while ((item = PyIter_Next(tuple_iter)) != NULL) {
PyDict_SetItem(dest, item, key);
Py_DECREF(item);
}
@@ -2113,6 +2113,7 @@
int freq_group = get_freq_group(self->freq);
PyObject *string_arg, *retval;
+ string_arg = NULL;
if (freq_group == FR_ANN) { string_arg = Py_BuildValue("(s)", "%Y"); }
else if (freq_group == FR_QTR) { string_arg = Py_BuildValue("(s)", "%FQ%q"); }
else if (freq_group == FR_MTH) { string_arg = Py_BuildValue("(s)", "%b-%Y"); }
@@ -2275,7 +2276,7 @@
if (obj1->value < obj2->value) return -1;
if (obj1->value > obj2->value) return 1;
if (obj1->value == obj2->value) return 0;
-
+ return -1;
}
static long
@@ -3067,6 +3068,7 @@
MEM_CHECK(*result_mask)
result_mask_tmp = (PyArrayObject**)result_mask;
(*result_mask_tmp)->flags = ((*result_mask_tmp)->flags) | NPY_OWNDATA;
+ return 0;
}
/* computation portion of moving sum. Appropriate mask is overlayed on top
More information about the Scipy-svn
mailing list