scanner: remove unnecessary cast

'tok' is already an int now.

Signed-off-by: Ran Benita <ran234@gmail.com>
rules: reduce variable scopes

There are some big functions there, and this might help reduce the
cognitive load a bit.

Signed-off-by: Ran Benita <ran234@gmail.com>
rules: improve error logging macros

Improve safety with parenthesis, make the matcher macros use the scanner
ones, and make the 1 variant use %s instead of embedding the msg; this
way the compiler can reuse the string in the binary.

Signed-off-by: Ran Benita <ran234@gmail.com>
rules: use strlen_safe

Signed-off-by: Ran Benita <ran234@gmail.com>
rules: simplify a bit of code

Signed-off-by: Ran Benita <ran234@gmail.com>
keymap: call strlen on keymap string instead of SIZE_MAX

I wanted to avoid the strlen, but we'd better keep the scanner a bit
less surprising and encourage people to use xkb_keymap_new_from_buffer()
instead of they do in fact have access to the size.

Signed-off-by: Ran Benita <ran234@gmail.com>
rulescomp: increase BENCHMARK_ITERATIONS from 1000 to 2500

1000 is a bit too low for statistical significance on this 6 years old
CPU. Since the benchmark is run manually this shouldn't be a problem.

Signed-off-by: Ran Benita <ran234@gmail.com>