diff options
| author | @syxhe <https://t.me/syxhe> | 2025-03-24 22:55:45 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2025-03-24 22:55:45 -0500 |
| commit | 277e3b7dd1bc85cd190c6e4c451c7bfab71ee07e (patch) | |
| tree | 4fe47beba815786bfe2a1fa1e0d7a7f912d3ef64 | |
| parent | a3fdf44e42b988185d1bedd9521b17b34969e75e (diff) | |
Fix MEM_ALIGN_BYTES not being static
| -rw-r--r-- | src/arena.h | 2 | ||||
| -rw-r--r-- | src/main.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/arena.h b/src/arena.h index a94001b..e656f9a 100644 --- a/src/arena.h +++ b/src/arena.h | |||
| @@ -11,7 +11,7 @@ typedef struct arena arena; | |||
| 11 | typedef arena simplearena; | 11 | typedef arena simplearena; |
| 12 | 12 | ||
| 13 | #define ISPOWOF2(x) (((x) & ((x) - 1)) == 0) | 13 | #define ISPOWOF2(x) (((x) & ((x) - 1)) == 0) |
| 14 | const size_t MEM_ALIGN_BYTES = (2 * sizeof(void*)); | 14 | static const size_t MEM_ALIGN_BYTES = (2 * sizeof(void*)); // Hey, the static keyword did something for once! |
| 15 | #define MEM_ALIGN(x) ((x) + (((x) & (MEM_ALIGN_BYTES - 1)) != 0) * (MEM_ALIGN_BYTES - ((x) & (MEM_ALIGN_BYTES - 1)))) | 15 | #define MEM_ALIGN(x) ((x) + (((x) & (MEM_ALIGN_BYTES - 1)) != 0) * (MEM_ALIGN_BYTES - ((x) & (MEM_ALIGN_BYTES - 1)))) |
| 16 | 16 | ||
| 17 | int arena_init(arena **a, size_t bytes); | 17 | int arena_init(arena **a, size_t bytes); |
| @@ -1,12 +1,14 @@ | |||
| 1 | #include "shared.h" | 1 | #include "shared.h" |
| 2 | #include "arena.h" | ||
| 3 | #include "encryption.h" | ||
| 4 | #include "ll.h" | ||
| 2 | 5 | ||
| 3 | #include <errno.h> | 6 | #include <errno.h> |
| 4 | #include <error.h> | 7 | #include <error.h> |
| 5 | #include <stdio.h> | 8 | #include <stdio.h> |
| 6 | 9 | ||
| 7 | int main() { | 10 | int main() { |
| 8 | 11 | error(1, ENOTSUP, "No main file lol"); | |
| 9 | |||
| 10 | 12 | ||
| 11 | return 0; | 13 | return 0; |
| 12 | } \ No newline at end of file | 14 | } \ No newline at end of file |
