diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-05-24 13:22:35 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-05-24 13:22:35 +0200 |
commit | 97d26b9ee4bffda96e74fd1379cdddd47adbaf49 (patch) | |
tree | 40bda8423baadbcb89b8f7c47acd6445dfdcc92e | |
parent | a168c8c7b8d6f884775815ba45868689fe43774e (diff) |
misc: fix some minor compile warnings all over
Some regarding unused parameter, some regarding signed/unsigned
comparison.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
-rw-r--r-- | bpf.h | 5 | ||||
-rw-r--r-- | csum.h | 3 | ||||
-rw-r--r-- | trafgen_lexer.l | 3 | ||||
-rw-r--r-- | trafgen_parser.y | 4 |
4 files changed, 8 insertions, 7 deletions
@@ -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); } @@ -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; |