mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-02-14 01:18:40 +00:00
minor type fixes
This commit is contained in:
parent
31f250a92d
commit
77170638cc
|
|
@ -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*));
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user