Example #1
0
 def f42(n):
     c_strchr = glob.c_strchr
     raw = rffi.str2charp("foobar" + chr((n & 63) + 32))
     argchain = ArgChain()
     argchain = argchain.arg(rffi.cast(lltype.Signed, raw))
     argchain = argchain.arg(rffi.cast(rffi.INT, ord('b')))
     res = c_strchr.call(argchain, rffi.CCHARP)
     check(rffi.charp2str(res) == "bar" + chr((n & 63) + 32))
     rffi.free_charp(raw)
Example #2
0
 def f42(n):
     c_strchr = glob.c_strchr
     raw = rffi.str2charp("foobar" + chr((n & 63) + 32))
     argchain = ArgChain()
     argchain = argchain.arg(rffi.cast(lltype.Signed, raw))
     argchain = argchain.arg(rffi.cast(rffi.INT, ord('b')))
     res = c_strchr.call(argchain, rffi.CCHARP)
     check(rffi.charp2str(res) == "bar" + chr((n & 63) + 32))
     rffi.free_charp(raw)
Example #3
0
 def f42():
     length = len(glob.lst)
     c_qsort = glob.c_qsort
     raw = alloc1()
     fn = llhelper(CALLBACK, rffi._make_wrapper_for(CALLBACK, callback))
     argchain = ArgChain()
     argchain = argchain.arg(rffi.cast(lltype.Signed, raw))
     argchain = argchain.arg(rffi.cast(rffi.SIZE_T, 2))
     argchain = argchain.arg(rffi.cast(rffi.SIZE_T, 8))
     argchain = argchain.arg(rffi.cast(lltype.Signed, fn))
     c_qsort.call(argchain, lltype.Void)
     free1(raw)
     check(len(glob.lst) > length)
     del glob.lst[:]
Example #4
0
 def f42():
     length = len(glob.lst)
     c_qsort = glob.c_qsort
     raw = alloc1()
     fn = llhelper(CALLBACK, rffi._make_wrapper_for(CALLBACK, callback))
     argchain = ArgChain()
     argchain = argchain.arg(rffi.cast(lltype.Signed, raw))
     argchain = argchain.arg(rffi.cast(rffi.SIZE_T, 2))
     argchain = argchain.arg(rffi.cast(rffi.SIZE_T, 8))
     argchain = argchain.arg(rffi.cast(lltype.Signed, fn))
     c_qsort.call(argchain, lltype.Void)
     free1(raw)
     check(len(glob.lst) > length)
     del glob.lst[:]