build: add a "user" arch to allow the kernel to run as a program on the host machine
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#include <stddef.h>
|
||||
|
||||
const void *memchr(const void *ptr, int value, size_t num) {
|
||||
void *memchr(const void *ptr, int value, unsigned long num) {
|
||||
const unsigned char *buf = ptr;
|
||||
unsigned char val = value;
|
||||
|
||||
for (size_t i = 0; i < num; i++) {
|
||||
for (unsigned long i = 0; i < num; i++) {
|
||||
if (buf[i] == val) {
|
||||
return (void *)(buf + i);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ int strcmp(const char *s1, const char *s2)
|
||||
return s1[i] - s2[i];
|
||||
}
|
||||
|
||||
int strncmp(const char *s1, const char *s2, unsigned int n)
|
||||
int strncmp(const char *s1, const char *s2, unsigned long n)
|
||||
{
|
||||
for (; n > 0; s1++, s2++, --n)
|
||||
if (*s1 != *s2)
|
||||
|
||||
@@ -11,10 +11,10 @@ char *strcpy(char *output, const char *input)
|
||||
return output;
|
||||
}
|
||||
|
||||
char *strncpy(char *output, const char *input, unsigned int count)
|
||||
char *strncpy(char *output, const char *input, unsigned long count)
|
||||
{
|
||||
unsigned int size = count;
|
||||
unsigned int i;
|
||||
unsigned long size = count;
|
||||
unsigned long i;
|
||||
for (i = 0; i < size; i++) {
|
||||
output[i] = input[i];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user