Author: Armin Rigo <[email protected]>
Branch:
Changeset: r69120:69b6a25067f8
Date: 2014-02-12 13:25 +0100
http://bitbucket.org/pypy/pypy/changeset/69b6a25067f8/
Log: Use "int" instead of "Signed" in these functions meant to be called
from C code.
diff --git a/pypy/goal/targetpypystandalone.py
b/pypy/goal/targetpypystandalone.py
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -90,9 +90,10 @@
return f
""")
- @entrypoint('main', [rffi.CCHARP, lltype.Signed], c_name='pypy_setup_home')
+ @entrypoint('main', [rffi.CCHARP, rffi.INT], c_name='pypy_setup_home')
def pypy_setup_home(ll_home, verbose):
from pypy.module.sys.initpath import pypy_find_stdlib
+ verbose = rffi.cast(lltype.Signed, verbose)
if ll_home:
home = rffi.charp2str(ll_home)
else:
@@ -120,7 +121,8 @@
@entrypoint('main', [rffi.CCHARP], c_name='pypy_execute_source')
def pypy_execute_source(ll_source):
source = rffi.charp2str(ll_source)
- return _pypy_execute_source(source)
+ res = _pypy_execute_source(source)
+ return rffi.cast(rffi.INT, res)
@entrypoint('main', [], c_name='pypy_init_threads')
def pypy_init_threads():
diff --git a/pypy/interpreter/test/test_targetpypy.py
b/pypy/interpreter/test/test_targetpypy.py
--- a/pypy/interpreter/test/test_targetpypy.py
+++ b/pypy/interpreter/test/test_targetpypy.py
@@ -12,8 +12,10 @@
_, d = create_entry_point(space, None)
execute_source = d['pypy_execute_source']
lls = rffi.str2charp("import sys; sys.modules['xyz'] = 3")
- execute_source(lls)
+ res = execute_source(lls)
lltype.free(lls, flavor='raw')
+ assert lltype.typeOf(res) == rffi.INT
+ assert rffi.cast(lltype.Signed, res) == 0
x = space.int_w(space.getitem(space.getattr(space.builtin_modules['sys'],
space.wrap('modules')),
space.wrap('xyz')))
@@ -24,5 +26,5 @@
# did not crash - the same globals
pypy_setup_home = d['pypy_setup_home']
lls = rffi.str2charp(__file__)
- pypy_setup_home(lls, 1)
+ pypy_setup_home(lls, rffi.cast(rffi.INT, 1))
lltype.free(lls, flavor='raw')
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit