Magellan Linux

Annotation of /trunk/numeric/patches/numeric-24.2-python25.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 361 - (hide annotations) (download)
Tue Sep 25 20:32:31 2007 UTC (16 years, 8 months ago) by niro
File size: 7000 byte(s)
-ver bump to 24.2-r1

1 niro 361 diff -Nur Numeric-24.2.orig/Src/arrayobject.c Numeric-24.2/Src/arrayobject.c
2     --- Numeric-24.2.orig/Src/arrayobject.c 2007-09-02 14:12:11.000000000 +0100
3     +++ Numeric-24.2/Src/arrayobject.c 2007-09-02 14:12:42.000000000 +0100
4     @@ -491,7 +491,8 @@
5    
6     static PyObject * PyArray_Resize(PyArrayObject *self, PyObject *shape) {
7     size_t oldsize, newsize;
8     - int new_nd, k, sd, n, elsize;
9     + int sd, n, elsize;
10     + Py_ssize_t new_nd, k;
11     int refcnt;
12     int new_dimensions[MAX_DIMS];
13     int new_strides[MAX_DIMS];
14     @@ -708,7 +709,7 @@
15     }
16    
17     static PyObject *
18     -array_slice(PyArrayObject *self, int ilow, int ihigh)
19     +array_slice(PyArrayObject *self, Py_ssize_t ilow, Py_ssize_t ihigh)
20     {
21     PyArrayObject *r;
22     int l;
23     @@ -776,7 +777,7 @@
24    
25     if ((item = index2ptr(self, i)) == NULL) return -1;
26    
27     - if(self->descr->type_num != PyArray_OBJECT && PyString_Check(v) && PyObject_Length(v) == 1) {
28     + if(self->descr->type_num != PyArray_OBJECT && PyString_Check(v) && PyObject_Length(v) == (Py_ssize_t)1) {
29     char *s;
30     if ((s=PyString_AsString(v)) == NULL) return -1;
31     if(self->descr->type == 'c') {
32     @@ -823,7 +824,7 @@
33    
34     /* This is basically PySlice_GetIndicesEx, but with our coercion
35     * of indices to integers (plus, that function is new in Python 2.3) */
36     -static int
37     +static Py_ssize_t
38     slice_GetIndices(PySliceObject *r, int length,
39     int *start, int *stop, int *step,
40     int *slicelength)
41     @@ -925,8 +926,8 @@
42    
43     static int parse_index(PyArrayObject *self, PyObject *op,
44     int *dimensions, int *strides, int *offset_ptr) {
45     - int i, j, n;
46     - int nd_old, nd_new, start, offset, n_add, n_pseudo;
47     + Py_ssize_t i, n, j, n_add, n_pseudo;
48     + int nd_old, nd_new, start, offset;
49     int step_size, n_steps;
50     PyObject *op1=NULL;
51     int is_slice;
52     @@ -1098,7 +1099,7 @@
53     }
54    
55     static PyMappingMethods array_as_mapping = {
56     - (inquiry)array_length, /*mp_length*/
57     + (lenfunc)array_length, /*mp_length*/
58     (binaryfunc)array_subscript_nice, /*mp_subscript*/
59     (objobjargproc)array_ass_sub, /*mp_ass_subscript*/
60     };
61     @@ -1183,10 +1184,10 @@
62     }
63    
64     static PyBufferProcs array_as_buffer = {
65     - (getreadbufferproc)array_getreadbuf, /*bf_getreadbuffer*/
66     - (getwritebufferproc)array_getwritebuf, /*bf_getwritebuffer*/
67     - (getsegcountproc)array_getsegcount, /*bf_getsegcount*/
68     - (getcharbufferproc)array_getcharbuf, /*bf_getcharbuffer*/
69     + (readbufferproc)array_getreadbuf, /*bf_getreadbuffer*/
70     + (writebufferproc)array_getwritebuf, /*bf_getwritebuffer*/
71     + (segcountproc)array_getsegcount, /*bf_getsegcount*/
72     + (charbufferproc)array_getcharbuf, /*bf_getcharbuffer*/
73     };
74     /* End methods added by Scott N. Gunyan for buffer extension */
75    
76     @@ -1595,7 +1596,7 @@
77     (unaryfunc)array_negative,
78     (unaryfunc)PyArray_Copy, /*nb_pos*/
79     (unaryfunc)array_absolute, /*(unaryfunc)array_abs,*/
80     - (inquiry)array_nonzero, /*nb_nonzero*/
81     + (lenfunc)array_nonzero, /*nb_nonzero*/
82     (unaryfunc)array_invert, /*nb_invert*/
83     (binaryfunc)array_left_shift, /*nb_lshift*/
84     (binaryfunc)array_right_shift, /*nb_rshift*/
85     @@ -1634,13 +1635,13 @@
86     };
87    
88     static PySequenceMethods array_as_sequence = {
89     - (inquiry)array_length, /*sq_length*/
90     + (lenfunc)array_length, /*sq_length*/
91     (binaryfunc)NULL, /*nb_add, concat is numeric add*/
92     - (intargfunc)NULL, /*nb_multiply, repeat is numeric multiply*/
93     - (intargfunc)array_item_nice, /*sq_item*/
94     - (intintargfunc)array_slice, /*sq_slice*/
95     - (intobjargproc)array_ass_item, /*sq_ass_item*/
96     - (intintobjargproc)array_ass_slice, /*sq_ass_slice*/
97     + (ssizeargfunc)NULL, /*nb_multiply, repeat is numeric multiply*/
98     + (ssizeargfunc)array_item_nice, /*sq_item*/
99     + (ssizessizeargfunc)array_slice, /*sq_slice*/
100     + (ssizeobjargproc)array_ass_item, /*sq_ass_item*/
101     + (ssizessizeobjargproc)array_ass_slice, /*sq_ass_slice*/
102     };
103    
104     /* -------------------------------------------------------------- */
105     @@ -2426,7 +2427,7 @@
106    
107     #if PY_VERSION_HEX >= 0x02010000
108     (traverseproc)0L,
109     - (inquiry)0L,
110     + (lenfunc)0L,
111     (richcmpfunc)array_richcompare, /*tp_richcompfunc*/
112     offsetof(PyArrayObject, weakreflist), /*tp_weaklistoffset */
113     #endif
114     @@ -2463,7 +2464,8 @@
115    
116     static int discover_dimensions(PyObject *s, int nd, int *d, int check_it) {
117     PyObject *e;
118     - int r, n, i, n_lower;
119     + int r, n_lower;
120     + Py_ssize_t i, n;
121    
122     n=PyObject_Length(s);
123     *d = n;
124     @@ -2501,7 +2503,7 @@
125     static int
126     array_objecttype(PyObject *op, int minimum_type, int savespaceflag, int max)
127     {
128     - int l;
129     + Py_ssize_t l;
130     PyObject *ip;
131     int result;
132     PyArray_Descr* descr;
133     @@ -2593,7 +2595,9 @@
134    
135     static int Assign_Array(PyArrayObject *self, PyObject *v) {
136     PyObject *e;
137     - int l, r;
138     + int r;
139     + Py_ssize_t l;
140     +
141    
142     if (!PySequence_Check(v)) {
143     PyErr_SetString(PyExc_ValueError,"assignment from non-sequence");
144     diff -Nur Numeric-24.2.orig/Src/multiarraymodule.c Numeric-24.2/Src/multiarraymodule.c
145     --- Numeric-24.2.orig/Src/multiarraymodule.c 2007-09-02 14:12:11.000000000 +0100
146     +++ Numeric-24.2/Src/multiarraymodule.c 2007-09-02 14:12:42.000000000 +0100
147     @@ -36,7 +36,8 @@
148     extern PyObject *PyArray_Concatenate(PyObject *op) {
149     PyArrayObject *ret, **mps;
150     PyObject *otmp;
151     - int i, n, type_num, tmp, nd=0, new_dim;
152     + int type_num, tmp, nd=0, new_dim;
153     + Py_ssize_t i, n;
154     char *data;
155    
156     n = PySequence_Length(op);
157     @@ -284,7 +285,8 @@
158    
159    
160     extern PyObject *PyArray_Choose(PyObject *ip, PyObject *op) {
161     - int i, n, *sizes, m, offset, elsize, type_num;
162     + int *sizes, elsize, type_num;
163     + Py_ssize_t i, n, m, offset;
164     char *ret_data;
165     PyArrayObject **mps, *ap, *ret;
166     PyObject *otmp;
167     @@ -1139,7 +1141,8 @@
168     static char *kwlist[] = {"shape", "typecode", "savespace", NULL};
169     PyObject *op;
170     PyArray_Descr *descr;
171     - int i, nd, n, dims[MAX_DIMS];
172     + int dims[MAX_DIMS];
173     + Py_ssize_t i, nd, n;
174     int sd;
175     char *data;
176    
177     @@ -1217,7 +1220,8 @@
178     PyArrayObject *ret;
179     char type_char='l';
180     char *type = &type_char, *dptr;
181     - int i, nd, n, dimensions[MAX_DIMS];
182     + int dimensions[MAX_DIMS];
183     + Py_ssize_t i, nd, n;
184     int savespace=0;
185     static char all_zero[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
186     static char *kwlist[] = {"shape", "typecode", "savespace", NULL};
187     diff -Nur Numeric-24.2.orig/Src/ufuncobject.c Numeric-24.2/Src/ufuncobject.c
188     --- Numeric-24.2.orig/Src/ufuncobject.c 2007-09-02 14:12:11.000000000 +0100
189     +++ Numeric-24.2/Src/ufuncobject.c 2007-09-02 14:12:42.000000000 +0100
190     @@ -272,7 +272,7 @@
191    
192     int setup_matrices(PyUFuncObject *self, PyObject *args, PyUFuncGenericFunction *function, void **data,
193     PyArrayObject **mps, char *arg_types) {
194     - int nargs, i;
195     + Py_ssize_t nargs, i;
196    
197     nargs = PyTuple_Size(args);
198     if ((nargs != self->nin) && (nargs != self->nin+self->nout)) {