diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2009-04-09 05:46:52 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2009-04-09 05:46:52 +0000 |
commit | bc936c7253108e2e2d39860841821ec128922c8c (patch) | |
tree | 2a1623670b9561495e390c620794c12bc0721953 /numpy/core/src | |
parent | 942b09dec6f5859bc8f058b638fada06c1de3322 (diff) | |
download | numpy-bc936c7253108e2e2d39860841821ec128922c8c.tar.gz |
Nuke obsolete register keyword in c sources.
Diffstat (limited to 'numpy/core/src')
-rw-r--r-- | numpy/core/src/arrayobject.c | 36 | ||||
-rw-r--r-- | numpy/core/src/arraytypes.inc.src | 48 | ||||
-rw-r--r-- | numpy/core/src/multiarraymodule.c | 8 | ||||
-rw-r--r-- | numpy/core/src/ucsnarrow.c | 10 | ||||
-rw-r--r-- | numpy/core/src/umath_tests.c.src | 2 |
5 files changed, 53 insertions, 51 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 34df74606..69dd6a408 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -1798,17 +1798,19 @@ _append_new(int *types, int insert) } /*NUMPY_API - Register a type number indicating that a descriptor can be cast - to it safely -*/ + * Register a type number indicating that a descriptor can be cast + * to it safely + */ static int PyArray_RegisterCanCast(PyArray_Descr *descr, int totype, NPY_SCALARKIND scalar) { if (scalar == PyArray_NOSCALAR) { - /* register with cancastto */ - /* These lists won't be freed once created - -- they become part of the data-type */ + /* + * register with cancastto + * These lists won't be freed once created + * -- they become part of the data-type + */ if (descr->f->cancastto == NULL) { descr->f->cancastto = (int *)malloc(1*sizeof(int)); descr->f->cancastto[0] = PyArray_NOTYPE; @@ -4621,9 +4623,9 @@ array_str(PyArrayObject *self) /*NUMPY_API */ static int -PyArray_CompareUCS4(npy_ucs4 *s1, npy_ucs4 *s2, register size_t len) +PyArray_CompareUCS4(npy_ucs4 *s1, npy_ucs4 *s2, size_t len) { - register PyArray_UCS4 c1, c2; + PyArray_UCS4 c1, c2; while(len-- > 0) { c1 = *s1++; c2 = *s2++; @@ -5449,9 +5451,9 @@ PyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) static int _IsContiguous(PyArrayObject *ap) { - register intp sd; - register intp dim; - register int i; + intp sd; + intp dim; + int i; if (ap->nd == 0) { return 1; @@ -5479,9 +5481,9 @@ _IsContiguous(PyArrayObject *ap) static int _IsFortranContiguous(PyArrayObject *ap) { - register intp sd; - register intp dim; - register int i; + intp sd; + intp dim; + int i; if (ap->nd == 0) { return 1; @@ -5850,7 +5852,7 @@ PyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr, int nd, int flags, PyObject *obj) { PyArrayObject *self; - register int i; + int i; size_t sd; intp largest; intp size; @@ -8609,7 +8611,7 @@ _bufferedcast(PyArrayObject *out, PyArrayObject *in, char *inbuffer, *bptr, *optr; char *outbuffer=NULL; PyArrayIterObject *it_in = NULL, *it_out = NULL; - register intp i, index; + intp i, index; intp ncopies = PyArray_SIZE(out) / PyArray_SIZE(in); int elsize=in->descr->elsize; int nels = PyArray_BUFSIZE; @@ -9629,7 +9631,7 @@ static int PyArray_CanCastSafely(int fromtype, int totype) { PyArray_Descr *from, *to; - register int felsize, telsize; + int felsize, telsize; if (fromtype == totype) { return 1; diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src index 9094bb6c4..d583f0c0c 100644 --- a/numpy/core/src/arraytypes.inc.src +++ b/numpy/core/src/arraytypes.inc.src @@ -771,7 +771,7 @@ BOOL_to_@TOTYPE@(Bool *ip, @totype@ *op, intp n, * longlong, ulonglong, float, double, longdouble# */ static void -@FROMTYPE@_to_@TOTYPE@(register @fromtype@ *ip, register @totype@ *op, register intp n, +@FROMTYPE@_to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, intp n, PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop)) { while (n--) { @@ -893,7 +893,7 @@ static void @from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, PyArrayObject *aop) { - register intp i; + intp i; PyObject *temp = NULL; int skip = aip->descr->elsize; int oskip = @oskip@; @@ -1229,7 +1229,7 @@ static void memcpy(dst, src, sizeof(@type@)); if (swap) { - register char *a, *b, c; + char *a, *b, c; a = (char *)dst; #if SIZEOF_@fsize@ == 4 b = a + 3; @@ -1303,7 +1303,7 @@ static void c = *a; *a++ = *b; *b = c; #else { - register int i, nn; + int i, nn; b = a + (SIZEOF_@fsize@-1); nn = SIZEOF_@fsize@ / 2; for (i=0; i<nn; i++) { @@ -1325,9 +1325,9 @@ static void #define __ALIGNED(obj, sz) ((((size_t) obj) % (sz))==0) static void OBJECT_copyswapn (PyObject **dst, intp dstride, PyObject **src, intp sstride, - register intp n, int NPY_UNUSED(swap), void *NPY_UNUSED(arr)) + intp n, int NPY_UNUSED(swap), void *NPY_UNUSED(arr)) { - register intp i; + intp i; if (src != NULL) { dstride /= sizeof(PyObject **); sstride /= sizeof(PyObject **); @@ -1509,7 +1509,7 @@ UNICODE_copyswapn (char *dst, intp dstride, char *src, intp sstride, n *= itemsize; if (swap) { - register char *a, *b, c; + char *a, *b, c; n >>= 2; /* n is the number of unicode characters to swap */ for (a = (char *)dst; n>0; n--) { b = a + 3; @@ -1540,7 +1540,7 @@ UNICODE_copyswap (char *dst, char *src, int swap, PyArrayObject *arr) } if (swap) { - register char *a, *b, c; + char *a, *b, c; itemsize >>= 2; for (a = (char *)dst; itemsize>0; itemsize--) { b = a + 3; @@ -1798,11 +1798,11 @@ STRING_compare(char *ip1, char *ip2, PyArrayObject *ap) /* taken from Python */ static int -UNICODE_compare(register PyArray_UCS4 *ip1, register PyArray_UCS4 *ip2, +UNICODE_compare(PyArray_UCS4 *ip1, PyArray_UCS4 *ip2, PyArrayObject *ap) { - register int itemsize=ap->descr->elsize; - register PyArray_UCS4 c1, c2; + int itemsize=ap->descr->elsize; + PyArray_UCS4 c1, c2; if (itemsize < 0) return 0; @@ -1897,7 +1897,7 @@ finish: static int @fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip)) { - register intp i; + intp i; @type@ mp=*ip; *max_ind=0; for (i=1; i<n; i++) { @@ -1915,7 +1915,7 @@ static int static int OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip)) { - register intp i; + intp i; PyObject *mp=ip[0]; *max_ind=0; i = 1; while(i<n && mp==NULL) { @@ -1941,7 +1941,7 @@ OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(ai static int @fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip) { - register intp i; + intp i; int elsize = aip->descr->elsize; @type@ *mp = (@type@ *)_pya_malloc(elsize); @@ -1967,8 +1967,8 @@ static void BOOL_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, void *NPY_UNUSED(ignore)) { - register Bool tmp=FALSE; - register intp i; + Bool tmp=FALSE; + intp i; for(i=0;i<n;i++,ip1+=is1,ip2+=is2) { if ((*((Bool *)ip1) != 0) && (*((Bool *)ip2) != 0)) { tmp = TRUE; @@ -1987,8 +1987,8 @@ static void @name@_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, void *NPY_UNUSED(ignore)) { - register @out@ tmp=(@out@)0; - register intp i; + @out@ tmp=(@out@)0; + intp i; for(i=0;i<n;i++,ip1+=is1,ip2+=is2) { tmp += (@out@)(*((@type@ *)ip1)) * \ (@out@)(*((@type@ *)ip2)); @@ -2085,7 +2085,7 @@ finish: static void @NAME@_fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignored)) { - register intp i; + intp i; @typ@ start = buffer[0]; @typ@ delta = buffer[1]; delta -= start; @@ -2102,7 +2102,7 @@ static void static void @NAME@_fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignore)) { - register intp i; + intp i; @typ@ start; @typ@ delta; @@ -2151,7 +2151,7 @@ static void static void @NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *NPY_UNUSED(ignored)) { - register intp i; + intp i; @typ@ val = *value; for (i=0; i<length; ++i) { buffer[i] = val; @@ -2173,7 +2173,7 @@ static void static void @name@_fastclip(@type@ *in, intp ni, @type@ *min, @type@ *max, @type@ *out) { - register npy_intp i; + npy_intp i; @type@ max_val=0, min_val=0; if (max != NULL) @@ -2218,7 +2218,7 @@ static void static void @name@_fastclip(@type@ *in, intp ni, @type@ *min, @type@ *max, @type@ *out) { - register npy_intp i; + npy_intp i; @type@ max_val, min_val; min_val = *min; @@ -2272,7 +2272,7 @@ static void static void @name@_fastputmask(@type@ *in, Bool *mask, intp ni, @type@ *vals, intp nv) { - register npy_intp i; + npy_intp i; @type@ s_val; if (nv == 1) { diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index 54bba9d08..99e29da32 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -112,7 +112,7 @@ static PyObject *MultiArrayError; * Multiply a List of ints */ static int -PyArray_MultiplyIntList(register int *l1, register int n) +PyArray_MultiplyIntList(int *l1, int n) { int s = 1; @@ -126,7 +126,7 @@ PyArray_MultiplyIntList(register int *l1, register int n) * Multiply a List */ static intp -PyArray_MultiplyList(register intp *l1, register int n) +PyArray_MultiplyList(intp *l1, int n) { intp s = 1; @@ -165,7 +165,7 @@ PyArray_OverflowMultiplyList(intp *l1, int n) * Produce a pointer into array */ static void * -PyArray_GetPtr(PyArrayObject *obj, register intp* ind) +PyArray_GetPtr(PyArrayObject *obj, intp* ind) { int n = obj->nd; intp *strides = obj->strides; @@ -4879,7 +4879,7 @@ PyArray_ClipmodeConverter(PyObject *object, NPY_CLIPMODE *val) static int PyArray_TypestrConvert(int itemsize, int gentype) { - register int newtype = gentype; + int newtype = gentype; if (gentype == PyArray_GENBOOLLTR) { if (itemsize == 1) { diff --git a/numpy/core/src/ucsnarrow.c b/numpy/core/src/ucsnarrow.c index 9c4a45e9e..cd62c639e 100644 --- a/numpy/core/src/ucsnarrow.c +++ b/numpy/core/src/ucsnarrow.c @@ -15,7 +15,7 @@ static int PyUCS2Buffer_FromUCS4(Py_UNICODE *ucs2, PyArray_UCS4 *ucs4, int ucs4length) { - register int i; + int i; int numucs2 = 0; PyArray_UCS4 chr; for (i=0; i<ucs4length; i++) { @@ -47,10 +47,10 @@ PyUCS2Buffer_FromUCS4(Py_UNICODE *ucs2, PyArray_UCS4 *ucs4, int ucs4length) static int PyUCS2Buffer_AsUCS4(Py_UNICODE *ucs2, PyArray_UCS4 *ucs4, int ucs2len, int ucs4len) { - register int i; - register PyArray_UCS4 chr; - register Py_UNICODE ch; - register int numchars=0; + int i; + PyArray_UCS4 chr; + Py_UNICODE ch; + int numchars=0; for (i=0; (i < ucs2len) && (numchars < ucs4len); i++) { ch = *ucs2++; diff --git a/numpy/core/src/umath_tests.c.src b/numpy/core/src/umath_tests.c.src index 3d0589d46..1cf69aefa 100644 --- a/numpy/core/src/umath_tests.c.src +++ b/numpy/core/src/umath_tests.c.src @@ -151,7 +151,7 @@ static void char *ip1=args[0], *ip2=args[1], *op=args[2]; for (m = 0; m < dm; m++) { for (n = 0; n < dn; n++) { - register @typ@ val1 = (*(@typ@ *)ip1); + @typ@ val1 = (*(@typ@ *)ip1); for (p = 0; p < dp; p++) { if (n == 0) *(@typ@ *)op = 0; *(@typ@ *)op += val1 * (*(@typ@ *)ip2); |