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
f53a8e71
Commit
f53a8e71
authored
Apr 18, 2015
by
Damien George
Browse files
lib/libc/string0.c: Remove include of std.h, replace with string.h.
Much more portable this way.
parent
1c9a4991
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/libc/string0.c
View file @
f53a8e71
...
...
@@ -25,7 +25,7 @@
*/
#include <stdint.h>
#include
"
st
d
.h
"
#include
<
st
ring
.h
>
#define likely(x) __builtin_expect((x), 1)
...
...
@@ -102,10 +102,12 @@ void *memset(void *s, int c, size_t n) {
return
s
;
}
int
memcmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
)
{
int
memcmp
(
const
void
*
s1
,
const
void
*
s2
,
size_t
n
)
{
const
uint8_t
*
s1_8
=
s1
;
const
uint8_t
*
s2_8
=
s2
;
while
(
n
--
)
{
char
c1
=
*
s1
++
;
char
c2
=
*
s2
++
;
char
c1
=
*
s1
_8
++
;
char
c2
=
*
s2
_8
++
;
if
(
c1
<
c2
)
return
-
1
;
else
if
(
c1
>
c2
)
return
1
;
}
...
...
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