diff --git a/CHANGELOG.md b/CHANGELOG.md index 67f6dbf..d737eca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Switched to using `wpMiscUtilsRotl64` in `xorshift` - Remove all uses of names starting with underscore - Ensure `wpArrayClear` memsets members to 0 +- Removed '%' from `WP_STR8_SPEC` ## [2.4.0] - 2026-08-30 diff --git a/src/base/hash/hasher/siphash.h b/src/base/hash/hasher/siphash.h index 8abae82..188fe64 100644 --- a/src/base/hash/hasher/siphash.h +++ b/src/base/hash/hasher/siphash.h @@ -32,17 +32,17 @@ typedef struct WpSipHasherData { } WpSipHasherData; #ifdef WP_PLATFORM_CPP -#define wpSip24HasherData(KEY) (WpSipHasherData{KEY, WP_SIP_HASHER_MAGIC, 2, 4}) -#define wpSip48HasherData(KEY) (WpSipHasherData{KEY, WP_SIP_HASHER_MAGIC, 4, 8}) +#define wpSip24HasherData(KEY) (WpSipHasherData{(KEY), WP_SIP_HASHER_MAGIC, 2, 4}) +#define wpSip48HasherData(KEY) (WpSipHasherData{(KEY), WP_SIP_HASHER_MAGIC, 4, 8}) #else #define wpSip24HasherData(KEY) ((WpSipHasherData){ \ - .key = KEY, \ + .key = (KEY), \ .magic = WP_SIP_HASHER_MAGIC, \ .compression = 2, \ .finalisation = 4, \ }) #define wpSip48HasherData(KEY) ((WpSipHasherData){ \ - .key = KEY, \ + .key = (KEY), \ .magic = WP_SIP_HASHER_MAGIC, \ .compression = 4, \ .finalisation = 8, \ diff --git a/src/base/strings/str8/str8.h b/src/base/strings/str8/str8.h index 2b68298..2695fcc 100644 --- a/src/base/strings/str8/str8.h +++ b/src/base/strings/str8/str8.h @@ -27,7 +27,7 @@ typedef const WpStr8 WpStr8RO; /** * Utilities to be used with printf functions */ -#define WP_STR8_SPEC "%.*s" +#define WP_STR8_SPEC ".*s" #define wpStr8Varg(STRING) (int)((STRING).size), (STRING).buf /** diff --git a/src/os/shell/commander/commander.c b/src/os/shell/commander/commander.c index 0a935f3..9502988 100644 --- a/src/os/shell/commander/commander.c +++ b/src/os/shell/commander/commander.c @@ -94,7 +94,7 @@ wp_intern WpCmdError getCommandOutput(FILE *fp, WpCmdOutHandling out_handling, W wpStr8ConcatCapped(out_buf, &out); } else if (out_handling == WP_SHELL_OUTPUT_PRINT) { - printf(WP_STR8_SPEC, wpStr8Varg(out)); + printf("%" WP_STR8_SPEC, wpStr8Varg(out)); } return WP_SHELL_ERR_NO_ERROR; diff --git a/src/os/shell/termcolour/posix/termcolour_posix.c b/src/os/shell/termcolour/posix/termcolour_posix.c index a62fc4a..7214553 100644 --- a/src/os/shell/termcolour/posix/termcolour_posix.c +++ b/src/os/shell/termcolour/posix/termcolour_posix.c @@ -30,7 +30,7 @@ wp_intern WpStr8RO colours[COUNT_TERM_COLOUR] = { }; void printColouredText(WpStr8RO *text, WpTerminalColour colour) { - printf(WP_STR8_SPEC WP_STR8_SPEC, wpStr8Varg(colours[colour]), wpStr8Varg((*text))); + printf("%" WP_STR8_SPEC "%" WP_STR8_SPEC, wpStr8Varg(colours[colour]), wpStr8Varg((*text))); } #endif // !WP_PLATFORM_POSIX diff --git a/src/os/shell/termcolour/win/termcolour_win.c b/src/os/shell/termcolour/win/termcolour_win.c index a750da0..3acd995 100644 --- a/src/os/shell/termcolour/win/termcolour_win.c +++ b/src/os/shell/termcolour/win/termcolour_win.c @@ -56,7 +56,7 @@ void printColouredText(WpStr8RO *text, WpTerminalColour colour) { } SetConsoleTextAttribute(data.handle, data.current_colour); - printf(WP_STR8_SPEC, wpStr8Varg((*text))); + printf("%" WP_STR8_SPEC, wpStr8Varg((*text))); } wp_intern void initData(TermcolourData *data) { diff --git a/src/testing/tester/tester.c b/src/testing/tester/tester.c index 910d503..ddc5ed8 100644 --- a/src/testing/tester/tester.c +++ b/src/testing/tester/tester.c @@ -47,7 +47,7 @@ wp_intern void handleTestResult(WpTestFuncResult result) { printf("["); wpShellTermcolourPrintText(&result_text, colour); wpShellTermcolourClearColour(); - printf("] " WP_STR8_SPEC "\n", wpStr8Varg(result.name)); + printf("] %" WP_STR8_SPEC "\n", wpStr8Varg(result.name)); if (!result.passed) { exit(EXIT_FAILURE);