aboutsummaryrefslogtreecommitdiff
path: root/Types.h
diff options
context:
space:
mode:
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 */