[pypy-svn] r47552 - pypy/dist/pypy/module/_ffi
fijal at codespeak.net
fijal at codespeak.net
Thu Oct 18 16:21:18 CEST 2007
Author: fijal
Date: Thu Oct 18 16:21:16 2007
New Revision: 47552
Modified:
pypy/dist/pypy/module/_ffi/interp_ffi.py
Log:
Seems to be rpython this time.
Modified: pypy/dist/pypy/module/_ffi/interp_ffi.py
==============================================================================
--- pypy/dist/pypy/module/_ffi/interp_ffi.py (original)
+++ pypy/dist/pypy/module/_ffi/interp_ffi.py Thu Oct 18 16:21:16 2007
@@ -152,12 +152,10 @@
return checker
_SIZE_CHECKERS = {
- 'h' : True,
- 'H' : False,
- 'I' : False,
- 'c' : False,
'b' : True,
'B' : False,
+ 'h' : True,
+ 'H' : False,
'i' : True,
'I' : False,
'l' : True,
@@ -170,7 +168,6 @@
SIZE_CHECKERS = {}
for c, signed in _SIZE_CHECKERS.items():
SIZE_CHECKERS[c] = make_size_checker(c, native_fmttable[c]['size'], signed)
-del _SIZE_CHECKERS
unroll_size_checkers = unrolling_iterable(SIZE_CHECKERS.items())
def unwrap_value(space, push_func, add_arg, argdesc, tp, w_arg, to_free):
@@ -202,7 +199,7 @@
else:
raise OperationError(space.w_TypeError, w(
"Expected structure, array or simple type"))
- if tp == "c" or tp == "b" or tp == "B":
+ if tp == "c":
s = space.str_w(w_arg)
if len(s) != 1:
raise OperationError(space.w_ValueError, w(
@@ -212,11 +209,11 @@
else:
for c, checker in unroll_size_checkers:
if tp == c:
- if tp == "q":
+ if c == "q":
val = space.r_longlong_w(w_arg)
- elif tp == "Q":
+ elif c == "Q":
val = space.r_ulonglong_w(w_arg)
- elif tp == "I" or tp == "L":
+ elif c == "I" or c == "L" or c =="B":
val = space.uint_w(w_arg)
else:
val = space.int_w(w_arg)
More information about the Pypy-commit
mailing list