From 92c2f4a177cdb77aab262f71c87257e840f4a43c Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 29 Jul 2008 13:55:09 -0700 Subject: Add annotation to cli functions Use gcc annotations for noreturn and printf like formats --- src/cli_new.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/cli_new.c') diff --git a/src/cli_new.c b/src/cli_new.c index 34f8af0..33430bd 100644 --- a/src/cli_new.c +++ b/src/cli_new.c @@ -110,7 +110,7 @@ char *cli_operation_name = NULL; printf("echo \"bla-bla-bla%s\";", sptr) note very important ';' as the end of the format */ -void bye(char *msg, ...) +void bye(const char *msg, ...) { va_list ap; @@ -135,7 +135,7 @@ void bye(char *msg, ...) which are executed as eval `command` in order to modify BASH env */ -void print_msg(char *msg, ...) +void print_msg(const char *msg, ...) { va_list ap; @@ -367,7 +367,7 @@ get_config_lock() return ret; } -void internal_error(int line, char *file) +void internal_error(int line, const char *file) { printf("\n\nInternal Error at line %d in %s\n", line, file); exit (-1); @@ -802,7 +802,7 @@ int char2val(vtw_def *def, char *value, valstruct *valp) compare two values per cond returns result of comparison ****************************************************/ -boolean val_cmp(valstruct *left, valstruct *right, vtw_cond_e cond) +boolean val_cmp(const valstruct *left, const valstruct *right, vtw_cond_e cond) { unsigned int left_parts[9], right_parts[9]; vtw_type_e val_type; @@ -2118,12 +2118,7 @@ const char *type_to_name(vtw_type_e type) { } } -#if 1 -void -dump_log(int argc, char **argv) -{ -} -#else +#ifdef CLI_DEBUG void dump_log(int argc, char **argv) { int i; -- cgit v1.2.3