[Python-checkins] r84392 - in python/branches/release31-maint: Include/abstract.h Misc/NEWS Objects/abstract.c Objects/memoryobject.c
antoine.pitrou
python-checkins at python.org
Wed Sep 1 15:01:35 CEST 2010
Author: antoine.pitrou
Date: Wed Sep 1 15:01:35 2010
New Revision: 84392
Log:
Merged revisions 84391 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84391 | antoine.pitrou | 2010-09-01 14:58:21 +0200 (mer., 01 sept. 2010) | 5 lines
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.
........
Modified:
python/branches/release31-maint/ (props changed)
python/branches/release31-maint/Include/abstract.h
python/branches/release31-maint/Misc/NEWS
python/branches/release31-maint/Objects/abstract.c
python/branches/release31-maint/Objects/memoryobject.c
Modified: python/branches/release31-maint/Include/abstract.h
==============================================================================
--- python/branches/release31-maint/Include/abstract.h (original)
+++ python/branches/release31-maint/Include/abstract.h Wed Sep 1 15:01:35 2010
@@ -1233,6 +1233,13 @@
PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
+/* For internal use by buffer API functions */
+PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
+ const Py_ssize_t *shape);
+PyAPI_FUNC(void) _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
+ const Py_ssize_t *shape);
+
+
#ifdef __cplusplus
}
#endif
Modified: python/branches/release31-maint/Misc/NEWS
==============================================================================
--- python/branches/release31-maint/Misc/NEWS (original)
+++ python/branches/release31-maint/Misc/NEWS Wed Sep 1 15:01:35 2010
@@ -514,6 +514,9 @@
Build
-----
+- 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.
+
- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x. Patch by
Sébastien Sablé.
Modified: python/branches/release31-maint/Objects/abstract.c
==============================================================================
--- python/branches/release31-maint/Objects/abstract.c (original)
+++ python/branches/release31-maint/Objects/abstract.c Wed Sep 1 15:01:35 2010
@@ -413,7 +413,7 @@
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 @@
}
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 @@
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 @@
}
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 @@
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 @@
}
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 @@
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);
Modified: python/branches/release31-maint/Objects/memoryobject.c
==============================================================================
--- python/branches/release31-maint/Objects/memoryobject.c (original)
+++ python/branches/release31-maint/Objects/memoryobject.c Wed Sep 1 15:01:35 2010
@@ -172,9 +172,6 @@
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 @@
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);
More information about the Python-checkins
mailing list