From 1c19b4435c5e75d6f828500bbcd58dadcdf923f6 Mon Sep 17 00:00:00 2001 From: Ivar Fatland Date: Wed, 6 May 2026 20:52:46 +0200 Subject: [PATCH] update justfile to not make so much garbage --- justfile | 16 +++++++++++----- map.c | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/justfile b/justfile index 674ba8d..c03d103 100644 --- a/justfile +++ b/justfile @@ -5,26 +5,32 @@ LDFLAGS := if os() == "macos" { } else { "-lcriterion" } -TESTBIN := "/tmp/all_tests" + +TMP := "/tmp" + +TESTBIN := TMP/"all_tests" set shell := ["bash", "-cu"] + FOOBAR := "foobar" FOOBAR_SOURCE := FOOBAR+".c" -FOOBAR_EXPANDED := FOOBAR+"-expanded.c" +FOOBAR_BIN := TMP/FOOBAR +FOOBAR_EXPANDED := TMP/FOOBAR+"-expanded.c" run_foobar: build_foobar - ./{{FOOBAR}} + ./{{FOOBAR_BIN}} build_foobar: foobar_expanded - {{CC}} {{FOOBAR_EXPANDED}} -o {{FOOBAR}} {{CFLAGS}} + {{CC}} {{FOOBAR_EXPANDED}} -o {{FOOBAR_BIN}} {{CFLAGS}} + echo "{{FOOBAR_BIN}}" foobar_expanded: {{CC}} -P -E {{FOOBAR_SOURCE}} -o {{FOOBAR_EXPANDED}} clang-format -i {{FOOBAR_EXPANDED}} clean_foobar: - rm {{FOOBAR}} + rm {{FOOBAR_BIN}} [default] test: build diff --git a/map.c b/map.c index 1533d09..8f870ea 100644 --- a/map.c +++ b/map.c @@ -234,7 +234,7 @@ void map_assure_growable_by_1(void **this, const char *file, int line) { // The reason for re-hashing is that all hashes are moduloed by the // size of the mapping array, so the resulting hash will likely change. for ( unsigned int i = 0; i < header->n_items; i++ ) { - void *pair = &(*this)[i*header->item_size]; + void *pair = &((uint8_t *)(*this))[i*header->item_size]; // This is okay, because we absolutely know that the keys don't already // exist. (assuming all the other code for map is doing it's job)