Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
70536212
Commit
70536212
authored
Jun 17, 2016
by
Paul Sokolovsky
Browse files
examples/unix/ffi_example.py: Remove TODO, make output more clear.
parent
ecfd8e10
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/unix/ffi_example.py
View file @
70536212
...
...
@@ -18,8 +18,8 @@ print()
perror
(
"ffi before error"
)
open
(
"somethingnonexistent__"
,
0
)
print
(
errno
)
print
(
errno
.
get
())
print
(
"errno object:"
,
errno
)
print
(
"errno value:"
,
errno
.
get
())
perror
(
"ffi after error"
)
print
()
...
...
@@ -32,8 +32,7 @@ def cmp(pa, pb):
cmp_c
=
ffi
.
callback
(
"i"
,
cmp
,
"pp"
)
print
(
"callback:"
,
cmp_c
)
# TODO: violates Py semantics, pass bytearray
s
=
"foobar"
s
=
bytearray
(
b
"foobar"
)
print
(
"org string:"
,
s
)
qsort
(
s
,
len
(
s
),
1
,
cmp_c
)
print
(
"qsort'ed:"
,
s
)
print
(
"qsort'ed
string
:"
,
s
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment