From 37547ec64071decd7ddb03e77acc427cd7543d9b Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 23 Apr 2023 10:53:48 +0200 Subject: [PATCH] libluna: Run lint scripts --- libluna/include/luna/CString.h | 4 ++-- libluna/include/luna/StaticString.h | 2 +- libluna/src/CString.cpp | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libluna/include/luna/CString.h b/libluna/include/luna/CString.h index fb2598d9..ef53d3ba 100644 --- a/libluna/include/luna/CString.h +++ b/libluna/include/luna/CString.h @@ -29,8 +29,8 @@ extern "C" [[deprecated]] char* strcpy(char* dst, const char* src); [[deprecated]] char* strcat(char* dst, const char* src); - char* strncpy(char* dest, const char* src, size_t max); - char* strncat(char* dest, const char* src, size_t max); + char* strncpy(char* dest, const char* src, usize max); + char* strncat(char* dest, const char* src, usize max); char* strchr(const char* str, int c); char* strrchr(const char* str, int c); diff --git a/libluna/include/luna/StaticString.h b/libluna/include/luna/StaticString.h index 54846b6d..b038ed8c 100644 --- a/libluna/include/luna/StaticString.h +++ b/libluna/include/luna/StaticString.h @@ -11,7 +11,7 @@ template class StaticString adopt(string); } - template StaticString(const StaticString& other) + template StaticString(const StaticString& other) { adopt(other.chars()); } diff --git a/libluna/src/CString.cpp b/libluna/src/CString.cpp index 7dc32ac6..be30ca59 100644 --- a/libluna/src/CString.cpp +++ b/libluna/src/CString.cpp @@ -67,7 +67,7 @@ extern "C" int strncmp(const char* a, const char* b, usize max) { const char* s = a; - while (*a && (*a == *b) && (size_t)(a - s) < (max - 1)) + while (*a && (*a == *b) && (usize)(a - s) < (max - 1)) { a++; b++; @@ -124,18 +124,18 @@ extern "C" return s; } - char* strncpy(char* dest, const char* src, size_t max) + char* strncpy(char* dest, const char* src, usize max) { - size_t i; + usize i; for (i = 0; i < max && src[i] != 0; i++) dest[i] = src[i]; for (; i < max; i++) dest[i] = 0; return dest; } - char* strncat(char* dest, const char* src, size_t max) + char* strncat(char* dest, const char* src, usize max) { - size_t len = strlen(dest); - size_t i; + usize len = strlen(dest); + usize i; for (i = 0; i < max && *(src + i); i++) *(dest + len + i) = *(src + i);