[pypy-commit] pypy reflex-support: fixups after recent changes to buffers
wlav
noreply at buildbot.pypy.org
Fri Apr 25 10:15:23 CEST 2014
Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r70967:7244dec161c4
Date: 2014-04-25 00:58 -0700
http://bitbucket.org/pypy/pypy/changeset/7244dec161c4/
Log: fixups after recent changes to buffers
diff --git a/pypy/module/cppyy/converter.py b/pypy/module/cppyy/converter.py
--- a/pypy/module/cppyy/converter.py
+++ b/pypy/module/cppyy/converter.py
@@ -63,7 +63,7 @@
def get_rawbuffer(space, w_obj):
# raw buffer
try:
- buf = space.buffer_w(w_obj, space.BUF_SIMPLE)
+ buf = space.readbuf_w(w_obj)
return rffi.cast(rffi.VOIDP, buf.get_raw_address())
except Exception:
pass
@@ -163,7 +163,7 @@
def to_memory(self, space, w_obj, w_value, offset):
# copy the full array (uses byte copy for now)
address = rffi.cast(rffi.CCHARP, self._get_raw_address(space, w_obj, offset))
- buf = space.buffer_w(w_value, space.BUF_SIMPLE)
+ buf = space.readbuf_w(w_value)
# TODO: report if too many items given?
for i in range(min(self.size*self.typesize, buf.getlength())):
address[i] = buf.getitem(i)
@@ -204,7 +204,7 @@
# copy only the pointer value
rawobject = get_rawobject_nonnull(space, w_obj)
byteptr = rffi.cast(rffi.CCHARPP, capi.direct_ptradd(rawobject, offset))
- buf = space.buffer_w(w_value, space.BUF_SIMPLE)
+ buf = space.readbuf_w(w_value)
try:
byteptr[0] = buf.get_raw_address()
except ValueError:
More information about the pypy-commit
mailing list