Espresso 0.0.2a
This commit is contained in:
24
lib/string.c
24
lib/string.c
@ -172,9 +172,9 @@ char* strchr(const char* s, int c)
|
||||
{
|
||||
while (*s)
|
||||
{
|
||||
if (*s == (char)c)
|
||||
if (*s == (char) c)
|
||||
{
|
||||
return (char*)s;
|
||||
return (char*) s;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
@ -182,6 +182,22 @@ char* strchr(const char* s, int c)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int num_strchr(const char* s, int c)
|
||||
{
|
||||
int rv = 0;
|
||||
|
||||
while (*s)
|
||||
{
|
||||
if (*s == (char) c)
|
||||
{
|
||||
rv++;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
void* memset(void* dst, int c, size_t n)
|
||||
{
|
||||
@ -201,10 +217,10 @@ void* memset(void* dst, int c, size_t n)
|
||||
|
||||
void* memcpy(void *dst, const void *src, uint32_t n)
|
||||
{
|
||||
/*if (sse_initialized > 1)
|
||||
if (sse_initialized > 1)
|
||||
{
|
||||
return sse2_memcpy(dst, src, n);
|
||||
}*/
|
||||
}
|
||||
|
||||
char *d = dst;
|
||||
const char *s = src;
|
||||
|
||||
Reference in New Issue
Block a user