aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/goto-commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/goto-commands.c')
-rw-r--r--src/goto-commands.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/goto-commands.c b/src/goto-commands.c
index 72ac80d..a9ff3c2 100644
--- a/src/goto-commands.c
+++ b/src/goto-commands.c
@@ -61,8 +61,8 @@ teco_state_label_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
{
if (!ctx->goto_label.len) {
switch (chr) {
- case '*': TECO_RETURN(ctx, &teco_state_blockcomment, error); /* `!*` */
- case '!': TECO_RETURN(ctx, &teco_state_eolcomment, error); /* `!!` */
+ case '*': return &teco_state_blockcomment; /* `!*` */
+ case '!': return &teco_state_eolcomment; /* `!!` */
}
}
@@ -97,7 +97,7 @@ teco_state_label_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
teco_string_clear(&ctx->goto_label);
memset(&ctx->goto_label, 0, sizeof(ctx->goto_label));
- TECO_RETURN(ctx, &teco_state_start, error);
+ return &teco_state_start;
}
/*
@@ -109,7 +109,7 @@ teco_state_label_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
if (ctx->parent.must_undo)
undo__teco_string_truncate(&ctx->goto_label, ctx->goto_label.len);
teco_string_append_wc(&ctx->goto_label, chr);
- TECO_RETURN(ctx, &teco_state_label, error);
+ return &teco_state_label;
}
TECO_DEFINE_STATE(teco_state_label,
@@ -244,34 +244,34 @@ TECO_DEFINE_STATE_EXPECTSTRING(teco_state_goto,
)
static teco_state_t *
-teco_state_blockcomment_star_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
+teco_state_blockcomment_star_input(teco_machine_t *ctx, gunichar chr, GError **error)
{
- TECO_RETURN(ctx, chr == '!' ? &teco_state_start : &teco_state_blockcomment, error);
+ return chr == '!' ? &teco_state_start : &teco_state_blockcomment;
}
static TECO_DEFINE_STATE_COMMENT(teco_state_blockcomment_star,
- .input_cb = (teco_state_input_cb_t)teco_state_blockcomment_star_input
+ .input_cb = teco_state_blockcomment_star_input
);
static teco_state_t *
-teco_state_blockcomment_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
+teco_state_blockcomment_input(teco_machine_t *ctx, gunichar chr, GError **error)
{
- TECO_RETURN(ctx, chr == '*' ? &teco_state_blockcomment_star : &teco_state_blockcomment, error);
+ return chr == '*' ? &teco_state_blockcomment_star : &teco_state_blockcomment;
}
static TECO_DEFINE_STATE_COMMENT(teco_state_blockcomment,
- .input_cb = (teco_state_input_cb_t)teco_state_blockcomment_input
+ .input_cb = teco_state_blockcomment_input
);
/*
* `!!` line comments are inspired by TECO-64.
*/
static teco_state_t *
-teco_state_eolcomment_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
+teco_state_eolcomment_input(teco_machine_t *ctx, gunichar chr, GError **error)
{
- TECO_RETURN(ctx, chr == '\n' ? &teco_state_start : &teco_state_eolcomment, error);
+ return chr == '\n' ? &teco_state_start : &teco_state_eolcomment;
}
static TECO_DEFINE_STATE_COMMENT(teco_state_eolcomment,
- .input_cb = (teco_state_input_cb_t)teco_state_eolcomment_input
+ .input_cb = teco_state_eolcomment_input
);