slightly improve command_defs[]

* make the struct `const`
* use designated initializers
* remove `CMD_NOxyz` macros
* fix function-pointer correctness of `sub_func[]`

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
Steffen Jaeckel
2022-12-20 09:29:36 +01:00
parent e9aaba938b
commit a45f05a45e
5 changed files with 272 additions and 461 deletions

View File

@@ -68,7 +68,11 @@ typedef struct cmd_t
int min_args;
int max_args;
void (*setting_func)(void);
void* sub_funcs[50][2];
struct
{
const char* cmd;
gboolean (*func)(ProfWin* window, const char* const command, gchar** args);
} sub_funcs[50];
gboolean (*func)(ProfWin* window, const char* const command, gchar** args);
CommandHelp help;
} Command;