Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r44974:6c651347194d Date: 2011-06-16 15:03 +0200 http://bitbucket.org/pypy/pypy/changeset/6c651347194d/
Log: Silence warnings by declaring argtypes and restype. diff --git a/lib_pypy/resource.py b/lib_pypy/resource.py --- a/lib_pypy/resource.py +++ b/lib_pypy/resource.py @@ -7,7 +7,7 @@ from ctypes_support import standard_c_lib as libc from ctypes_support import get_errno -from ctypes import Structure, c_int, c_long, byref, sizeof +from ctypes import Structure, c_int, c_long, byref, sizeof, POINTER from errno import EINVAL, EPERM import _structseq @@ -25,6 +25,8 @@ _setrlimit = libc.setrlimit try: _getpagesize = libc.getpagesize + _getpagesize.argtypes = () + _getpagesize.restype = c_int except AttributeError: from os import sysconf _getpagesize = None @@ -61,6 +63,10 @@ ("ru_nivcsw", c_long), ) +_getrusage.argtypes = (c_int, POINTER(_struct_rusage)) +_getrusage.restype = c_int + + class struct_rusage: __metaclass__ = _structseq.structseqtype @@ -94,6 +100,12 @@ ("rlim_max", rlim_t), ) +_getrlimit.argtypes = (c_int, POINTER(rlimit)) +_getrlimit.restype = c_int +_setrlimit.argtypes = (c_int, POINTER(rlimit)) +_setrlimit.restype = c_int + + @builtinify def getrusage(who): ru = _struct_rusage() _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit