X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmadwifi.c;h=bb33b15d2c7818fe6cd3b623fd3fece4d1f47814;hb=089eb4f23a447427172601125bc65116b5f0a661;hp=13301fffe15aea8afbce76c3ce06105ededfa195;hpb=26fbc23e518dcc74502ae3b2495112adc3840879;p=collectd.git diff --git a/src/madwifi.c b/src/madwifi.c index 13301fff..bb33b15d 100644 --- a/src/madwifi.c +++ b/src/madwifi.c @@ -96,7 +96,6 @@ #include #include -#include #if !KERNEL_LINUX # error "No applicable input method." @@ -368,14 +367,14 @@ static int init_state = 0; static inline int item_watched(int i) { assert (i >= 0); - assert (i < ((STATIC_ARRAY_SIZE (watch_items) + 1) * 32)); + assert (((size_t) i) < ((STATIC_ARRAY_SIZE (watch_items) + 1) * 32)); return watch_items[i / 32] & FLAG (i); } static inline int item_summed(int i) { assert (i >= 0); - assert (i < ((STATIC_ARRAY_SIZE (misc_items) + 1) * 32)); + assert (((size_t) i) < ((STATIC_ARRAY_SIZE (misc_items) + 1) * 32)); return misc_items[i / 32] & FLAG (i); } @@ -420,8 +419,8 @@ static int watchitem_find (const char *name) static int madwifi_real_init (void) { - int max = STATIC_ARRAY_SIZE (specs); - int i; + size_t max = STATIC_ARRAY_SIZE (specs); + size_t i; for (i = 0; i < STATIC_ARRAY_SIZE (bounds); i++) bounds[i] = 0; @@ -618,7 +617,7 @@ process_stat_struct (int which, const void *ptr, const char *dev, const char *ma int i; assert (which >= 1); - assert (which < STATIC_ARRAY_SIZE (bounds)); + assert (((size_t) which) < STATIC_ARRAY_SIZE (bounds)); for (i = bounds[which - 1]; i < bounds[which]; i++) { @@ -754,7 +753,8 @@ process_stations (int sk, const char *dev) uint8_t buf[24*1024]; struct iwreq iwr; uint8_t *cp; - int len, nodes; + int nodes; + size_t len; int status; memset (&iwr, 0, sizeof (iwr));