From 45b9dea901cec7045be1a98f61d48d41dc965a9f Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 18 Jul 2025 01:12:45 +0300 Subject: make some array declarations real constants * `static const char *p = "FOO"` is not a true constant since the variable p can still be changed. It has to be declared as `static const char *const p = "FOO"`, so that the pointer itself is constant. * In case of string constants, it's easier however to use `static const char p[] = "FOO"`. --- src/qreg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qreg.c') diff --git a/src/qreg.c b/src/qreg.c index 67cc19c..c8c4614 100644 --- a/src/qreg.c +++ b/src/qreg.c @@ -1341,7 +1341,7 @@ teco_ed_hook(teco_ed_hook_t type, GError **error) return teco_expressions_discard_args(error) && teco_expressions_brace_close(error); - static const gchar *type2name[] = { + static const gchar *const type2name[] = { [TECO_ED_HOOK_ADD-1] = "ADD", [TECO_ED_HOOK_EDIT-1] = "EDIT", [TECO_ED_HOOK_CLOSE-1] = "CLOSE", -- cgit v1.2.3