add -Wall -Wextra, fix some errors

pull/82/head
David Schweikert 10 years ago
parent 2f4781214b
commit 07e719d8db

@ -1,3 +1,5 @@
AM_CFLAGS = -Wall -Wextra
prog = prog =
if IPV4 if IPV4

@ -331,7 +331,7 @@ void print_per_system_splits( void );
void print_global_stats( void ); void print_global_stats( void );
void main_loop(); void main_loop();
void finish(); void finish();
int handle_random_icmp( FPING_ICMPHDR *p, int psize, struct sockaddr *addr, socklen_t addr_len); int handle_random_icmp( FPING_ICMPHDR *p, struct sockaddr *addr, socklen_t addr_len);
char *sprint_tm( int t ); char *sprint_tm( int t );
void ev_enqueue(HOST_ENTRY *h); void ev_enqueue(HOST_ENTRY *h);
HOST_ENTRY *ev_dequeue(); HOST_ENTRY *ev_dequeue();
@ -1525,7 +1525,7 @@ int wait_for_reply(long wait_time)
#endif #endif
{ {
/* handle some problem */ /* handle some problem */
if( handle_random_icmp( icp, result, (struct sockaddr *)&response_addr, response_addr_len ) ) if( handle_random_icmp( icp, (struct sockaddr *)&response_addr, response_addr_len ) )
num_othericmprcvd++; num_othericmprcvd++;
return 1; return 1;
}/* IF */ }/* IF */
@ -1691,7 +1691,7 @@ int wait_for_reply(long wait_time)
************************************************************/ ************************************************************/
int handle_random_icmp(FPING_ICMPHDR *p, int psize, struct sockaddr *addr, socklen_t addr_len) int handle_random_icmp(FPING_ICMPHDR *p, struct sockaddr *addr, socklen_t addr_len)
{ {
FPING_ICMPHDR *sent_icmp; FPING_ICMPHDR *sent_icmp;
unsigned char *c; unsigned char *c;
@ -1743,7 +1743,7 @@ int handle_random_icmp(FPING_ICMPHDR *p, int psize, struct sockaddr *addr, sockl
print_warning("%s from %s for ICMP Echo sent to %s", icmp_code, addr_ascii, h->host); print_warning("%s from %s for ICMP Echo sent to %s", icmp_code, addr_ascii, h->host);
} }
if( inet_addr( h->host ) == -1 ) if( inet_addr( h->host ) == INADDR_NONE )
print_warning(" (%s)", addr_ascii); print_warning(" (%s)", addr_ascii);
print_warning("\n" ); print_warning("\n" );
@ -1771,7 +1771,7 @@ int handle_random_icmp(FPING_ICMPHDR *p, int psize, struct sockaddr *addr, sockl
icmp_type, addr_ascii, h->host ); icmp_type, addr_ascii, h->host );
} }
if( inet_addr( h->host ) == -1 ) if( inet_addr( h->host ) == INADDR_NONE )
fprintf( stderr, " (%s)", addr_ascii ); fprintf( stderr, " (%s)", addr_ascii );
fprintf( stderr, "\n" ); fprintf( stderr, "\n" );

@ -53,15 +53,12 @@
static SEQMAP_VALUE *seqmap_map = NULL; static SEQMAP_VALUE *seqmap_map = NULL;
static unsigned int seqmap_next_id = 0; static unsigned int seqmap_next_id = 0;
static SEQMAP_VALUE *seqmap_free_list;
#define SEQMAP_TIMEOUT_IN_S 10 #define SEQMAP_TIMEOUT_IN_S 10
#define SEQMAP_UNASSIGNED_HOST_NR UINT_MAX #define SEQMAP_UNASSIGNED_HOST_NR UINT_MAX
void seqmap_init() void seqmap_init()
{ {
unsigned int i;
seqmap_map = calloc(SEQMAP_MAXSEQ, sizeof(SEQMAP_VALUE)); seqmap_map = calloc(SEQMAP_MAXSEQ, sizeof(SEQMAP_VALUE));
if(seqmap_map == NULL) { if(seqmap_map == NULL) {
perror("malloc error (can't allocate seqmap_map)"); perror("malloc error (can't allocate seqmap_map)");

@ -48,7 +48,6 @@ size_t ping_pkt_size;
int open_ping_socket_ipv6(size_t ping_data_size) int open_ping_socket_ipv6(size_t ping_data_size)
{ {
struct protoent *proto; struct protoent *proto;
int opton = 1;
int s; int s;
/* confirm that ICMP is available on this machine */ /* confirm that ICMP is available on this machine */

Loading…
Cancel
Save