Merge pull request #12201 from donaldsharp/clang-16-robots

Clang 16 robots
This commit is contained in:
Jafar Al-Gharaibeh 2022-10-26 23:07:05 -05:00 committed by GitHub
commit e3c117e19a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 30 additions and 37 deletions

View File

@ -723,7 +723,7 @@ void isis_vrf_init(void)
vrf_cmd_init(NULL); vrf_cmd_init(NULL);
} }
void isis_terminate() void isis_terminate(void)
{ {
struct isis *isis; struct isis *isis;
struct listnode *node, *nnode; struct listnode *node, *nnode;
@ -2745,7 +2745,6 @@ static void show_isis_database_json(struct json_object *json, const char *sysid_
struct isis_area *area; struct isis_area *area;
int level; int level;
struct json_object *tag_area_json,*area_json, *lsp_json, *area_arr_json, *arr_json; struct json_object *tag_area_json,*area_json, *lsp_json, *area_arr_json, *arr_json;
uint8_t area_cnt = 0;
if (isis->area_list->count == 0) if (isis->area_list->count == 0)
return; return;
@ -2770,7 +2769,6 @@ static void show_isis_database_json(struct json_object *json, const char *sysid_
json_object_array_add(arr_json, lsp_json); json_object_array_add(arr_json, lsp_json);
} }
json_object_array_add(area_arr_json, area_json); json_object_array_add(area_arr_json, area_json);
area_cnt++;
} }
} }
@ -3232,7 +3230,7 @@ void isis_area_overload_on_startup_set(struct isis_area *area,
* Returns the path of the file (non-volatile memory) that contains restart * Returns the path of the file (non-volatile memory) that contains restart
* information. * information.
*/ */
char *isis_restart_filepath() char *isis_restart_filepath(void)
{ {
static char filepath[MAXPATHLEN]; static char filepath[MAXPATHLEN];
snprintf(filepath, sizeof(filepath), ISISD_RESTART, ""); snprintf(filepath, sizeof(filepath), ISISD_RESTART, "");

View File

@ -359,8 +359,7 @@ nbr_find_ldpid(uint32_t lsr_id)
return (RB_FIND(nbr_id_head, &nbrs_by_id, &n)); return (RB_FIND(nbr_id_head, &nbrs_by_id, &n));
} }
struct nbr * struct nbr *nbr_get_first_ldpid(void)
nbr_get_first_ldpid()
{ {
return (RB_MIN(nbr_id_head, &nbrs_by_id)); return (RB_MIN(nbr_id_head, &nbrs_by_id));
} }

View File

@ -1360,7 +1360,7 @@ static void ospf6_route_show_table_summary(struct vty *vty,
struct ospf6_route *route, *prev = NULL; struct ospf6_route *route, *prev = NULL;
int i, pathtype[OSPF6_PATH_TYPE_MAX]; int i, pathtype[OSPF6_PATH_TYPE_MAX];
unsigned int number = 0; unsigned int number = 0;
int nh_count = 0, nhinval = 0, ecmp = 0; int nh_count = 0, ecmp = 0;
int alternative = 0, destination = 0; int alternative = 0, destination = 0;
char path_str[30]; char path_str[30];
@ -1374,9 +1374,7 @@ static void ospf6_route_show_table_summary(struct vty *vty,
else else
alternative++; alternative++;
nh_count = ospf6_num_nexthops(route->nh_list); nh_count = ospf6_num_nexthops(route->nh_list);
if (!nh_count) if (nh_count > 1)
nhinval++;
else if (nh_count > 1)
ecmp++; ecmp++;
pathtype[route->path.type]++; pathtype[route->path.type]++;
number++; number++;

View File

@ -162,7 +162,7 @@ bool path_ted_is_initialized(void)
* *
* @return Ptr to ted or NULL * @return Ptr to ted or NULL
*/ */
struct ls_ted *path_ted_create_ted() struct ls_ted *path_ted_create_ted(void)
{ {
struct ls_ted *ted = ls_ted_new(TED_KEY, TED_NAME, TED_ASN); struct ls_ted *ted = ls_ted_new(TED_KEY, TED_NAME, TED_ASN);

View File

@ -163,7 +163,7 @@ pcep_msg_create_error_with_objects(uint8_t error_type, uint8_t error_value,
return message; return message;
} }
struct pcep_message *pcep_msg_create_keepalive() struct pcep_message *pcep_msg_create_keepalive(void)
{ {
return (pcep_msg_create_common(PCEP_TYPE_KEEPALIVE)); return (pcep_msg_create_common(PCEP_TYPE_KEEPALIVE));
} }

View File

@ -348,7 +348,7 @@ struct pcep_message *pcep_decode_message(const uint8_t *msg_buf)
return msg; return msg;
} }
struct pcep_versioning *create_default_pcep_versioning() struct pcep_versioning *create_default_pcep_versioning(void)
{ {
struct pcep_versioning *versioning = struct pcep_versioning *versioning =
pceplib_malloc(PCEPLIB_INFRA, sizeof(struct pcep_versioning)); pceplib_malloc(PCEPLIB_INFRA, sizeof(struct pcep_versioning));

View File

@ -74,7 +74,6 @@ static const short DEFAULT_SRC_TCP_PORT = 4999;
// Private fn's // Private fn's
struct cmd_line_args *get_cmdline_args(int argc, char *argv[]); struct cmd_line_args *get_cmdline_args(int argc, char *argv[]);
void handle_signal_action(int sig_number); void handle_signal_action(int sig_number);
int setup_signals(void);
void send_pce_path_request_message(pcep_session *session); void send_pce_path_request_message(pcep_session *session);
void send_pce_report_message(pcep_session *session); void send_pce_report_message(pcep_session *session);
void print_queue_event(struct pcep_event *event); void print_queue_event(struct pcep_event *event);
@ -211,8 +210,7 @@ void handle_signal_action(int sig_number)
} }
} }
static int setup_signals(void)
int setup_signals()
{ {
struct sigaction sa; struct sigaction sa;
memset(&sa, 0, sizeof(sa)); memset(&sa, 0, sizeof(sa));

View File

@ -55,7 +55,7 @@ const char UNKNOWN_EVENT_STR[] = "UNKNOWN Event Type";
/* Session Logic Handle managed in pcep_session_logic.c */ /* Session Logic Handle managed in pcep_session_logic.c */
extern pcep_event_queue *session_logic_event_queue_; extern pcep_event_queue *session_logic_event_queue_;
bool initialize_pcc() bool initialize_pcc(void)
{ {
if (!run_session_logic()) { if (!run_session_logic()) {
pcep_log(LOG_ERR, "%s: Error initializing PCC session logic.", pcep_log(LOG_ERR, "%s: Error initializing PCC session logic.",
@ -85,13 +85,13 @@ bool initialize_pcc_infra(struct pceplib_infra_config *infra_config)
/* this function is blocking */ /* this function is blocking */
bool initialize_pcc_wait_for_completion() bool initialize_pcc_wait_for_completion(void)
{ {
return run_session_logic_wait_for_completion(); return run_session_logic_wait_for_completion();
} }
bool destroy_pcc() bool destroy_pcc(void)
{ {
if (!stop_session_logic()) { if (!stop_session_logic()) {
pcep_log(LOG_WARNING, "%s: Error stopping PCC session logic.", pcep_log(LOG_WARNING, "%s: Error stopping PCC session logic.",
@ -103,7 +103,7 @@ bool destroy_pcc()
} }
pcep_configuration *create_default_pcep_configuration() pcep_configuration *create_default_pcep_configuration(void)
{ {
pcep_configuration *config = pcep_configuration *config =
pceplib_malloc(PCEPLIB_INFRA, sizeof(pcep_configuration)); pceplib_malloc(PCEPLIB_INFRA, sizeof(pcep_configuration));
@ -226,7 +226,7 @@ void send_message(pcep_session *session, struct pcep_message *msg,
} }
/* Returns true if the queue is empty, false otherwise */ /* Returns true if the queue is empty, false otherwise */
bool event_queue_is_empty() bool event_queue_is_empty(void)
{ {
if (session_logic_event_queue_ == NULL) { if (session_logic_event_queue_ == NULL) {
pcep_log( pcep_log(
@ -246,7 +246,7 @@ bool event_queue_is_empty()
/* Return the number of events on the queue, 0 if empty */ /* Return the number of events on the queue, 0 if empty */
uint32_t event_queue_num_events_available() uint32_t event_queue_num_events_available(void)
{ {
if (session_logic_event_queue_ == NULL) { if (session_logic_event_queue_ == NULL) {
pcep_log( pcep_log(
@ -266,7 +266,7 @@ uint32_t event_queue_num_events_available()
/* Return the next event on the queue, NULL if empty */ /* Return the next event on the queue, NULL if empty */
struct pcep_event *event_queue_get_event() struct pcep_event *event_queue_get_event(void)
{ {
if (session_logic_event_queue_ == NULL) { if (session_logic_event_queue_ == NULL) {
pcep_log( pcep_log(

View File

@ -111,7 +111,7 @@ static bool run_session_logic_common(void)
} }
bool run_session_logic() bool run_session_logic(void)
{ {
if (!run_session_logic_common()) { if (!run_session_logic_common()) {
return false; return false;
@ -234,7 +234,7 @@ bool run_session_logic_with_infra(pceplib_infra_config *infra_config)
return true; return true;
} }
bool run_session_logic_wait_for_completion() bool run_session_logic_wait_for_completion(void)
{ {
if (!run_session_logic()) { if (!run_session_logic()) {
return false; return false;
@ -247,7 +247,7 @@ bool run_session_logic_wait_for_completion()
} }
bool stop_session_logic() bool stop_session_logic(void)
{ {
if (session_logic_handle_ == NULL) { if (session_logic_handle_ == NULL) {
pcep_log(LOG_WARNING, "%s: Session logic already stopped", pcep_log(LOG_WARNING, "%s: Session logic already stopped",

View File

@ -62,7 +62,7 @@ int socket_fd_node_compare(void *list_entry, void *new_entry)
} }
bool initialize_socket_comm_pre() bool initialize_socket_comm_pre(void)
{ {
socket_comm_handle_ = socket_comm_handle_ =
pceplib_malloc(PCEPLIB_INFRA, sizeof(pcep_socket_comm_handle)); pceplib_malloc(PCEPLIB_INFRA, sizeof(pcep_socket_comm_handle));
@ -129,7 +129,7 @@ bool initialize_socket_comm_external_infra(
return true; return true;
} }
bool initialize_socket_comm_loop() bool initialize_socket_comm_loop(void)
{ {
if (socket_comm_handle_ != NULL) { if (socket_comm_handle_ != NULL) {
/* already initialized */ /* already initialized */
@ -152,7 +152,7 @@ bool initialize_socket_comm_loop()
} }
bool destroy_socket_comm_loop() bool destroy_socket_comm_loop(void)
{ {
socket_comm_handle_->active = false; socket_comm_handle_->active = false;

View File

@ -197,7 +197,7 @@ void free_all_timers(pcep_timers_context *timers_context)
} }
bool teardown_timers() bool teardown_timers(void)
{ {
if (timers_context_ == NULL) { if (timers_context_ == NULL) {
pcep_log( pcep_log(
@ -252,7 +252,7 @@ bool teardown_timers()
} }
int get_next_timer_id() int get_next_timer_id(void)
{ {
if (timer_id_ == INT_MAX) { if (timer_id_ == INT_MAX) {
timer_id_ = 0; timer_id_ = 0;

View File

@ -31,7 +31,7 @@
#include "pcep_utils_logging.h" #include "pcep_utils_logging.h"
#include "pcep_utils_memory.h" #include "pcep_utils_memory.h"
double_linked_list *dll_initialize() double_linked_list *dll_initialize(void)
{ {
double_linked_list *handle = double_linked_list *handle =
pceplib_malloc(PCEPLIB_INFRA, sizeof(double_linked_list)); pceplib_malloc(PCEPLIB_INFRA, sizeof(double_linked_list));

View File

@ -45,7 +45,7 @@ void set_logging_level(int level)
logging_level_ = level; logging_level_ = level;
} }
int get_logging_level() int get_logging_level(void)
{ {
return logging_level_; return logging_level_;
} }

View File

@ -75,7 +75,7 @@ bool pceplib_memory_initialize(void *pceplib_infra_mt,
return true; return true;
} }
void pceplib_memory_reset() void pceplib_memory_reset(void)
{ {
pceplib_infra_mt.total_bytes_allocated = 0; pceplib_infra_mt.total_bytes_allocated = 0;
pceplib_infra_mt.num_allocates = 0; pceplib_infra_mt.num_allocates = 0;
@ -88,7 +88,7 @@ void pceplib_memory_reset()
pceplib_messages_mt.num_frees = 0; pceplib_messages_mt.num_frees = 0;
} }
void pceplib_memory_dump() void pceplib_memory_dump(void)
{ {
if (PCEPLIB_INFRA) { if (PCEPLIB_INFRA) {
pcep_log( pcep_log(

View File

@ -33,7 +33,7 @@
#include "pcep_utils_memory.h" #include "pcep_utils_memory.h"
#include "pcep_utils_queue.h" #include "pcep_utils_queue.h"
queue_handle *queue_initialize() queue_handle *queue_initialize(void)
{ {
/* Set the max_entries to 0 to disable it */ /* Set the max_entries to 0 to disable it */
return queue_initialize_with_size(0); return queue_initialize_with_size(0);

View File

@ -401,7 +401,7 @@ static int gm_config_write(struct vty *vty, int writes,
vty_out(vty, " ipv6 mld last-member-query-interval %d\n", vty_out(vty, " ipv6 mld last-member-query-interval %d\n",
pim_ifp->gm_specific_query_max_response_time_dsec); pim_ifp->gm_specific_query_max_response_time_dsec);
return 0; return writes;
} }
#endif #endif