aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/lib/string
diff options
context:
space:
mode:
authorMarvin Borner2020-05-06 19:04:05 +0200
committerMarvin Borner2020-05-06 19:04:05 +0200
commitd94ffac4a584dc7a4f6f2ec567b8caab05ce9253 (patch)
tree559cd596a0a407d4b40c1d12d3c6a0686494da16 /src/kernel/lib/string
parent1a8563a05608b5b5e27eada44cf4790926001c68 (diff)
New build parameters and shared includes
This changes many files but I've just applied some replace commands.. So - nothing special!
Diffstat (limited to 'src/kernel/lib/string')
-rw-r--r--src/kernel/lib/string/strcat.c8
-rw-r--r--src/kernel/lib/string/strcati.c6
-rw-r--r--src/kernel/lib/string/strcmp.c4
-rw-r--r--src/kernel/lib/string/strcpy.c6
-rw-r--r--src/kernel/lib/string/strdisp.c4
-rw-r--r--src/kernel/lib/string/strdup.c6
-rw-r--r--src/kernel/lib/string/strinv.c4
-rw-r--r--src/kernel/lib/string/strlen.c6
-rw-r--r--src/kernel/lib/string/strstr.c4
9 files changed, 24 insertions, 24 deletions
diff --git a/src/kernel/lib/string/strcat.c b/src/kernel/lib/string/strcat.c
index 4328f87..3ae8ea0 100644
--- a/src/kernel/lib/string/strcat.c
+++ b/src/kernel/lib/string/strcat.c
@@ -1,11 +1,11 @@
-#include <kernel/lib/string.h>
+#include <lib/string.h>
void strcat(char *dest, const char *orig)
{
- size_t s_dest = strlen(dest);
- size_t s_orig = strlen(orig);
+ u32 s_dest = strlen(dest);
+ u32 s_orig = strlen(orig);
- for (size_t i = 0; i < s_orig; i++)
+ for (u32 i = 0; i < s_orig; i++)
dest[s_dest + i] = orig[i];
dest[s_dest + s_orig] = 0;
} \ No newline at end of file
diff --git a/src/kernel/lib/string/strcati.c b/src/kernel/lib/string/strcati.c
index 5dab283..2fda46c 100644
--- a/src/kernel/lib/string/strcati.c
+++ b/src/kernel/lib/string/strcati.c
@@ -1,9 +1,9 @@
-#include <kernel/lib/string.h>
+#include <lib/string.h>
void strcati(char *dest, const char *orig)
{
- size_t s_orig = strlen(orig);
+ u32 s_orig = strlen(orig);
strdisp(dest, (int)s_orig);
- for (size_t i = 0; i < s_orig; i++)
+ for (u32 i = 0; i < s_orig; i++)
dest[i] = orig[i];
} \ No newline at end of file
diff --git a/src/kernel/lib/string/strcmp.c b/src/kernel/lib/string/strcmp.c
index 89f77a0..7a273ac 100644
--- a/src/kernel/lib/string/strcmp.c
+++ b/src/kernel/lib/string/strcmp.c
@@ -1,11 +1,11 @@
-#include <kernel/lib/string.h>
+#include <lib/string.h>
char strcmp(const char *a, const char *b)
{
if (strlen(a) != strlen(b))
return 1;
- for (size_t i = 0; i < strlen(a); i++)
+ for (u32 i = 0; i < strlen(a); i++)
if (a[i] != b[i])
return 1;
diff --git a/src/kernel/lib/string/strcpy.c b/src/kernel/lib/string/strcpy.c
index 6117e7c..5d7f194 100644
--- a/src/kernel/lib/string/strcpy.c
+++ b/src/kernel/lib/string/strcpy.c
@@ -1,10 +1,10 @@
-#include <kernel/lib/string.h>
+#include <lib/string.h>
void strcpy(char *dest, const char *orig)
{
- size_t s_orig = strlen(orig);
+ u32 s_orig = strlen(orig);
- for (size_t i = 0; i < s_orig; i++)
+ for (u32 i = 0; i < s_orig; i++)
dest[i] = orig[i];
dest[s_orig] = 0;
} \ No newline at end of file
diff --git a/src/kernel/lib/string/strdisp.c b/src/kernel/lib/string/strdisp.c
index e63f038..dada5d0 100644
--- a/src/kernel/lib/string/strdisp.c
+++ b/src/kernel/lib/string/strdisp.c
@@ -1,8 +1,8 @@
-#include <kernel/lib/string.h>
+#include <lib/string.h>
void strdisponce(char *str)
{
- for (size_t i = sizeof(str) + 2; i > 0; i--)
+ for (u32 i = sizeof(str) + 2; i > 0; i--)
str[i] = str[i - 1];
str[0] = 0;
}
diff --git a/src/kernel/lib/string/strdup.c b/src/kernel/lib/string/strdup.c
index 82d14ef..00bb863 100644
--- a/src/kernel/lib/string/strdup.c
+++ b/src/kernel/lib/string/strdup.c
@@ -1,9 +1,9 @@
-#include <kernel/lib/string.h>
-#include <kernel/memory/alloc.h>
+#include <lib/string.h>
+#include <memory/alloc.h>
char *strdup(const char *orig)
{
- size_t s_orig = strlen(orig);
+ u32 s_orig = strlen(orig);
char *ret = (char *)kmalloc(s_orig + 1);
strcpy(ret, orig);
return ret;
diff --git a/src/kernel/lib/string/strinv.c b/src/kernel/lib/string/strinv.c
index 071a99d..90cb581 100644
--- a/src/kernel/lib/string/strinv.c
+++ b/src/kernel/lib/string/strinv.c
@@ -1,8 +1,8 @@
-#include <kernel/lib/string.h>
+#include <lib/string.h>
void strinv(char *str)
{
- size_t s_str = strlen(str);
+ u32 s_str = strlen(str);
int iterations = (int)s_str / 2;
for (int i = 0; i < iterations; i++) {
diff --git a/src/kernel/lib/string/strlen.c b/src/kernel/lib/string/strlen.c
index 9e7e448..520ab92 100644
--- a/src/kernel/lib/string/strlen.c
+++ b/src/kernel/lib/string/strlen.c
@@ -1,8 +1,8 @@
-#include <kernel/lib/string.h>
+#include <lib/string.h>
-size_t strlen(const char *str)
+u32 strlen(const char *str)
{
- size_t len = 0;
+ u32 len = 0;
while (str[len])
len++;
return len;
diff --git a/src/kernel/lib/string/strstr.c b/src/kernel/lib/string/strstr.c
index d58b4d5..bcf1539 100644
--- a/src/kernel/lib/string/strstr.c
+++ b/src/kernel/lib/string/strstr.c
@@ -1,10 +1,10 @@
#include <stdint.h>
-#include <kernel/lib/stdlib.h>
+#include <lib/stdlib.h>
char *strstr(const char *in, const char *str)
{
char c;
- uint32_t len;
+ u32 len;
c = *str++;
if (!c)