From 121cca61bedf24ba428e019f23b3bbb7160ce162 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 21 Mar 2025 13:21:02 +0300 Subject: don't use TECO_DEFINE_UNDO_OBJECT_OWN() for what are essentially scalars * The "own" objects are tricky to work with and have special requirements, so try to avoid them. * Also, wrap the push functions in macros like all other scalars. * This is a purely cosmetic change, but avoids some confusion. --- src/symbols.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/symbols.c') diff --git a/src/symbols.c b/src/symbols.c index 7dcc601..52dfd1f 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -43,10 +43,11 @@ teco_symbol_list_t teco_symbol_list_scintilla = {NULL, 0}; teco_symbol_list_t teco_symbol_list_scilexer = {NULL, 0}; -/* - * FIXME: Could be static. - */ -TECO_DEFINE_UNDO_OBJECT_OWN(scintilla_message, teco_machine_scintilla_t, /* don't delete */); +/* FIXME: Could be static. */ +TECO_DEFINE_UNDO_SCALAR(teco_machine_scintilla_t); + +#define teco_undo_scintilla_message(VAR) \ + (*teco_undo_object_teco_machine_scintilla_t_push(&(VAR))) /** @memberof teco_symbol_list_t */ void @@ -222,7 +223,7 @@ teco_state_scintilla_symbols_done(teco_machine_main_t *ctx, const teco_string_t * undo methods for the Scintilla types. */ if (ctx->parent.must_undo) - teco_undo_object_scintilla_message_push(&ctx->scintilla); + teco_undo_scintilla_message(ctx->scintilla); memset(&ctx->scintilla, 0, sizeof(ctx->scintilla)); if ((str->len > 0 && !teco_scintilla_parse_symbols(&ctx->scintilla, str, error)) || -- cgit v1.2.3