summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-09-03 16:55:59 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-09-03 16:55:59 +0200
commit62b58a361fccec935d7940fb7ab86508ccdceb00 (patch)
treece2b86398f9f9b96aea8c5268ab2e1db15bf8148
parent82042e7d91732ec0710c55358d86baafe24c4756 (diff)
mausezahn: Fix non-ANSI function declarations
ANSI C doesn't allow empty parameter list, thus use void where appropriate. This fixes the corresponding sparse warning. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--staging/automops.c2
-rw-r--r--staging/cdp.c2
-rw-r--r--staging/cli.c4
-rw-r--r--staging/cli.h4
-rw-r--r--staging/dns.c2
-rw-r--r--staging/layer1.c2
-rw-r--r--staging/layer2.c6
-rw-r--r--staging/layer3.c2
-rw-r--r--staging/lookupdev.c2
-rw-r--r--staging/mausezahn.c2
-rw-r--r--staging/modifications.c2
-rw-r--r--staging/mops.c2
-rw-r--r--staging/mops.h6
-rw-r--r--staging/mops_sequence.c2
-rw-r--r--staging/mopsrx_arp.c2
-rw-r--r--staging/mz.h2
-rw-r--r--staging/rcv_rtp.c4
-rw-r--r--staging/rtp.c2
-rw-r--r--staging/send.c2
-rw-r--r--staging/syslog.c2
-rw-r--r--staging/time.c2
21 files changed, 27 insertions, 29 deletions
diff --git a/staging/automops.c b/staging/automops.c
index b465346..05fb7de 100644
--- a/staging/automops.c
+++ b/staging/automops.c
@@ -23,7 +23,7 @@
// Creates first element, aka "head" element
// This element can also be used! See automops_alloc_protocol!
//
-struct automops * automops_init()
+struct automops * automops_init(void)
{
// Create initial automops element:
struct automops *new_automops = (struct automops*) malloc(sizeof(struct automops));
diff --git a/staging/cdp.c b/staging/cdp.c
index d198d96..feabf9a 100644
--- a/staging/cdp.c
+++ b/staging/cdp.c
@@ -159,7 +159,7 @@ unsigned int create_tlv (u_int16_t type, // The 16-bit TYPE number
-int send_cdp ()
+int send_cdp(void)
{
libnet_t *l;
libnet_ptag_t t;
diff --git a/staging/cli.c b/staging/cli.c
index 3d39bd3..5b5a159 100644
--- a/staging/cli.c
+++ b/staging/cli.c
@@ -23,7 +23,7 @@
#include "mops.h"
#include "llist.h"
-void mz_cli_init()
+void mz_cli_init(void)
{
amp_head = automops_init();
@@ -183,7 +183,7 @@ int cli_read_cfg(char *str)
// ************************************************************************
-int cli()
+int cli(void)
{
struct sockaddr_in servaddr;
struct cli_command
diff --git a/staging/cli.h b/staging/cli.h
index bc2ab2c..1a0156f 100644
--- a/staging/cli.h
+++ b/staging/cli.h
@@ -79,10 +79,10 @@ int cli_debug;
///////////////////////////////////////////////////////////////////////////////
// Prototypes
-void mz_cli_init();
+void mz_cli_init(void);
int cli_read_cfg(char *str);
int mz_def16 (char *def, u_int16_t val, char *str256);
-int cli();
+int cli(void);
int debug_all (struct cli_def *cli, const char *command, char *argv[], int argc);
int debug_packet (struct cli_def *cli, const char *command, char *argv[], int argc);
diff --git a/staging/dns.c b/staging/dns.c
index 5f9203c..bfa61d8 100644
--- a/staging/dns.c
+++ b/staging/dns.c
@@ -96,7 +96,7 @@ int dns_get_answer (char* argval);
// Note: I do NOT use libnet here (had problems with bugs there...)
-int create_dns_packet ()
+int create_dns_packet(void)
{
char *token, *tokenptr, argval[MAX_PAYLOAD_SIZE];
diff --git a/staging/layer1.c b/staging/layer1.c
index f671bb5..a1ca417 100644
--- a/staging/layer1.c
+++ b/staging/layer1.c
@@ -30,7 +30,7 @@
#include "mz.h"
#include "cli.h"
-int send_eth()
+int send_eth(void)
{
// Tasks:
// 1. Check 'eth_src_txt' and 'eth_dst_txt' which contain either a MAC address or a keyword
diff --git a/staging/layer2.c b/staging/layer2.c
index ebbc7d8..3a48820 100644
--- a/staging/layer2.c
+++ b/staging/layer2.c
@@ -109,7 +109,7 @@
// senderip is the spoofed IP,
// targetmac and targetip identifies the receiver.
//
-int send_arp ()
+int send_arp(void)
{
libnet_t *l;
libnet_ptag_t t;
@@ -410,9 +410,7 @@ int send_arp ()
//
// defaults:
// mz assumes you want to become root bridge! (rid=bid)
-//
-int send_bpdu ()
-{
+int send_bpdu(void) {
// BPDU parameters:
u_int16_t
diff --git a/staging/layer3.c b/staging/layer3.c
index d05aa3c..3eca55d 100644
--- a/staging/layer3.c
+++ b/staging/layer3.c
@@ -104,7 +104,7 @@
// Only used to simplify initialization of libnet
// Return pointer to context
-libnet_t* get_link_context()
+libnet_t* get_link_context(void)
{
libnet_t * l;
char errbuf[LIBNET_ERRBUF_SIZE];
diff --git a/staging/lookupdev.c b/staging/lookupdev.c
index dfca239..7226941 100644
--- a/staging/lookupdev.c
+++ b/staging/lookupdev.c
@@ -38,7 +38,7 @@
// 0 if usable device found (device_list[] and tx.device set)
// 1 if no usable device found
//
-int lookupdev()
+int lookupdev(void)
{
// char *tx.device is global, see as.h
diff --git a/staging/mausezahn.c b/staging/mausezahn.c
index 6edef71..f5b470f 100644
--- a/staging/mausezahn.c
+++ b/staging/mausezahn.c
@@ -185,7 +185,7 @@ static void version(void)
die();
}
-int reset()
+int reset(void)
{
int i;
time_t t;
diff --git a/staging/modifications.c b/staging/modifications.c
index 08e9fb0..e11ba0e 100644
--- a/staging/modifications.c
+++ b/staging/modifications.c
@@ -610,7 +610,7 @@ int update_TCP_SQNR(libnet_t *l, libnet_ptag_t t)
//
//
-int print_frame_details()
+int print_frame_details(void)
{
unsigned char *dum1, *dum2;
char pld[65535];
diff --git a/staging/mops.c b/staging/mops.c
index f56deff..599d317 100644
--- a/staging/mops.c
+++ b/staging/mops.c
@@ -52,7 +52,7 @@
// Creates first element, aka "head" element
// This element can also be used! See mops_alloc_packet!
//
-struct mops * mops_init()
+struct mops * mops_init(void)
{
// these defaults can be changed by the user:
min_frame_s = MIN_MOPS_FRAME_SIZE; // important global; depends on used packet tx subsystem such as libnet
diff --git a/staging/mops.h b/staging/mops.h
index fd9884c..96953e6 100644
--- a/staging/mops.h
+++ b/staging/mops.h
@@ -719,7 +719,7 @@ void mops_flags (u_int8_t *target, u_int8_t *flag, int shift);
u_int16_t mops_sum16 (u_int16_t len, u_int8_t buff[]);
-struct mops * mops_init ();
+struct mops * mops_init(void);
struct mops * mops_alloc_packet (struct mops *cur);
struct mops * mops_delete_packet (struct mops *cur);
int mops_reset_packet(struct mops *cur);
@@ -927,7 +927,7 @@ int mops_lldp_opt_tlv_end (struct mops *mp) ;
// ARP Service: Resolves MAC address of given IP address and interface
int service_arp(char *dev, u_int8_t *ip, u_int8_t *mac);
-int mops_rx_arp ();
+int mops_rx_arp(void);
void *rx_arp (void *arg);
void got_arp_packet (u_char *args, const struct pcap_pkthdr *header, const u_char *packet);
@@ -939,7 +939,7 @@ int mops_direct(char* dev, int mops_type, char* argstring);
//////////////////// automops prototypes: //////////////////////////////////
-struct automops * automops_init();
+struct automops * automops_init(void);
struct automops * automops_alloc_protocol();
struct automops * automops_delete_protocol();
struct automops * automops_search_protocol();
diff --git a/staging/mops_sequence.c b/staging/mops_sequence.c
index 32e7895..900472c 100644
--- a/staging/mops_sequence.c
+++ b/staging/mops_sequence.c
@@ -286,7 +286,7 @@ int stop_sequence (char *name)
//
// RETURN VALUE: Number of stopped sequences.
//
-int stop_all_sequences ()
+int stop_all_sequences(void)
{
struct mz_ll *cur=packet_sequences->next;
int i=0;
diff --git a/staging/mopsrx_arp.c b/staging/mopsrx_arp.c
index 0aac152..baf8133 100644
--- a/staging/mopsrx_arp.c
+++ b/staging/mopsrx_arp.c
@@ -26,7 +26,7 @@
// RETURN VALUE: 0 upon success,
// 1 upon error.
//
-int mops_rx_arp ()
+int mops_rx_arp(void)
{
int i;
diff --git a/staging/mz.h b/staging/mz.h
index d9ac716..ade4da3 100644
--- a/staging/mz.h
+++ b/staging/mz.h
@@ -521,7 +521,7 @@ int char2bits (char c, char *str);
int mz_strcmp(char* usr, char* str, int min);
int mz_tok(char * str, char * delim, int anz, ...);
int delay_parse (struct timespec *t, char *a, char *b);
-int reset();
+int reset(void);
// ************************************
//
diff --git a/staging/rcv_rtp.c b/staging/rcv_rtp.c
index 336a6e0..0a91155 100644
--- a/staging/rcv_rtp.c
+++ b/staging/rcv_rtp.c
@@ -40,7 +40,7 @@
#include "mops.h"
// Initialize the rcv_rtp process: Read user parameters and initialize globals
-int rcv_rtp_init()
+int rcv_rtp_init(void)
{
char argval[MAX_PAYLOAD_SIZE];
char dummy[512];
@@ -281,7 +281,7 @@ int rcv_rtp_init()
////////////////////////////////////////////////////////////////////////////////////////////
//
// Defines the pcap handler and the callback function
-int rcv_rtp()
+int rcv_rtp(void)
{
char errbuf[PCAP_ERRBUF_SIZE];
diff --git a/staging/rtp.c b/staging/rtp.c
index 6ce4458..54a195e 100644
--- a/staging/rtp.c
+++ b/staging/rtp.c
@@ -57,7 +57,7 @@
-int create_rtp_packet()
+int create_rtp_packet(void)
{
u_int8_t byte1, byte2;
u_int16_t seqnr;
diff --git a/staging/send.c b/staging/send.c
index 5ad1a20..ef76512 100644
--- a/staging/send.c
+++ b/staging/send.c
@@ -37,7 +37,7 @@
// Calculates the number of frames to be sent.
// Should be used as standard output except the
// 'quiet' option (-q) has been specified.
-int complexity()
+int complexity(void)
{
unsigned long int
nr_sqnr = 1,
diff --git a/staging/syslog.c b/staging/syslog.c
index c8fac9b..558ac04 100644
--- a/staging/syslog.c
+++ b/staging/syslog.c
@@ -71,7 +71,7 @@
//
-int create_syslog_packet()
+int create_syslog_packet(void)
{
unsigned int pri, sev, fac, day, curday, mon, curmon;
char lt[8], host[314];
diff --git a/staging/time.c b/staging/time.c
index 4225b9e..5ad3658 100644
--- a/staging/time.c
+++ b/staging/time.c
@@ -24,7 +24,7 @@
// Additionally, measure the precision.
// This function should be called upon program start.
//
-int check_timer()
+int check_timer(void)
{
struct timespec res;
int r;