~q3cpma/misc-tools

0379111b5a5bf3174c15cb49482d2e58da966679 — q3cpma 4 months ago 7322f80
Misc stuff
4 files changed, 10 insertions(+), 9 deletions(-)

M array.h
M gen_unicode_tolower_lut.sh
M test.sh
M utf8.h
M array.h => array.h +2 -3
@@ 1,6 1,5 @@
/* Generic array with length and capacity stored in the first 8 bytes.
 * The array pointer then points to the real pointer (given by malloc)
 * with and offset of 2 * sizeof(size_t) bytes.
/* Generic array with length and capacity stored in the first 2 *
 * sizeof(size_t) bytes.
 *
 * Inspired by https://github.com/eteran/c-vector, but without all the NULL
 * checking and the PTR_GARRAY functions added */

M gen_unicode_tolower_lut.sh => gen_unicode_tolower_lut.sh +1 -1
@@ 1,6 1,6 @@
#!/bin/sh
set -eu
cd -P -- "$(dirname -- "$0")"
cd -- "$(dirname -- "$0")"
self=./$(basename -- "$0")
. ./build_util.sh


M test.sh => test.sh +6 -4
@@ 14,10 14,12 @@ check_strcmp()
	else
		status=$?
		cols=$(tput cols)
		printf '%*s\n' ${cols:-0} | tr ' ' '-'
		printf '%bEXPECTED%b\n%s\n\n' "$(tput bold)" "$(tput sgr0)" "$2"
		printf '%bGOT%b\n%s\n'      "$(tput bold)" "$(tput sgr0)" "$1"
		printf '%*s\n' ${cols:-0} | tr ' ' '-'
		{
			printf '%*s\n' ${cols:-0} | tr ' ' '-'
			printf '%bEXPECTED%b\n%s\n\n' "$(tput bold)" "$(tput sgr0)" "$2"
			printf '%bGOT%b\n%s\n'      "$(tput bold)" "$(tput sgr0)" "$1"
			printf '%*s\n' ${cols:-0} | tr ' ' '-'
		} >&2
	fi
}


M utf8.h => utf8.h +1 -1
@@ 28,7 28,7 @@ static inline uint32_t xutf8_decode_step(const char **buf)
	{
		case UTF8_STEP_MALFORMED:
		case UTF8_STEP_INCOMPLETE:
			exit(EXIT_FAILURE);
			abort();

		default:
			return (uint32_t)ret;