Merge `TRANSMUTE()` macro from branch ref: strings/87e102ded928dcc4d9c4c79e22c68b709ea91c40.Avril2021-07-19 22:22:12 +0100
87e102ded9Added `TRANSMUTE(value, to_type)` macro, which performs a bit-cast on `value` to `to_type`. The sizes of the types must be the same or a compilation error is raised. There is currently no alignment restriction on the types (maybe there should be?).Avril2021-07-19 22:20:01 +0100
ee7434e8bfReplace `Nx()` (temp value-assigning) macros with `Nv()` to avoid conflict with `TRACEx()` and for more clarity.Avril2021-07-15 15:03:04 +0100
6bd747a57aReplace `Nx()` (temp value-assigning) macros with `Nv()` to avoid conflict with `TRACEx()` and for more clarity.Avril2021-07-15 15:03:25 +0100
Added `_str_raw_to_cstrsa()`: Convert raw buffer to nul-terminated string that is dynamically allocated and statically held. (i.e. do not `free()`)Avril2021-07-15 14:58:29 +0100
Attempted rewrite of _display_get_fmt()`, it currently doesn"t work. To compile using the old functional but (probably) unsafe function, pass `-D_DEBUG_USE_UNSAFE_DISPLAY_FMT_ARGS` in `CFLAGS`.Avril2021-07-14 02:45:02 +0100
Basic implementation of more sensible string mutating functions for display format string creation. (`strncat_n()`, `strncpy_n()`.)Avril2021-07-13 19:27:55 +0100
Added COLD_EXPR() and HOT_EXPR() macros that (ab)use label attrs. Not sure of a better way to mark blocks/expressions as `cold` :/ I dunno if `if(UNLIKELY(1))` would work.Avril2021-07-12 20:21:14 +0100
Change all `map_handle_err(map_free())` conditionals to `UNLIKELY` (`ifU()`), as it is unlikely an unmap will fail on a map that has already been established successfully.Avril2021-07-12 20:04:37 +0100
Unmap needle before returning from main after failed haystack maps. The process return value is still `PROG_RET_MAP_HAYSTACK_FAILED`, but a warning message is printed if unmapping the needle failed after the rollback. (this is unlikely)Avril2021-07-12 20:02:18 +0100
Allow controling logging verbosity at runtime with `LOG_LEVEL=<name>` env-var. Default is `DEBUG` (trace) on debug builds, and `WARN` on release builds.Avril2021-07-12 17:50:30 +0100
Reworked `PROG_RET_` to return negatives on internal, memory, or file/mapping failures, and to return the first haystack number that failed to match instead as return code (haystack numbers start at 1, since 0 is the needle). If all matched, return 0 from main().Avril2021-07-10 00:58:42 +0100
Added "useful" program error return codes `PROG_RET_` in "project.h". These can be used to specify which operation failed and on which input.Avril2021-07-09 22:32:15 +0100