mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-18 20:35:45 +01:00
Compare commits
3 Commits
077d3a147a
...
942ffdc857
| Author | SHA1 | Date | |
|---|---|---|---|
| 942ffdc857 | |||
| 4bf02b2d03 | |||
| bc4855e063 |
8
makefile
8
makefile
@@ -38,14 +38,14 @@ endif
|
||||
ifeq ($(DEBUG),1)
|
||||
PROF = dbg
|
||||
CFLAGS += -UNDEBUG -Og -g -Wextra -Wpedantic
|
||||
CFLAGS += $(if $(filter 1,$(ISWIN)),,-fsanitize=address,undefined)
|
||||
LDFLAGS += $(if $(filter 1,$(ISWIN)),,-fsanitize=address,undefined)
|
||||
CFLAGS += $(if $(filter 1,$(ISWIN)),,-fsanitize=address,undefined) -ftrapv
|
||||
LDFLAGS += $(if $(filter 1,$(ISWIN)),,-fsanitize=address,undefined) -ftrapv
|
||||
# |--profile: testing
|
||||
else ifeq ($(DEBUG),test)
|
||||
PROF = test
|
||||
CFLAGS += -UNDEBUG -O2 -g
|
||||
CFLAGS += $(if $(filter 1,$(ISWIN)),,-fsanitize=address)
|
||||
LDFLAGS += $(if $(filter 1,$(ISWIN)),,-fsanitize=address)
|
||||
CFLAGS += $(if $(filter 1,$(ISWIN)),,-fsanitize=address) -ftrapv
|
||||
LDFLAGS += $(if $(filter 1,$(ISWIN)),,-fsanitize=address) -ftrapv
|
||||
else
|
||||
PROF = rel
|
||||
CFLAGS += -DNDEBUG -O2
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#define CHUNKS 0x400 // amount of chunks in a file
|
||||
|
||||
/* Moves chunks `src_s` to `src_e` (inclusive) from `src`, back onto `dst`. */
|
||||
static void mvchunks(u8 *restrict buf, void *src, void *dst, int src_s, int src_e) {
|
||||
static void mvchunks(void *restrict buf, void *src, void *dst, int src_s, int src_e) {
|
||||
assert(src > dst);
|
||||
u32 *table = (u32 *)buf; // BUG: strict aliasing
|
||||
size_t len = src - dst; // acquire the amount of bytes that we shall move
|
||||
|
||||
@@ -66,7 +66,7 @@ static const void *proclist(const void *restrict buf, struct nbt_array *restrict
|
||||
}
|
||||
|
||||
const void *nbt_proctag(const void *restrict buf, u16 slen, void *restrict out) {
|
||||
const u8 *ptr, *tmp;
|
||||
const void *ptr, *tmp;
|
||||
ptr = buf + 3 + slen;
|
||||
|
||||
i32 nmem;
|
||||
@@ -74,7 +74,7 @@ const void *nbt_proctag(const void *restrict buf, u16 slen, void *restrict out)
|
||||
|
||||
// BUG: strict aliasing
|
||||
switch (*(u8 *)buf) {
|
||||
case NBT_I8: *(u8 *)out = *ptr; return ptr + 1;
|
||||
case NBT_I8: *(u8 *)out = *(u8 *)ptr; return ptr + 1;
|
||||
case NBT_I16: *(u16 *)out = be16toh(*(u16 *)ptr); return ptr + 2;
|
||||
case NBT_I32: // fall through
|
||||
case NBT_F32: *(u32 *)out = be16toh(*(u32 *)ptr); return ptr + 4;
|
||||
|
||||
Reference in New Issue
Block a user