Compare commits

..

No commits in common. "37547ec64071decd7ddb03e77acc427cd7543d9b" and "e378d8ee2f5948475f26a48e80d0365d689262d3" have entirely different histories.

8 changed files with 30 additions and 29 deletions

View File

@ -29,8 +29,8 @@ extern "C"
[[deprecated]] char* strcpy(char* dst, const char* src); [[deprecated]] char* strcpy(char* dst, const char* src);
[[deprecated]] char* strcat(char* dst, const char* src); [[deprecated]] char* strcat(char* dst, const char* src);
char* strncpy(char* dest, const char* src, usize max); char* strncpy(char* dest, const char* src, size_t max);
char* strncat(char* dest, const char* src, usize max); char* strncat(char* dest, const char* src, size_t max);
char* strchr(const char* str, int c); char* strchr(const char* str, int c);
char* strrchr(const char* str, int c); char* strrchr(const char* str, int c);

View File

@ -11,7 +11,7 @@ template <usize Size> class StaticString
adopt(string); adopt(string);
} }
template <usize OtherSize> StaticString(const StaticString<OtherSize>& other) template<usize OtherSize> StaticString(const StaticString<OtherSize>& other)
{ {
adopt(other.chars()); adopt(other.chars());
} }

View File

@ -67,7 +67,7 @@ extern "C"
int strncmp(const char* a, const char* b, usize max) int strncmp(const char* a, const char* b, usize max)
{ {
const char* s = a; const char* s = a;
while (*a && (*a == *b) && (usize)(a - s) < (max - 1)) while (*a && (*a == *b) && (size_t)(a - s) < (max - 1))
{ {
a++; a++;
b++; b++;
@ -124,18 +124,18 @@ extern "C"
return s; return s;
} }
char* strncpy(char* dest, const char* src, usize max) char* strncpy(char* dest, const char* src, size_t max)
{ {
usize i; size_t i;
for (i = 0; i < max && src[i] != 0; i++) dest[i] = src[i]; for (i = 0; i < max && src[i] != 0; i++) dest[i] = src[i];
for (; i < max; i++) dest[i] = 0; for (; i < max; i++) dest[i] = 0;
return dest; return dest;
} }
char* strncat(char* dest, const char* src, usize max) char* strncat(char* dest, const char* src, size_t max)
{ {
usize len = strlen(dest); size_t len = strlen(dest);
usize i; size_t i;
for (i = 0; i < max && *(src + i); i++) *(dest + len + i) = *(src + i); for (i = 0; i < max && *(src + i); i++) *(dest + len + i) = *(src + i);

View File

@ -4,7 +4,11 @@ source $(dirname $0)/env.sh
cd $LUNA_ROOT cd $LUNA_ROOT
source tools/sources.sh SOURCES=($(find kernel/src -type f | grep -v "\.asm"))
SOURCES+=($(find libluna/src -type f))
SOURCES+=($(find libluna/include/luna -type f))
SOURCES+=($(find libos/src -type f))
SOURCES+=($(find libos/include/os -type f))
ALL_OK=1 ALL_OK=1

View File

@ -1,12 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e
source $(dirname $0)/env.sh source $(dirname $0)/env.sh
cd $LUNA_ROOT cd $LUNA_ROOT
source tools/sources.sh SOURCES=($(find kernel/src -type f | grep -v "\.asm" | grep -v "bootboot.h"))
SOURCES+=($(find libluna/src -type f))
SOURCES=($(printf -- '%s\n' "${SOURCES[@]}" | grep -v libc | grep -v "Types.h" | grep -v "bootboot.h")) SOURCES+=($(find libluna/include/luna -type f | grep -v "Types.h"))
SOURCES+=($(find libos/src -type f))
SOURCES+=($(find libos/include/os -type f))
SUCCESS=1 SUCCESS=1

View File

@ -5,9 +5,11 @@ source $(dirname $0)/env.sh
cd $LUNA_ROOT cd $LUNA_ROOT
source tools/sources.sh SOURCES=($(find kernel/src -type f | grep -v "\.asm" | grep -v "bootboot.h"))
SOURCES+=($(find libluna/src -type f))
SOURCES=($(printf -- '%s\n' "${SOURCES[@]}" | grep -v libc | grep -v "Types.h" | grep -v "bootboot.h")) SOURCES+=($(find libluna/include/luna -type f | grep -v "Types.h"))
SOURCES+=($(find libos/src -type f))
SOURCES+=($(find libos/include/os -type f))
for f in ${SOURCES[@]} for f in ${SOURCES[@]}
do do

View File

@ -5,7 +5,11 @@ source $(dirname $0)/env.sh
cd $LUNA_ROOT cd $LUNA_ROOT
source tools/sources.sh SOURCES=($(find kernel/src -type f | grep -v "\.asm"))
SOURCES+=($(find libluna/src -type f))
SOURCES+=($(find libluna/include/luna -type f))
SOURCES+=($(find libos/src -type f))
SOURCES+=($(find libos/include/os -type f))
for f in ${SOURCES[@]} for f in ${SOURCES[@]}
do do

View File

@ -1,12 +0,0 @@
#!/bin/sh
source $(dirname $0)/env.sh
cd $LUNA_ROOT
FOLDERS=(kernel libc libos libluna apps)
SOURCES=($(find ${FOLDERS[@]} -type f -name "*.cpp"))
SOURCES+=($(find ${FOLDERS[@]} -type f -name "*.h"))
export SOURCES