From 76c3b02e45258830cb725fb0bde3209fb15c640c Mon Sep 17 00:00:00 2001 From: Abdelrahman Said Date: Thu, 17 Oct 2024 00:13:35 +0100 Subject: [PATCH] Change char type to c8 in Str8 functions --- src/core/strings/str8/str8.c | 9 +++++---- src/core/strings/str8/str8.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/core/strings/str8/str8.c b/src/core/strings/str8/str8.c index 9b221a7..b204e36 100644 --- a/src/core/strings/str8/str8.c +++ b/src/core/strings/str8/str8.c @@ -1,17 +1,18 @@ #include "str8.h" +#include "aliases.h" -char wapp_str8_get(const Str8 *str, u64 index) { +c8 wapp_str8_get(const Str8 *str, u64 index) { if (index >= str->size) { return '\0'; } - return (char)(str->buf[index]); + return str->buf[index]; } -void wapp_str8_set(Str8 *str, u64 index, char c) { +void wapp_str8_set(Str8 *str, u64 index, c8 c) { if (index >= str->size) { return; } - str->buf[index] = (c8)c; + str->buf[index] = c; } diff --git a/src/core/strings/str8/str8.h b/src/core/strings/str8/str8.h index b72763d..8c80081 100644 --- a/src/core/strings/str8/str8.h +++ b/src/core/strings/str8/str8.h @@ -23,8 +23,8 @@ struct str8 { .size = sizeof(STRING) - 1, \ .buf = memcpy(&((c8 [sizeof(STRING)]){0}), STRING, sizeof(STRING))}) -char wapp_str8_get(const Str8 *str, u64 index); -void wapp_str8_set(Str8 *str, u64 index, char c); +c8 wapp_str8_get(const Str8 *str, u64 index); +void wapp_str8_set(Str8 *str, u64 index, c8 c); #ifdef __cplusplus END_C_LINKAGE