From e954286db5c97af5744d20eda1b2277658e25406 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Mon, 21 Feb 2022 18:13:26 +0100 Subject: [PATCH] [config] const in get_option_type_name --- src/config/opttypes.c | 2 +- src/config/opttypes.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config/opttypes.c b/src/config/opttypes.c index aa8ece402..64da3de1d 100644 --- a/src/config/opttypes.c +++ b/src/config/opttypes.c @@ -502,7 +502,7 @@ const struct option_type_info option_types[] = { { N_("Folder"), NULL, NULL, NULL, tree_dup, NULL, NULL, "" }, }; -char * +const char * get_option_type_name(enum option_type type) { assert(type >= 0 && type < sizeof(option_types)/sizeof(struct option_type_info)); diff --git a/src/config/opttypes.h b/src/config/opttypes.h index ccc23f405..72a57726e 100644 --- a/src/config/opttypes.h +++ b/src/config/opttypes.h @@ -9,7 +9,7 @@ extern "C" { #endif struct option_type_info { - char *name; + const char *name; const char *(*cmdline)(struct option *, char ***, int *); char *(*read)(struct option *, char **, int *); void (*write)(struct option *, struct string *); @@ -24,7 +24,7 @@ extern const struct option_type_info option_types[]; extern int commandline; -char *get_option_type_name(enum option_type type); +const char *get_option_type_name(enum option_type type); #ifdef __cplusplus }