Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
64ececb7
Commit
64ececb7
authored
Dec 31, 2015
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/libc/string0: Use uintptr_t instead of uint32_t.
This makes the code portable to non-32-bit architectures.
parent
8c936ede
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lib/libc/string0.c
lib/libc/string0.c
+2
-2
No files found.
lib/libc/string0.c
View file @
64ececb7
...
...
@@ -30,7 +30,7 @@
#define likely(x) __builtin_expect((x), 1)
void
*
memcpy
(
void
*
dst
,
const
void
*
src
,
size_t
n
)
{
if
(
likely
(
!
(((
uint
32_t
)
dst
)
&
3
)
&&
!
(((
uint32
_t
)
src
)
&
3
)))
{
if
(
likely
(
!
(((
uint
ptr_t
)
dst
)
&
3
)
&&
!
(((
uintptr
_t
)
src
)
&
3
)))
{
// pointers aligned
uint32_t
*
d
=
dst
;
const
uint32_t
*
s
=
src
;
...
...
@@ -80,7 +80,7 @@ void *memmove(void *dest, const void *src, size_t n) {
}
void
*
memset
(
void
*
s
,
int
c
,
size_t
n
)
{
if
(
c
==
0
&&
((
uint
32
_t
)
s
&
3
)
==
0
)
{
if
(
c
==
0
&&
((
uint
ptr
_t
)
s
&
3
)
==
0
)
{
// aligned store of 0
uint32_t
*
s32
=
s
;
for
(
size_t
i
=
n
>>
2
;
i
>
0
;
i
--
)
{
...
...
Write
Preview
Markdown
is supported
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