diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/command_parse.h | 8 | ||||
-rw-r--r-- | lib/errno_names.c | 2 | ||||
-rw-r--r-- | lib/log.c | 16 | ||||
-rw-r--r-- | lib/log_local.h | 2 | ||||
-rw-r--r-- | lib/qpath.c | 4 | ||||
-rw-r--r-- | lib/qpath.h | 4 | ||||
-rw-r--r-- | lib/vty_local.h | 2 |
7 files changed, 19 insertions, 19 deletions
diff --git a/lib/command_parse.h b/lib/command_parse.h index ee219f84..ab93f061 100644 --- a/lib/command_parse.h +++ b/lib/command_parse.h @@ -142,7 +142,7 @@ typedef enum cmd_item_type_bit cmd_item_type_bit_t ; Inline bool cmd_item_is_option(cmd_item_type_t itt) { - const static bool is_option[item_type_count] = + static const bool is_option[item_type_count] = { [item_null] = false, @@ -176,7 +176,7 @@ cmd_item_is_option(cmd_item_type_t itt) Inline bool cmd_item_is_vararg(cmd_item_type_t itt) { - const static bool is_vararg[item_type_count] = + static const bool is_vararg[item_type_count] = { [item_null] = false, @@ -391,7 +391,7 @@ match_item_type(match_type_t mt) Inline match_strength_t match_match_strength(match_type_t mt) { - const static match_strength_t match_match_strength[match_type_count] = + static const match_strength_t match_match_strength[match_type_count] = { [mt_no_match] = ms_no_match, @@ -439,7 +439,7 @@ match_match_strength(match_type_t mt) Inline match_type_t item_best_match(cmd_item_type_t it) { - const static match_type_t item_best_match[item_type_count] = + static const match_type_t item_best_match[item_type_count] = { [item_null] = mt_no_match, diff --git a/lib/errno_names.c b/lib/errno_names.c index 3c1ff23c..be3fda51 100644 --- a/lib/errno_names.c +++ b/lib/errno_names.c @@ -178,7 +178,9 @@ static const char* errno_name_table[] = ERRNO(ECOMM), /* Communication error on send */ #endif #ifdef EDEADLOCK +# ifndef EDEADLK ERRNO(EDEADLOCK), /* same as EDEADLK */ +# endif #endif #ifdef EDOTDOT ERRNO(EDOTDOT), /* RFS specific error */ @@ -530,9 +530,8 @@ void _zlog_assert_failed (const char *assertion, const char *file, unsigned int line, const char *function) { - const static size_t buff_size = 1024; - char buff[buff_size]; - snprintf(buff, buff_size, + char buff[1024]; + snprintf(buff, sizeof(buff), "Assertion `%s' failed in file %s, line %u, function %s", assertion, file, line, (function ? function : "?")); zlog_abort(buff); @@ -543,9 +542,9 @@ void _zlog_abort_mess (const char *mess, const char *file, unsigned int line, const char *function) { - const static size_t buff_size = 1024; - char buff[buff_size]; - snprintf(buff, buff_size, "%s, in file %s, line %u, function %s", + char buff[1024]; + snprintf(buff, sizeof(buff), + "%s, in file %s, line %u, function %s", mess, file, line, (function ? function : "?")); zlog_abort(buff); } @@ -563,9 +562,8 @@ void _zlog_abort_err (const char *mess, int err, const char *file, unsigned int line, const char *function) { - const static size_t buff_size = 1024; - char buff[buff_size]; - snprintf(buff, buff_size, + char buff[1024]; + snprintf(buff, sizeof(buff), "%s, in file %s, line %u, function %s, %s", mess, file, line, (function ? function : "?"), errtoa(err, 0).str); diff --git a/lib/log_local.h b/lib/log_local.h index d96f9f8b..b5e712d0 100644 --- a/lib/log_local.h +++ b/lib/log_local.h @@ -119,7 +119,7 @@ extern int log_assert_fail ; Inline void LOG_ASSERT_FAILED(void) { - if (log_assert_fail == 0) ; + if (log_assert_fail == 0) { log_assert_fail = 1 ; assert(0) ; diff --git a/lib/qpath.c b/lib/qpath.c index 955f307f..1a05e507 100644 --- a/lib/qpath.c +++ b/lib/qpath.c @@ -98,9 +98,9 @@ qpath_reset(qpath qp, free_keep_b free_structure) qs_reset(qp->path, keep_it) ; if (free_structure) - XFREE(MTYPE_QPATH, qp) ; /* sets qp = NULL */ + XFREE(MTYPE_QPATH, qp) ; /* sets qp = NULL */ else - ; + {;}; /* currently nothing else to do */ return qp ; } ; diff --git a/lib/qpath.h b/lib/qpath.h index 9b0509d7..dbd6da3a 100644 --- a/lib/qpath.h +++ b/lib/qpath.h @@ -75,7 +75,7 @@ Inline qpath qpath_free(qpath qp) ; Inline const char* qpath_string(qpath qp) ; Inline char* qpath_char_string(qpath qp) ; Inline ulen qpath_len(qpath qp) ; -Inline const qstring qpath_qs(qpath qp) ; +Inline qstring qpath_qs(qpath qp) ; extern qpath qpath_set(qpath dst, const char* src) ; extern qpath qpath_set_n(qpath dst, const char* src, ulen n) ; @@ -208,7 +208,7 @@ qpath_len(qpath qp) * * For a NULL qpath returns NULL qstring. */ -Inline const qstring +Inline qstring qpath_qs(qpath qp) { return (qp != NULL) ? qp->path : NULL ; diff --git a/lib/vty_local.h b/lib/vty_local.h index ed2c5ce4..212ab053 100644 --- a/lib/vty_local.h +++ b/lib/vty_local.h @@ -177,7 +177,7 @@ extern int vty_assert_fail ; Inline void VTY_ASSERT_FAILED(void) { - if (vty_assert_fail == 0) ; + if (vty_assert_fail == 0) { vty_assert_fail = 1 ; assert(0) ; |