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
49c47da8
Commit
49c47da8
authored
Oct 28, 2014
by
stijn
Committed by
Damien George
Oct 29, 2014
Browse files
Fix errors after enabling -Wpointer-arith
parent
4e54c876
Changes
2
Hide whitespace changes
Inline
Side-by-side
py/objarray.c
View file @
49c47da8
...
...
@@ -27,6 +27,7 @@
#include
<string.h>
#include
<assert.h>
#include
<stdint.h>
#include
"mpconfig.h"
#include
"nlr.h"
...
...
@@ -292,7 +293,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value
#endif
}
else
{
res
=
array_new
(
o
->
typecode
,
slice
.
stop
-
slice
.
start
);
memcpy
(
res
->
items
,
o
->
items
+
slice
.
start
*
sz
,
(
slice
.
stop
-
slice
.
start
)
*
sz
);
memcpy
(
res
->
items
,
(
uint8_t
*
)
o
->
items
+
slice
.
start
*
sz
,
(
slice
.
stop
-
slice
.
start
)
*
sz
);
}
return
res
;
#endif
...
...
@@ -331,7 +332,7 @@ STATIC mp_int_t array_get_buffer(mp_obj_t o_in, mp_buffer_info_t *bufinfo, mp_ui
// read-only memoryview
return
1
;
}
bufinfo
->
buf
+
=
(
mp_uint_t
)
o
->
free
*
sz
;
bufinfo
->
buf
=
(
uint8_t
*
)
bufinfo
->
buf
+
(
mp_uint_t
)
o
->
free
*
sz
;
}
#endif
return
0
;
...
...
stmhal/string0.c
View file @
49c47da8
...
...
@@ -65,10 +65,10 @@ void *memcpy(void *dst, const void *src, size_t n) {
}
void
*
memmove
(
void
*
dest
,
const
void
*
src
,
size_t
n
)
{
if
(
src
<
dest
&&
dest
<
src
+
n
)
{
if
(
src
<
dest
&&
(
uint8_t
*
)
dest
<
(
const
uint8_t
*
)
src
+
n
)
{
// need to copy backwards
uint8_t
*
d
=
dest
+
n
-
1
;
const
uint8_t
*
s
=
src
+
n
-
1
;
uint8_t
*
d
=
(
uint8_t
*
)
dest
+
n
-
1
;
const
uint8_t
*
s
=
(
const
uint8_t
*
)
src
+
n
-
1
;
for
(;
n
>
0
;
n
--
)
{
*
d
--
=
*
s
--
;
}
...
...
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