From a9224ebee3b6458dee42d76ec76b1a704e206107 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 13 Sep 2024 01:31:49 +0200 Subject: remaining types of program counters changed to gsize/gssize * This fixes F< to the beginning of the macro, which was broken in 73d574b71a10d4661ada20275cafde75aff6c1ba. teco_machine_main_t::macro_pc actually has to be signed as it is sometimes set to -1. --- src/parser.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/parser.c') diff --git a/src/parser.c b/src/parser.c index 3c37f81..45e31cf 100644 --- a/src/parser.c +++ b/src/parser.c @@ -102,12 +102,6 @@ gboolean teco_machine_main_step(teco_machine_main_t *ctx, const gchar *macro, gsize stop_pos, GError **error) { while (ctx->macro_pc < stop_pos) { -#ifdef DEBUG - g_printf("EXEC(%d): input='%c'/%x, state=%p, mode=%d\n", - ctx->macro_pc, macro[ctx->macro_pc], macro[ctx->macro_pc], - ctx->parent.current, ctx->mode); -#endif - if (G_UNLIKELY(teco_interface_is_interrupted())) { teco_error_interrupted_set(error); goto error_attach; @@ -123,6 +117,11 @@ teco_machine_main_step(teco_machine_main_t *ctx, const gchar *macro, gsize stop_ /* UTF-8 sequences are already validated */ gunichar chr = g_utf8_get_char(macro+ctx->macro_pc); +#ifdef DEBUG + g_printf("EXEC(%d): input='%C' (U+%04" G_GINT32_MODIFIER "X), state=%p, mode=%d\n", + ctx->macro_pc, chr, chr, ctx->parent.current, ctx->mode); +#endif + if (!teco_machine_input(&ctx->parent, chr, error)) goto error_attach; -- cgit v1.2.3