style: add __unused attribute macro
This commit is contained in:
parent
0dc1e09205
commit
9836774466
3 changed files with 6 additions and 9 deletions
|
|
@ -5,6 +5,8 @@
|
|||
#include <stddef.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include "compiler.h"
|
||||
|
||||
typedef struct s_ping_config
|
||||
{
|
||||
/* Targets */
|
||||
|
|
|
|||
|
|
@ -11,13 +11,10 @@ static const char *error_msg_for(const icmp_reply_t *reply);
|
|||
|
||||
void
|
||||
ping_output_error(const icmp_reply_t *reply,
|
||||
const icmp_offending_packet_t *offending,
|
||||
uint16_t seq, const t_ping_config *config)
|
||||
__unused const icmp_offending_packet_t *offending,
|
||||
uint16_t seq, __unused const t_ping_config *config)
|
||||
{
|
||||
char from_str[INET_ADDRSTRLEN];
|
||||
|
||||
(void)offending;
|
||||
(void)config;
|
||||
inet_ntop(AF_INET, &reply->from, from_str, sizeof(from_str));
|
||||
fprintf(stderr, "From %s: icmp_seq=%u %s\n",
|
||||
from_str, (unsigned int)seq, error_msg_for(reply));
|
||||
|
|
|
|||
|
|
@ -45,17 +45,15 @@ ping_scheduler_select_tv(const t_ping_config *config, struct timeval *tv)
|
|||
}
|
||||
|
||||
static void
|
||||
sigalrm_handler(int sig)
|
||||
sigalrm_handler(__unused int sig)
|
||||
{
|
||||
(void)sig;
|
||||
if (NULL != g_state)
|
||||
g_state->send_flag = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
sigint_handler(int sig)
|
||||
sigint_handler(__unused int sig)
|
||||
{
|
||||
(void)sig;
|
||||
if (NULL != g_state)
|
||||
g_state->stop_flag = 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue