mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 17:32:22 -07:00
Swap b32 to bool, et al.
This commit is contained in:
+8
-8
@@ -51,14 +51,14 @@ gb_inline String make_string(char const (&text)[N]) {
|
||||
return make_string(cast(u8 *)cast(void *)text, N-1);
|
||||
}
|
||||
|
||||
gb_inline b32 are_strings_equal(String a, String b) {
|
||||
gb_inline bool are_strings_equal(String a, String b) {
|
||||
if (a.len == b.len) {
|
||||
return gb_memcompare(a.text, b.text, a.len) == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
gb_inline b32 are_strings_equal_ignore_case(String a, String b) {
|
||||
gb_inline bool are_strings_equal_ignore_case(String a, String b) {
|
||||
if (a.len == b.len) {
|
||||
for (isize i = 0; i < a.len; i++) {
|
||||
char x = cast(char)a.text[i];
|
||||
@@ -133,7 +133,7 @@ template <size_t N> gb_inline bool operator !=(char const (&a)[N], String b) { r
|
||||
gb_inline isize string_extension_position(String str) {
|
||||
isize dot_pos = -1;
|
||||
isize i = str.len;
|
||||
b32 seen_dot = false;
|
||||
bool seen_dot = false;
|
||||
while (i --> 0) {
|
||||
if (str.text[i] == GB_PATH_SEPARATOR)
|
||||
break;
|
||||
@@ -146,7 +146,7 @@ gb_inline isize string_extension_position(String str) {
|
||||
return dot_pos;
|
||||
}
|
||||
|
||||
gb_inline b32 string_has_extension(String str, String ext) {
|
||||
gb_inline bool string_has_extension(String str, String ext) {
|
||||
if (str.len > ext.len+1) {
|
||||
u8 *s = str.text+str.len - ext.len-1;
|
||||
if (s[0] == '.') {
|
||||
@@ -158,7 +158,7 @@ gb_inline b32 string_has_extension(String str, String ext) {
|
||||
return false;
|
||||
}
|
||||
|
||||
b32 string_contains_char(String s, u8 c) {
|
||||
bool string_contains_char(String s, u8 c) {
|
||||
for (isize i = 0; i < s.len; i++) {
|
||||
if (s.text[i] == c)
|
||||
return true;
|
||||
@@ -234,7 +234,7 @@ String string16_to_string(gbAllocator a, String16 s) {
|
||||
|
||||
|
||||
|
||||
b32 unquote_char(String s, u8 quote, Rune *rune, b32 *multiple_bytes, String *tail_string) {
|
||||
bool unquote_char(String s, u8 quote, Rune *rune, bool *multiple_bytes, String *tail_string) {
|
||||
if (s.text[0] == quote &&
|
||||
(quote == '$' || quote == '"')) {
|
||||
return false;
|
||||
@@ -392,8 +392,8 @@ i32 unquote_string(gbAllocator a, String *s_) {
|
||||
while (s.len > 0) {
|
||||
String tail_string = {};
|
||||
Rune r = 0;
|
||||
b32 multiple_bytes = false;
|
||||
b32 success = unquote_char(s, quote, &r, &multiple_bytes, &tail_string);
|
||||
bool multiple_bytes = false;
|
||||
bool success = unquote_char(s, quote, &r, &multiple_bytes, &tail_string);
|
||||
if (!success) {
|
||||
gb_free(a, buf);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user