From 5d3ee795417ad5e0cad8e05a829b143cfb9652e6 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 29 Apr 2026 17:59:47 +0300 Subject: chore: Reorganize and comment codebase --- Types.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'Types.h') diff --git a/Types.h b/Types.h index f12a52e..a9742fc 100644 --- a/Types.h +++ b/Types.h @@ -4,16 +4,25 @@ #include "stdint.h" #include "stddef.h" -typedef int_fast8_t i8; -typedef int_fast16_t i16; -typedef int_fast32_t i32; -typedef int_fast64_t i64; +/* Numeric */ + +typedef int_fast8_t i8; +typedef int_fast16_t i16; +typedef int_fast32_t i32; +typedef int_fast64_t i64; typedef uint_fast8_t u8; typedef uint_fast16_t u16; typedef uint_fast32_t u32; typedef uint_fast64_t u64; typedef size_t usize; +#define B(x) ((x) * 8) +#define KiB(x) ((x) * 1024) +#define MiB(x) ((x) * 1048576) +#define GiB(x) ((x) * 1073741824) + +/* Result */ + typedef enum Result { /* Generic */ R_Ok = 0, @@ -63,9 +72,4 @@ const static char* Result_TO_STR[R_PRIVATE+1] = { #define RETURN_NOTOK(x) { Result r = x; if (R_Ok != r) return r; } #define PRINT_NOTOK(x) { Result r = x; if (R_Ok != r) fprintf(stderr, "%s:%d %s() Error: %s (%d)\n", __FILE__, __LINE__, __func__, Result_TO_STR[r], r); } -#define B(x) ((x) * 8) -#define KiB(x) ((x) * 1024) -#define MiB(x) ((x) * 1048576) -#define GiB(x) ((x) * 1073741824) - #endif /* _TYPES */ -- cgit v1.2.3