diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-02-15 17:27:45 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-02-15 17:27:45 (GMT) |
commit | 18e165558b24d29e7e0ca501842b9236589b012a (patch) | |
tree | 841678b5dc1aff3aa48701fee33a6ba7be00a72b /RISCOS | |
parent | 44829297348d9121a03fc7df2fac557b583cc7fa (diff) | |
download | cpython-18e165558b24d29e7e0ca501842b9236589b012a.zip cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.gz cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.bz2 |
Merge ssize_t branch.
Diffstat (limited to 'RISCOS')
-rw-r--r-- | RISCOS/Modules/drawfmodule.c | 26 | ||||
-rw-r--r-- | RISCOS/Modules/swimodule.c | 26 |
2 files changed, 26 insertions, 26 deletions
diff --git a/RISCOS/Modules/drawfmodule.c b/RISCOS/Modules/drawfmodule.c index db74d36..5f8dc3e 100644 --- a/RISCOS/Modules/drawfmodule.c +++ b/RISCOS/Modules/drawfmodule.c @@ -66,7 +66,7 @@ static void countobjs(PyDrawFObject *pd) if ((char*)d==end) pd->nobjs=k; } -static drawfile_object *findobj(PyDrawFObject *pd,int n) +static drawfile_object *findobj(PyDrawFObject *pd,Py_ssize_t n) { drawfile_diagram *dd=pd->drawf; drawfile_object *d=dd->objects; for(;n>0;n--) d=NEXT(d); @@ -520,14 +520,14 @@ static PyObject *drawf_concat(PyDrawFObject *b,PyDrawFObject *c) return (PyObject*)p; } -static PyObject *drawf_repeat(PyDrawFObject *b,int i) +static PyObject *drawf_repeat(PyDrawFObject *b,Py_ssize_t i) { PyErr_SetString(PyExc_IndexError,"drawf repetition not implemented"); return NULL; } -static PyObject *drawf_item(PyDrawFObject *b,int i) +static PyObject *drawf_item(PyDrawFObject *b,Py_ssize_t i) { PyDrawFObject *c; - int size; + Py_ssize_t size; drawfile_diagram *dd; drawfile_object *d; if(i<0||i>=b->nobjs) @@ -546,9 +546,9 @@ static PyObject *drawf_item(PyDrawFObject *b,int i) return (PyObject*)c; } -static PyObject *drawf_slice(PyDrawFObject *b,int i,int j) +static PyObject *drawf_slice(PyDrawFObject *b,Py_ssize_t i,Py_ssize_t j) { PyDrawFObject *c; - int size,n; + Py_ssize_t size,n; drawfile_diagram *dd; drawfile_object *d; if(i<0||j>b->nobjs) @@ -570,7 +570,7 @@ static PyObject *drawf_slice(PyDrawFObject *b,int i,int j) return (PyObject*)c; } -static int drawf_ass_item(PyDrawFObject *b,int i,PyObject *v) +static int drawf_ass_item(PyDrawFObject *b,Py_ssize_t i,PyObject *v) { PyErr_SetString(PyExc_IndexError,"drawf ass not implemented"); return NULL; } @@ -587,7 +587,7 @@ static int drawf_ass_item(PyDrawFObject *b,int i,PyObject *v) } */ -static int drawf_ass_slice(PyDrawFObject *b,int i,int j,PyObject *v) +static int drawf_ass_slice(PyDrawFObject *b,Py_ssize_t i,Py_ssize_t j,PyObject *v) { PyErr_SetString(PyExc_IndexError,"drawf ass_slice not implemented"); return NULL; } @@ -595,11 +595,11 @@ static int drawf_ass_slice(PyDrawFObject *b,int i,int j,PyObject *v) static PySequenceMethods drawf_as_sequence= { (inquiry)drawf_len, (binaryfunc)drawf_concat, - (intargfunc)drawf_repeat, - (intargfunc)drawf_item, - (intintargfunc)drawf_slice, - (intobjargproc)drawf_ass_item, - (intintobjargproc)drawf_ass_slice, + (ssizeargfunc)drawf_repeat, + (ssizeargfunc)drawf_item, + (ssizessizeargfunc)drawf_slice, + (ssizeobjargproc)drawf_ass_item, + (ssizessizeobjargproc)drawf_ass_slice, }; static PyObject *PyDrawF_GetAttr(PyDrawFObject *s,char *name) diff --git a/RISCOS/Modules/swimodule.c b/RISCOS/Modules/swimodule.c index 583fc57..b460b2f 100644 --- a/RISCOS/Modules/swimodule.c +++ b/RISCOS/Modules/swimodule.c @@ -215,12 +215,12 @@ static PyObject *block_concat(PyBlockObject *b,PyBlockObject *c) return NULL; } -static PyObject *block_repeat(PyBlockObject *b,int i) +static PyObject *block_repeat(PyBlockObject *b,Py_ssize_t i) { PyErr_SetString(PyExc_IndexError,"block repetition not implemented"); return NULL; } -static PyObject *block_item(PyBlockObject *b,int i) +static PyObject *block_item(PyBlockObject *b,Py_ssize_t i) { if(i<0||4*i>=b->length) { PyErr_SetString(PyExc_IndexError,"block index out of range"); return NULL; @@ -228,8 +228,8 @@ static PyObject *block_item(PyBlockObject *b,int i) return PyInt_FromLong(((long*)(b->block))[i]); } -static PyObject *block_slice(PyBlockObject *b,int i,int j) -{ int n,k; +static PyObject *block_slice(PyBlockObject *b,Py_ssize_t i,Py_ssize_t j) +{ Py_ssize_t n,k; long *p=b->block; PyObject *result; if(j>b->length/4) j=b->length/4; @@ -239,11 +239,11 @@ static PyObject *block_slice(PyBlockObject *b,int i,int j) } n=j-i; result=PyList_New(n); - for(k=0;k<n;k++) PyList_SetItem(result,k,PyInt_FromLong(p[i+k])); + for(k=0;k<n;k++) PyList_SetItem(result,k,PyInt_FromSsize_t(p[i+k])); return result; } -static int block_ass_item(PyBlockObject *b,int i,PyObject *v) +static int block_ass_item(PyBlockObject *b,Py_ssize_t i,PyObject *v) { if(i<0||i>=b->length/4) { PyErr_SetString(PyExc_IndexError,"block index out of range"); return -1; @@ -256,8 +256,8 @@ static int block_ass_item(PyBlockObject *b,int i,PyObject *v) return 0; } -static int block_ass_slice(PyBlockObject *b,int i,int j,PyObject *v) -{ int n,k; +static int block_ass_slice(PyBlockObject *b,Py_ssize_t i,Py_ssize_t j,PyObject *v) +{ Py_ssize_t n,k; long *p=b->block; if(j>b->length/4) j=b->length/4; if(i<0||i>j) @@ -281,11 +281,11 @@ static int block_ass_slice(PyBlockObject *b,int i,int j,PyObject *v) static PySequenceMethods block_as_sequence= { (inquiry)block_len, /*sq_length*/ (binaryfunc)block_concat, /*sq_concat*/ - (intargfunc)block_repeat, /*sq_repeat*/ - (intargfunc)block_item, /*sq_item*/ - (intintargfunc)block_slice, /*sq_slice*/ - (intobjargproc)block_ass_item, /*sq_ass_item*/ - (intintobjargproc)block_ass_slice, /*sq_ass_slice*/ + (ssizeargfunc)block_repeat, /*sq_repeat*/ + (ssizeargfunc)block_item, /*sq_item*/ + (ssizessizeargfunc)block_slice, /*sq_slice*/ + (ssizeobjargproc)block_ass_item, /*sq_ass_item*/ + (ssizessizeobjargproc)block_ass_slice, /*sq_ass_slice*/ }; static PyObject *PyBlock_GetAttr(PyBlockObject *s,char *name) |