Commit 70536212 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

examples/unix/ffi_example.py: Remove TODO, make output more clear.

parent ecfd8e10
...@@ -18,8 +18,8 @@ print() ...@@ -18,8 +18,8 @@ print()
perror("ffi before error") perror("ffi before error")
open("somethingnonexistent__", 0) open("somethingnonexistent__", 0)
print(errno) print("errno object:", errno)
print(errno.get()) print("errno value:", errno.get())
perror("ffi after error") perror("ffi after error")
print() print()
...@@ -32,8 +32,7 @@ def cmp(pa, pb): ...@@ -32,8 +32,7 @@ def cmp(pa, pb):
cmp_c = ffi.callback("i", cmp, "pp") cmp_c = ffi.callback("i", cmp, "pp")
print("callback:", cmp_c) print("callback:", cmp_c)
# TODO: violates Py semantics, pass bytearray s = bytearray(b"foobar")
s = "foobar"
print("org string:", s) print("org string:", s)
qsort(s, len(s), 1, cmp_c) qsort(s, len(s), 1, cmp_c)
print("qsort'ed:", s) print("qsort'ed string:", s)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment