minor type fixes

This commit is contained in:
Dennis Eichhorn 2023-12-14 17:11:57 +00:00
parent 31f250a92d
commit 77170638cc
2 changed files with 4 additions and 4 deletions

View File

@ -184,6 +184,7 @@ namespace Utils::ArrayUtils
return merged; return merged;
} }
inline
char** merge_arrays_char(const char** array1, size_t size1, const char** array2, size_t size2) char** merge_arrays_char(const char** array1, size_t size1, const char** array2, size_t size2)
{ {
char** merged = (char**) malloc((size1 + size2) * sizeof(char*)); char** merged = (char**) malloc((size1 + size2) * sizeof(char*));

View File

@ -19,7 +19,6 @@
namespace Utils::StringUtils namespace Utils::StringUtils
{ {
inline
char *search_replace(const char *haystack, const char *needle, const char *replace) char *search_replace(const char *haystack, const char *needle, const char *replace)
{ {
const char *haystackT = haystack; const char *haystackT = haystack;
@ -80,14 +79,14 @@ namespace Utils::StringUtils
inline inline
size_t str_count(const char *str, const char *substr) size_t str_count(const char *str, const char *substr)
{ {
int l1 = strlen(str); size_t l1 = strlen(str);
int l2 = strlen(substr); size_t l2 = strlen(substr);
if (l2 == 0 || l1 < l2) { if (l2 == 0 || l1 < l2) {
return 0; return 0;
} }
int count = 0; size_t count = 0;
for (str = strstr(str, substr); str; str = strstr(str + l2, substr)) { for (str = strstr(str, substr); str; str = strstr(str + l2, substr)) {
++count; ++count;
} }