projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1856 from rubenk/snmp-dont-dispatch-values-with-empty-type-instance
[collectd.git]
/
src
/
madwifi.c
diff --git
a/src/madwifi.c
b/src/madwifi.c
index
ffc815d
..
728fcd8
100644
(file)
--- a/
src/madwifi.c
+++ b/
src/madwifi.c
@@
-89,6
+89,7
@@
#include "collectd.h"
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "configfile.h"
#include "common.h"
#include "plugin.h"
#include "configfile.h"
@@
-394,8
+395,7
@@
static inline void watchlist_remove (uint32_t *wl, int item)
static inline void watchlist_set (uint32_t *wl, uint32_t val)
{
static inline void watchlist_set (uint32_t *wl, uint32_t val)
{
- int i;
- for (i = 0; i < WL_LEN; i++)
+ for (int i = 0; i < WL_LEN; i++)
wl[i] = val;
}
wl[i] = val;
}
@@
-403,9
+403,8
@@
static inline void watchlist_set (uint32_t *wl, uint32_t val)
static int watchitem_find (const char *name)
{
int max = STATIC_ARRAY_SIZE (specs);
static int watchitem_find (const char *name)
{
int max = STATIC_ARRAY_SIZE (specs);
- int i;
- for (i = 0; i < max; i++)
+ for (i
nt i
= 0; i < max; i++)
if (strcasecmp (name, specs[i].name) == 0)
return i;
if (strcasecmp (name, specs[i].name) == 0)
return i;
@@
-420,15
+419,14
@@
static int watchitem_find (const char *name)
static int madwifi_real_init (void)
{
size_t max = STATIC_ARRAY_SIZE (specs);
static int madwifi_real_init (void)
{
size_t max = STATIC_ARRAY_SIZE (specs);
- size_t i;
- for (i = 0; i < STATIC_ARRAY_SIZE (bounds); i++)
+ for (
size_t
i = 0; i < STATIC_ARRAY_SIZE (bounds); i++)
bounds[i] = 0;
watchlist_set(watch_items, 0);
watchlist_set(misc_items, 0);
bounds[i] = 0;
watchlist_set(watch_items, 0);
watchlist_set(misc_items, 0);
- for (i = 0; i < max; i++)
+ for (
size_t
i = 0; i < max; i++)
{
bounds[specs[i].flags & SRC_MASK] = i;
{
bounds[specs[i].flags & SRC_MASK] = i;
@@
-439,7
+437,7
@@
static int madwifi_real_init (void)
misc_items[i / 32] |= FLAG (i);
}
misc_items[i / 32] |= FLAG (i);
}
- for (i = 0; i < STATIC_ARRAY_SIZE (bounds); i++)
+ for (
size_t
i = 0; i < STATIC_ARRAY_SIZE (bounds); i++)
bounds[i]++;
return (0);
bounds[i]++;
return (0);
@@
-589,9
+587,8
@@
static void submit_antx (const char *dev, const char *name,
u_int32_t *vals, int vals_num)
{
char ti2[16];
u_int32_t *vals, int vals_num)
{
char ti2[16];
- int i;
- for (i = 0; i < vals_num; i++)
+ for (i
nt i
= 0; i < vals_num; i++)
{
if (vals[i] == 0)
continue;
{
if (vals[i] == 0)
continue;
@@
-614,12
+611,11
@@
process_stat_struct (int which, const void *ptr, const char *dev, const char *ma
const char *type_name, const char *misc_name)
{
uint32_t misc = 0;
const char *type_name, const char *misc_name)
{
uint32_t misc = 0;
- int i;
assert (which >= 1);
assert (((size_t) which) < STATIC_ARRAY_SIZE (bounds));
assert (which >= 1);
assert (((size_t) which) < STATIC_ARRAY_SIZE (bounds));
- for (i = bounds[which - 1]; i < bounds[which]; i++)
+ for (i
nt i
= bounds[which - 1]; i < bounds[which]; i++)
{
uint32_t val = *(uint32_t *)(((char *) ptr) + specs[i].offset) ;
{
uint32_t val = *(uint32_t *)(((char *) ptr) + specs[i].offset) ;
@@
-751,7
+747,7
@@
process_station (int sk, const char *dev, struct ieee80211req_sta_info *si)
static int
process_stations (int sk, const char *dev)
{
static int
process_stations (int sk, const char *dev)
{
- uint8_t buf[24*1024];
+ uint8_t buf[24*1024]
= { 0 }
;
uint8_t *cp;
int nodes;
size_t len;
uint8_t *cp;
int nodes;
size_t len;