summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpf.h5
-rw-r--r--csum.h3
-rw-r--r--trafgen_lexer.l3
-rw-r--r--trafgen_parser.y4
4 files changed, 8 insertions, 7 deletions
diff --git a/bpf.h b/bpf.h
index 07631d6..942f54e 100644
--- a/bpf.h
+++ b/bpf.h
@@ -26,8 +26,9 @@ extern void bpf_parse_rules(char *rulefile, struct sock_fprog *bpf, uint32_t lin
extern void bpf_try_compile(const char *rulefile, struct sock_fprog *bpf,
uint32_t link_type);
#else
-static inline void bpf_try_compile(const char *rulefile, struct sock_fprog *bpf,
- uint32_t link_type)
+static inline void bpf_try_compile(const char *rulefile,
+ struct sock_fprog *bpf __maybe_unused,
+ uint32_t link_type __maybe_unused)
{
panic("Cannot open file %s!\n", rulefile);
}
diff --git a/csum.h b/csum.h
index 212faae..fceef2c 100644
--- a/csum.h
+++ b/csum.h
@@ -24,7 +24,8 @@ static inline unsigned short csum(unsigned short *buf, int nwords)
return ~sum;
}
-static inline uint16_t calc_csum(void *addr, size_t len, int ccsum)
+static inline uint16_t calc_csum(void *addr, size_t len,
+ int ccsum __maybe_unused)
{
return csum(addr, len >> 1);
}
diff --git a/trafgen_lexer.l b/trafgen_lexer.l
index 146d0e7..a361bfc 100644
--- a/trafgen_lexer.l
+++ b/trafgen_lexer.l
@@ -24,10 +24,9 @@ extern void yyerror(const char *);
static char *try_convert_shellcode(char *sstr)
{
- int j = 0;
bool found_any = false;
char *bstr, *ostr = sstr, *hay, *orig = sstr;
- size_t blen, slen = strlen(sstr), tot = 0;
+ size_t j = 0, blen, slen = strlen(sstr), tot = 0;
const char *needle = "\\x";
sstr++;
diff --git a/trafgen_parser.y b/trafgen_parser.y
index 8b8f3e6..1112f8a 100644
--- a/trafgen_parser.y
+++ b/trafgen_parser.y
@@ -153,7 +153,7 @@ static void set_byte(uint8_t val)
static void set_multi_byte(uint8_t *s, size_t len)
{
- int i;
+ size_t i;
for (i = 0; i < len; ++i)
set_byte(s[i]);
@@ -187,7 +187,7 @@ static void __set_csum16_dynamic(size_t from, size_t to, enum csum which)
__setup_new_csum16(&pktd->csum[packetds_last], from, to, which);
}
-static void __set_csum16_static(size_t from, size_t to, enum csum which)
+static void __set_csum16_static(size_t from, size_t to, enum csum which __maybe_unused)
{
struct packet *pkt = &packets[packet_last];
uint16_t sum;