Commit Graph

354 Commits

Author SHA1 Message Date
f952268152 fix: the + unary operator does not add 1, but just specifies intent.
I was very mistaken, and I feel like an idiot.
2025-08-07 13:00:09 +02:00
4b2404e903 move utility functions upwards to keep the logical order 2025-08-07 13:00:09 +02:00
ff7598a7e3 rework attributes to be a bit safer and more logical.
we are targeting GNU extensions, GNU attributes are a part of that.
added aliases for the new attribute names (name as all caps = shorter
due to `atrb_` prefix)
The aliases are likely to be removed in a later commit
2025-07-31 11:27:57 +02:00
e472d9c251 rename types.h to intdef.h and replace types.h with a symlink.
`intdef.h` is more clear in the purpose that it describes, rather than
`types`, `types` is too generic.
Note: floating points are still defined in this header, I imagine this
to be removed later, alongside the compatibility symlink.
2025-07-31 11:27:57 +02:00
d70888f9fb remove __attribute__((fallthrough)) from all that do not require it. Replace with // fall through in some places for readability 2025-07-24 16:32:41 +02:00
6dbf034ba1 add marker so I remember to add this back in 2025-07-24 16:29:03 +02:00
1ea37b6e86 fix: there is no need to let the compilation continue if it fails.
it actually makes it less easy to locate errors.
2025-07-24 16:29:03 +02:00
f3273ed5d0 fix: include my endian.h in nbt.h 2025-07-24 16:29:03 +02:00
6ccb55de8b remove unused function nbt_cmpstr, since we're performing this check directly now. 2025-07-24 16:29:03 +02:00
69dc174ff2 remove nbt_arrlen function 2025-07-24 16:29:03 +02:00
58d0dd01e2 move nbt_strlen to nbt.h, and rename to nbt_namelen 2025-07-24 16:29:03 +02:00
4005163d61 fix: use atrb_pure for functions reading global state 2025-07-24 16:29:03 +02:00
8964a1a563 fix: atrb for when _MSC_VER is defined did not have parameters 2025-07-24 16:29:03 +02:00
f0c5408c51 fix: error.h should exit with EXIT_FAILURE, rather than 1 2025-07-24 16:29:03 +02:00
1d5df8df0a apply new formatting rules to the whole project 2025-07-24 16:29:03 +02:00
cdf13b7529 change qualifier alignment to be left again 2025-07-24 16:28:25 +02:00
13e1ceddfc update nbt_proc function, still inoperable 2025-07-24 16:28:25 +02:00
333417dadd add funciton for data loading/processing 2025-07-24 16:28:25 +02:00
fd8db02e77 modify the array bytelength function to get the bytelength of a single tag. 2025-07-24 16:28:25 +02:00
2daeb9823c add a function to get an NBT array bytelength 2025-07-23 14:55:24 +02:00
4e1cd68c38 semantic fix, use explicit fallthrough
GCC was complaining, and I didn't have a valid counter argument.
2025-07-23 14:07:06 +02:00
501c623f01 rename nbt_prim_tagsize to nbt_primsize, for consistency. 2025-07-23 13:00:53 +02:00
65ee7c5b55 add a function for checking whether a tag is primitive or not
mainly for niche uses
2025-07-23 13:00:53 +02:00
5d7c244c8f optimise switch of nbt_prim_tagsize
had duplicate switch branches, which wastes binary size.
2025-07-23 13:00:53 +02:00
9fd920908e move nbt_prim_tagsize to header, since it's a pretty useful funciton. 2025-07-23 13:00:53 +02:00
8102dd6a71 fix: markdown footnote now uses correct format 2025-07-23 13:00:53 +02:00
ac3be7e8ab add link time optimalisation flag to makefile 2025-07-23 11:38:06 +02:00
6c2f51929b write a function for skipping to the next NBT tag
including a function for acquireing the array size, and bytesize of a
tag.
2025-07-18 10:29:08 +02:00
ee1811a3a5 rewrite endian header to not interfere with the endian system header.
the system header is inconsistently available across platforms.
This header provides the same functionality for less of the cost,
overriding the system macros.
2025-07-18 10:29:08 +02:00
db76d6992b add function for comparing an NBT string with a C string 2025-07-15 13:51:23 +02:00
8345ac1164 remove nbt_procdat struct 2025-07-15 13:51:23 +02:00
13451da2e8 add basic function signature for processing the NBT data 2025-07-15 13:51:23 +02:00
6aff9aa528 adapt data spec to use hexadecimal as well 2025-07-15 11:15:28 +02:00
be87ccbe22 explicitly set hexadecimal values in NBT tags 2025-07-15 10:37:10 +02:00
d1d5e14971 add a test which ensures that bit shift right is an arithmetic shift, not logical shift. 2025-07-13 12:21:37 +02:00
bcf7c9be60 improve coordinate conversion documentation, since our division was incorrect. 2025-07-13 12:05:27 +02:00
8861e591f6 improve mc-data-spec docs code example slightly for cache predictability. 2025-07-07 15:03:34 +02:00
2cb5d03211 write headers for data processing 2025-07-07 15:02:47 +02:00
600fa0f25e add map colour definitions. 2025-07-07 14:27:28 +02:00
ceea087a88 remove colour32 typedef, and just use a 4D vector. 2025-07-07 14:27:28 +02:00
9b9a20e226 we are using GNU extensions, using __builtin_bswap* is fine. 2025-07-07 14:27:28 +02:00
c56e2399e9 add struct for clairity 2025-07-07 14:27:28 +02:00
66badc2dc6 add a definition to what BE means 2025-07-07 14:27:28 +02:00
5e0db59198 fix: remove vector unit tests, since this code no longer exists. 2025-07-07 14:27:28 +02:00
271773a28c replace vectors with SMID vectors. 2025-07-07 14:27:28 +02:00
9de6e7f92e fix: window resize updates happen each update. 2025-07-03 11:52:27 +02:00
2d059cf1db apply new formatting rules 2025-07-03 10:55:33 +02:00
da8e8c1450 update clang format to use better formatting rules 2025-07-03 10:55:33 +02:00
f4b1b46b49 strip end of line comments from clang-format file 2025-07-03 09:58:42 +02:00
3e4d16a5be explicitly undefine NDEBUG in CFLAGS. 2025-06-23 13:19:06 +02:00