From 56454eba3384ee7718ff793ebcc9558b7da5af55 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 22 Apr 2014 00:39:21 +0300 Subject: [PATCH] all: Tighten up typecodes for FFI module. --- fcntl/fcntl.py | 4 ++-- os/os.py | 2 +- re-pcre/re.py | 4 ++-- select/select.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fcntl/fcntl.py b/fcntl/fcntl.py index b36879c6..06a26422 100644 --- a/fcntl/fcntl.py +++ b/fcntl/fcntl.py @@ -4,9 +4,9 @@ import ffi libc = ffi.open("libc.so.6") fcntl_l = libc.func("i", "fcntl", "iil") -fcntl_s = libc.func("i", "fcntl", "iis") +fcntl_s = libc.func("i", "fcntl", "iip") ioctl_l = libc.func("i", "ioctl", "iil") -ioctl_s = libc.func("i", "ioctl", "iis") +ioctl_s = libc.func("i", "ioctl", "iip") def fcntl(fd, op, arg): diff --git a/os/os.py b/os/os.py index 6bd1dddd..875a54ea 100644 --- a/os/os.py +++ b/os/os.py @@ -5,7 +5,7 @@ libc = ffi.open("libc.so.6") errno = libc.var("i", "errno") mkdir_ = libc.func("i", "mkdir", "si") -read_ = libc.func("i", "read", "iPi") +read_ = libc.func("i", "read", "ipi") write_ = libc.func("i", "write", "iPi") diff --git a/re-pcre/re.py b/re-pcre/re.py index d4dd6d2f..10faa43f 100644 --- a/re-pcre/re.py +++ b/re-pcre/re.py @@ -12,11 +12,11 @@ pcre_compile = pcre.func("p", "pcre_compile", "sipps") # int pcre_exec(const pcre *code, const pcre_extra *extra, # const char *subject, int length, int startoffset, # int options, int *ovector, int ovecsize); -pcre_exec = pcre.func("i", "pcre_exec", "ppsiiipi") +pcre_exec = pcre.func("i", "pcre_exec", "PPsiiipi") # int pcre_fullinfo(const pcre *code, const pcre_extra *extra, # int what, void *where); -pcre_fullinfo = pcre.func("i", "pcre_fullinfo", "ppip") +pcre_fullinfo = pcre.func("i", "pcre_fullinfo", "PPip") IGNORECASE = I = 1 diff --git a/select/select.py b/select/select.py index 7526dd0b..9efb0915 100644 --- a/select/select.py +++ b/select/select.py @@ -9,7 +9,7 @@ libc = ffi.open("libc.so.6") #int epoll_create(int size); epoll_create = libc.func("i", "epoll_create", "i") #int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); -epoll_ctl = libc.func("i", "epoll_ctl", "iiip") +epoll_ctl = libc.func("i", "epoll_ctl", "iiiP") #int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout); epoll_wait = libc.func("i", "epoll_wait", "ipii")