renamed char_* functions

This commit is contained in:
Timerix 2025-11-15 11:51:21 +05:00
parent adaf5cc311
commit 5ef223372b
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#pragma once
#include "../std.h"
static inline bool isAlphabeticalLower(char c) { return 'a' <= c && c <= 'z'; }
static inline bool isAlphabeticalUpper(char c) { return 'A' <= c && c <= 'Z'; }
static inline bool isDigit(char c) { return '0' <= c && c <= '9'; }
static inline bool char_isLatinLower(char c) { return 'a' <= c && c <= 'z'; }
static inline bool char_isLatinUpper(char c) { return 'A' <= c && c <= 'Z'; }
static inline bool char_isDigit(char c) { return '0' <= c && c <= '9'; }

View File

@ -117,7 +117,7 @@ u32 str_hash32(const str s){
str str_toUpper(const str src){
str r = str_copy(src);
for (u32 i = 0; i < r.size; i++){
if(isAlphabeticalLower(r.data[i]))
if(char_isLatinLower(r.data[i]))
r.data[i] = r.data[i] - 'a' + 'A';
}
return r;
@ -126,7 +126,7 @@ str str_toUpper(const str src){
str str_toLower(const str src){
str r = str_copy(src);
for (u32 i = 0; i < r.size; i++){
if(isAlphabeticalUpper(r.data[i]))
if(char_isLatinUpper(r.data[i]))
r.data[i] = r.data[i] - 'A' + 'a';
}
return r;