[pypy-commit] pypy pypy-pyarray: - cpyext/include/complexobject.h: Add Py_LOCAL_INLINE() to translate.

shmuller noreply at buildbot.pypy.org
Mon Aug 26 22:02:45 CEST 2013


Author: Stefan H. Muller <shmueller2 at gmail.com>
Branch: pypy-pyarray
Changeset: r66335:92a2115f0785
Date: 2013-07-30 16:29 +0200
http://bitbucket.org/pypy/pypy/changeset/92a2115f0785/

Log:	- cpyext/include/complexobject.h: Add Py_LOCAL_INLINE() to
	translate.
	- cpyext/stringobject.py: Replace 4x rffi.CCHARP -> CONST_STRING for
	const correctness.

diff --git a/pypy/module/cpyext/include/complexobject.h b/pypy/module/cpyext/include/complexobject.h
--- a/pypy/module/cpyext/include/complexobject.h
+++ b/pypy/module/cpyext/include/complexobject.h
@@ -28,7 +28,7 @@
 // shmuller 2013/07/30: Make a function, since macro will fail in C++ due to 
 //                      const correctness if called with "const Py_complex"
 //#define PyComplex_FromCComplex(c) _PyComplex_FromCComplex(&c)
-PyObject *PyComplex_FromCComplex(Py_complex c) {
+Py_LOCAL_INLINE(PyObject) *PyComplex_FromCComplex(Py_complex c) {
     return _PyComplex_FromCComplex(&c);
 }
 
diff --git a/pypy/module/cpyext/stringobject.py b/pypy/module/cpyext/stringobject.py
--- a/pypy/module/cpyext/stringobject.py
+++ b/pypy/module/cpyext/stringobject.py
@@ -275,7 +275,7 @@
     Py_DecRef(space, string[0])
     string[0] = make_ref(space, w_str)
 
- at cpython_api([PyObject, rffi.CCHARP, rffi.CCHARP], PyObject)
+ at cpython_api([PyObject, CONST_STRING, CONST_STRING], PyObject)
 def PyString_AsEncodedObject(space, w_str, encoding, errors):
     """Encode a string object using the codec registered for encoding and return
     the result as Python object. encoding and errors have the same meaning as
@@ -294,7 +294,7 @@
         w_errors = space.wrap(rffi.charp2str(errors))
     return space.call_method(w_str, 'encode', w_encoding, w_errors)
 
- at cpython_api([PyObject, rffi.CCHARP, rffi.CCHARP], PyObject)
+ at cpython_api([PyObject, CONST_STRING, CONST_STRING], PyObject)
 def PyString_AsDecodedObject(space, w_str, encoding, errors):
     """Decode a string object by passing it to the codec registered
     for encoding and return the result as Python object. encoding and


More information about the pypy-commit mailing list