Author: Matti Picus <[email protected]>
Branch: 
Changeset: r84929:17d0560c9dda
Date: 2016-06-04 21:38 +0300
http://bitbucket.org/pypy/pypy/changeset/17d0560c9dda/

Log:    fix const char* in function declaration

diff --git a/pypy/module/cpyext/bytearrayobject.py 
b/pypy/module/cpyext/bytearrayobject.py
--- a/pypy/module/cpyext/bytearrayobject.py
+++ b/pypy/module/cpyext/bytearrayobject.py
@@ -85,7 +85,7 @@
     w_buffer = space.call_function(space.w_bytearray, w_obj)
     return make_ref(space, w_buffer)
 
-@cpython_api([rffi.CCHARP, Py_ssize_t], PyObject, result_is_ll=True)
+@cpython_api([CONST_STRING, Py_ssize_t], PyObject, result_is_ll=True)
 def PyByteArray_FromStringAndSize(space, char_p, length):
     """Create a new bytearray object from string and its length, len.  On
     failure, NULL is returned."""
diff --git a/pypy/module/cpyext/test/test_bytearrayobject.py 
b/pypy/module/cpyext/test/test_bytearrayobject.py
--- a/pypy/module/cpyext/test/test_bytearrayobject.py
+++ b/pypy/module/cpyext/test/test_bytearrayobject.py
@@ -104,7 +104,7 @@
                  PyObject* s1 = PyByteArray_FromStringAndSize("test", 4);
                  if (s1 == NULL)
                      return NULL;
-                 char* c = PyByteArray_AsString(s1);
+                 const char* c = PyByteArray_AsString(s1);
                  PyObject* s2 = PyByteArray_FromStringAndSize(c, 4);
                  Py_DECREF(s1);
                  return s2;
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to