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/goto.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/goto.c') diff --git a/src/goto.c b/src/goto.c index 281a9f5..65ee3ca 100644 --- a/src/goto.c +++ b/src/goto.c @@ -35,12 +35,12 @@ /** @extends teco_rb3str_head_t */ typedef struct { teco_rb3str_head_t head; - gint pc; + gsize pc; } teco_goto_label_t; /** @private @static @memberof teco_goto_label_t */ static teco_goto_label_t * -teco_goto_label_new(const gchar *name, gsize len, gint pc) +teco_goto_label_new(const gchar *name, gsize len, gsize pc) { teco_goto_label_t *label = g_new0(teco_goto_label_t, 1); teco_string_init(&label->head.name, name, len); @@ -79,10 +79,10 @@ teco_goto_table_dump(teco_goto_table_t *ctx) #endif /** @memberof teco_goto_table_t */ -gint +gssize teco_goto_table_remove(teco_goto_table_t *ctx, const gchar *name, gsize len) { - gint existing_pc = -1; + gssize existing_pc = -1; teco_goto_label_t *label = (teco_goto_label_t *)teco_rb3str_find(&ctx->tree, TRUE, name, len); if (label) { @@ -95,7 +95,7 @@ teco_goto_table_remove(teco_goto_table_t *ctx, const gchar *name, gsize len) } /** @memberof teco_goto_table_t */ -gint +gssize teco_goto_table_find(teco_goto_table_t *ctx, const gchar *name, gsize len) { teco_goto_label_t *label = (teco_goto_label_t *)teco_rb3str_find(&ctx->tree, TRUE, name, len); @@ -103,13 +103,13 @@ teco_goto_table_find(teco_goto_table_t *ctx, const gchar *name, gsize len) } /** @memberof teco_goto_table_t */ -gint -teco_goto_table_set(teco_goto_table_t *ctx, const gchar *name, gsize len, gint pc) +gssize +teco_goto_table_set(teco_goto_table_t *ctx, const gchar *name, gsize len, gssize pc) { if (pc < 0) return teco_goto_table_remove(ctx, name, len); - gint existing_pc = -1; + gssize existing_pc = -1; teco_goto_label_t *label = (teco_goto_label_t *)teco_rb3str_find(&ctx->tree, TRUE, name, len); if (label) { @@ -135,7 +135,7 @@ teco_goto_table_set(teco_goto_table_t *ctx, const gchar *name, gsize len, gint p */ typedef struct { teco_goto_table_t *table; - gint pc; + gssize pc; gsize len; gchar name[]; } teco_goto_table_undo_set_t; @@ -153,7 +153,7 @@ teco_goto_table_undo_set_action(teco_goto_table_undo_set_t *ctx, gboolean run) /** @memberof teco_goto_table_t */ void -teco_goto_table_undo_set(teco_goto_table_t *ctx, const gchar *name, gsize len, gint pc) +teco_goto_table_undo_set(teco_goto_table_t *ctx, const gchar *name, gsize len, gssize pc) { if (!ctx->must_undo) return; -- cgit v1.2.3