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
963a5a3e
Commit
963a5a3e
authored
Jan 16, 2015
by
Damien George
Browse files
py, unix: Allow to compile with -Wsign-compare.
See issue #699.
parent
f12ea7c7
Changes
23
Hide whitespace changes
Inline
Side-by-side
py/vstr.c
View file @
963a5a3e
...
...
@@ -350,7 +350,7 @@ void vstr_vprintf(vstr_t *vstr, const char *fmt, va_list ap) {
va_end
(
ap2
);
// if that worked, return
if
(
n
>
-
1
&&
n
<
size
)
{
if
(
n
>
-
1
&&
(
size_t
)
n
<
size
)
{
vstr
->
len
+=
n
;
return
;
}
...
...
unix/main.c
View file @
963a5a3e
...
...
@@ -355,7 +355,7 @@ int main(int argc, char **argv) {
mp_obj_list_get
(
mp_sys_path
,
&
path_num
,
&
path_items
);
path_items
[
0
]
=
MP_OBJ_NEW_QSTR
(
MP_QSTR_
);
char
*
p
=
path
;
for
(
in
t
i
=
1
;
i
<
path_num
;
i
++
)
{
for
(
mp_uint_
t
i
=
1
;
i
<
path_num
;
i
++
)
{
char
*
p1
=
strchr
(
p
,
PATHLIST_SEP_CHAR
);
if
(
p1
==
NULL
)
{
p1
=
p
+
strlen
(
p
);
...
...
@@ -364,7 +364,7 @@ int main(int argc, char **argv) {
// Expand standalone ~ to $HOME
CHECKBUF
(
buf
,
PATH_MAX
);
CHECKBUF_APPEND
(
buf
,
home
,
strlen
(
home
));
CHECKBUF_APPEND
(
buf
,
p
+
1
,
p1
-
p
-
1
);
CHECKBUF_APPEND
(
buf
,
p
+
1
,
(
size_t
)(
p1
-
p
-
1
)
)
;
path_items
[
i
]
=
MP_OBJ_NEW_QSTR
(
qstr_from_strn
(
buf
,
CHECKBUF_LEN
(
buf
)));
}
else
{
path_items
[
i
]
=
MP_OBJ_NEW_QSTR
(
qstr_from_strn
(
p
,
p1
-
p
));
...
...
unix/modffi.c
View file @
963a5a3e
...
...
@@ -206,7 +206,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ffimod_func_obj, 4, 4, ffimod_func);
STATIC
void
call_py_func
(
ffi_cif
*
cif
,
void
*
ret
,
void
**
args
,
mp_obj_t
func
)
{
mp_obj_t
pyargs
[
cif
->
nargs
];
for
(
int
i
=
0
;
i
<
cif
->
nargs
;
i
++
)
{
for
(
u
int
i
=
0
;
i
<
cif
->
nargs
;
i
++
)
{
pyargs
[
i
]
=
mp_obj_new_int
(
*
(
mp_int_t
*
)
args
[
i
]);
}
mp_obj_t
res
=
mp_call_function_n_kw
(
func
,
cif
->
nargs
,
0
,
pyargs
);
...
...
@@ -309,8 +309,7 @@ STATIC mp_obj_t ffifunc_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw,
ffi_arg
values
[
n_args
];
void
*
valueptrs
[
n_args
];
int
i
;
for
(
i
=
0
;
i
<
n_args
;
i
++
)
{
for
(
uint
i
=
0
;
i
<
n_args
;
i
++
)
{
mp_obj_t
a
=
args
[
i
];
if
(
a
==
mp_const_none
)
{
values
[
i
]
=
0
;
...
...
Prev
1
2
Next
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