Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
8bf91f2a
Commit
8bf91f2a
authored
Jan 28, 2014
by
Damien George
Browse files
unix: Fix compile warnings for ffi module on 64-bit machine.
parent
4729a0cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
unix/Makefile
View file @
8bf91f2a
...
...
@@ -11,6 +11,7 @@ include ../py/py.mk
# compiler settings
CFLAGS
=
-I
.
-I
$(PY_SRC)
-Wall
-Werror
-ansi
-std
=
gnu99
-DUNIX
CFLAGS
+=
-I
/usr/lib/libffi-3.0.13/include
LDFLAGS
=
-lm
-ldl
-lffi
# Debugging/Optimization
...
...
unix/ffi.c
View file @
8bf91f2a
...
...
@@ -82,7 +82,7 @@ static ffi_type *get_ffi_type(mp_obj_t o_in)
nlr_jump
(
mp_obj_new_exception_msg_varg
(
MP_QSTR_OSError
,
"Unknown type"
));
}
static
mp_obj_t
return_ffi_value
(
int
val
,
char
type
)
static
mp_obj_t
return_ffi_value
(
ffi_arg
val
,
char
type
)
{
switch
(
type
)
{
case
's'
:
{
...
...
@@ -242,7 +242,7 @@ mp_obj_t ffifunc_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *
assert
(
n_kw
==
0
);
assert
(
n_args
==
self
->
cif
.
nargs
);
int
values
[
n_args
];
ffi_arg
values
[
n_args
];
void
*
valueptrs
[
n_args
];
int
i
;
for
(
i
=
0
;
i
<
n_args
;
i
++
)
{
...
...
@@ -253,17 +253,17 @@ mp_obj_t ffifunc_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *
values
[
i
]
=
mp_obj_int_get
(
a
);
}
else
if
(
MP_OBJ_IS_STR
(
a
)
||
MP_OBJ_IS_TYPE
(
a
,
&
bytes_type
))
{
const
char
*
s
=
mp_obj_str_get_str
(
a
);
values
[
i
]
=
(
int
)
s
;
values
[
i
]
=
(
ffi_arg
)
s
;
}
else
if
(
MP_OBJ_IS_TYPE
(
a
,
&
fficallback_type
))
{
mp_obj_fficallback_t
*
p
=
a
;
values
[
i
]
=
(
int
)
p
->
func
;
values
[
i
]
=
(
ffi_arg
)
p
->
func
;
}
else
{
assert
(
0
);
}
valueptrs
[
i
]
=
&
values
[
i
];
}
int
retval
;
ffi_arg
retval
;
ffi_call
(
&
self
->
cif
,
self
->
func
,
&
retval
,
valueptrs
);
return
return_ffi_value
(
retval
,
self
->
rettype
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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