Author: Stefan H. Muller <shmuell...@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) -@cpython_api([PyObject, rffi.CCHARP, rffi.CCHARP], PyObject) +@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) -@cpython_api([PyObject, rffi.CCHARP, rffi.CCHARP], PyObject) +@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 _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit