Fix implicit casting of -1 to size_t
All checks were successful
CI / build-and-analyze (push) Successful in 38s
All checks were successful
CI / build-and-analyze (push) Successful in 38s
This commit is contained in:
4
Str.c
4
Str.c
@@ -173,7 +173,7 @@ size_t CgeStrIndexRune(const CgeStr *str, uint32_t rune) {
|
||||
CgeStr tmp;
|
||||
|
||||
tmp.data = scratch;
|
||||
if ((tmp.size = CgeUtf8Encode(rune, scratch)) == -1)
|
||||
if ((tmp.size = CgeUtf8Encode(rune, scratch)) == (size_t)-1)
|
||||
return (size_t)-1;
|
||||
|
||||
return CgeStrIndexStr(str, &tmp);
|
||||
@@ -184,7 +184,7 @@ size_t CgeStrLastIndexRune(const CgeStr *str, uint32_t rune) {
|
||||
CgeStr tmp;
|
||||
|
||||
tmp.data = scratch;
|
||||
if ((tmp.size = CgeUtf8Encode(rune, scratch)) == -1)
|
||||
if ((tmp.size = CgeUtf8Encode(rune, scratch)) == (size_t)-1)
|
||||
return (size_t)-1;
|
||||
|
||||
return CgeStrLastIndexStr(str, &tmp);
|
||||
|
||||
Reference in New Issue
Block a user