summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-01 12:58:21 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-01 12:58:21 (GMT)
commitf68c2a701bbca88da1299efe4aba84699827e791 (patch)
tree786ffc853d9465924c48cd3f6b7c7c9ce9881e9e /Objects
parent53c58f8bcc6513321a5614e31eeb468eda4f4a40 (diff)
downloadcpython-f68c2a701bbca88da1299efe4aba84699827e791.zip
cpython-f68c2a701bbca88da1299efe4aba84699827e791.tar.gz
cpython-f68c2a701bbca88da1299efe4aba84699827e791.tar.bz2
Issue #3101: Helper functions _add_one_to_C() and _add_one_to_F() become
_Py_add_one_to_C() and _Py_add_one_to_F(), respectively.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c18
-rw-r--r--Objects/memoryobject.c7
2 files changed, 11 insertions, 14 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index d5a5d3c..612271d 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -413,7 +413,7 @@ PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices)
void
-_add_one_to_index_F(int nd, Py_ssize_t *index, Py_ssize_t *shape)
+_Py_add_one_to_index_F(int nd, Py_ssize_t *index, const Py_ssize_t *shape)
{
int k;
@@ -429,7 +429,7 @@ _add_one_to_index_F(int nd, Py_ssize_t *index, Py_ssize_t *shape)
}
void
-_add_one_to_index_C(int nd, Py_ssize_t *index, Py_ssize_t *shape)
+_Py_add_one_to_index_C(int nd, Py_ssize_t *index, const Py_ssize_t *shape)
{
int k;
@@ -453,7 +453,7 @@ int
PyBuffer_ToContiguous(void *buf, Py_buffer *view, Py_ssize_t len, char fort)
{
int k;
- void (*addone)(int, Py_ssize_t *, Py_ssize_t *);
+ void (*addone)(int, Py_ssize_t *, const Py_ssize_t *);
Py_ssize_t *indices, elements;
char *dest, *ptr;
@@ -480,10 +480,10 @@ PyBuffer_ToContiguous(void *buf, Py_buffer *view, Py_ssize_t len, char fort)
}
if (fort == 'F') {
- addone = _add_one_to_index_F;
+ addone = _Py_add_one_to_index_F;
}
else {
- addone = _add_one_to_index_C;
+ addone = _Py_add_one_to_index_C;
}
dest = buf;
/* XXX : This is not going to be the fastest code in the world
@@ -504,7 +504,7 @@ int
PyBuffer_FromContiguous(Py_buffer *view, void *buf, Py_ssize_t len, char fort)
{
int k;
- void (*addone)(int, Py_ssize_t *, Py_ssize_t *);
+ void (*addone)(int, Py_ssize_t *, const Py_ssize_t *);
Py_ssize_t *indices, elements;
char *src, *ptr;
@@ -531,10 +531,10 @@ PyBuffer_FromContiguous(Py_buffer *view, void *buf, Py_ssize_t len, char fort)
}
if (fort == 'F') {
- addone = _add_one_to_index_F;
+ addone = _Py_add_one_to_index_F;
}
else {
- addone = _add_one_to_index_C;
+ addone = _Py_add_one_to_index_C;
}
src = buf;
/* XXX : This is not going to be the fastest code in the world
@@ -611,7 +611,7 @@ int PyObject_CopyData(PyObject *dest, PyObject *src)
elements *= view_src.shape[k];
}
while (elements--) {
- _add_one_to_index_C(view_src.ndim, indices, view_src.shape);
+ _Py_add_one_to_index_C(view_src.ndim, indices, view_src.shape);
dptr = PyBuffer_GetPointer(&view_dest, indices);
sptr = PyBuffer_GetPointer(&view_src, indices);
memcpy(dptr, sptr, view_src.itemsize);
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index 70ae6cc..9a62dd8 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -172,9 +172,6 @@ _strided_copy_nd(char *dest, char *src, int nd, Py_ssize_t *shape,
return;
}
-void _add_one_to_index_F(int nd, Py_ssize_t *index, Py_ssize_t *shape);
-void _add_one_to_index_C(int nd, Py_ssize_t *index, Py_ssize_t *shape);
-
static int
_indirect_copy_nd(char *dest, Py_buffer *view, char fort)
{
@@ -203,10 +200,10 @@ _indirect_copy_nd(char *dest, Py_buffer *view, char fort)
elements *= view->shape[k];
}
if (fort == 'F') {
- func = _add_one_to_index_F;
+ func = _Py_add_one_to_index_F;
}
else {
- func = _add_one_to_index_C;
+ func = _Py_add_one_to_index_C;
}
while (elements--) {
func(view->ndim, indices, view->shape);