aboutsummaryrefslogtreecommitdiff
path: root/Types.h
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2026-04-29 17:59:47 +0300
committerSyndamia <kamen@syndamia.com>2026-05-12 07:08:56 +0300
commit5d3ee795417ad5e0cad8e05a829b143cfb9652e6 (patch)
tree492f55140c52a12ffe943121660b51acde582b07 /Types.h
parente97bc661483173c23f26880ffef50d02955e73da (diff)
downloadfoollib-5d3ee795417ad5e0cad8e05a829b143cfb9652e6.tar
foollib-5d3ee795417ad5e0cad8e05a829b143cfb9652e6.tar.gz
foollib-5d3ee795417ad5e0cad8e05a829b143cfb9652e6.zip
chore: Reorganize and comment codebase
Diffstat (limited to 'Types.h')
-rw-r--r--Types.h22
1 files changed, 13 insertions, 9 deletions
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 */