projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
collectd.spec: add gps plugin
[collectd.git]
/
src
/
barometer.c
diff --git
a/src/barometer.c
b/src/barometer.c
index
0e8deaf
..
fba3450
100644
(file)
--- a/
src/barometer.c
+++ b/
src/barometer.c
@@
-20,6
+20,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "utils_cache.h"
#include "plugin.h"
#include "common.h"
#include "utils_cache.h"
#include "plugin.h"
@@
-343,9
+344,9
@@
static temperature_list_t * temp_list = NULL;
*/
static int temp_list_add(temperature_list_t * list, const char * sensor)
{
*/
static int temp_list_add(temperature_list_t * list, const char * sensor)
{
- temperature_list_t *
new_temp;
+ temperature_list_t *new_temp;
- new_temp =
(temperature_list_t *) malloc(sizeof
(*new_temp));
+ new_temp =
malloc(sizeof
(*new_temp));
if(new_temp == NULL)
return -1;
if(new_temp == NULL)
return -1;
@@
-407,7
+408,6
@@
static int get_reference_temperature(double * result)
gauge_t * values = NULL; /**< rate values */
size_t values_num = 0; /**< number of rate values */
gauge_t * values = NULL; /**< rate values */
size_t values_num = 0; /**< number of rate values */
- size_t i;
gauge_t values_history[REF_TEMP_AVG_NUM];
gauge_t values_history[REF_TEMP_AVG_NUM];
@@
-445,7
+445,7
@@
static int get_reference_temperature(double * result)
list->initialized = 1;
list->num_values = values_num;
list->initialized = 1;
list->num_values = values_num;
- for(i=0; i<values_num; ++i)
+ for(
size_t
i=0; i<values_num; ++i)
{
DEBUG ("barometer: get_reference_temperature - rate %zu: %lf **",
i, values[i]);
{
DEBUG ("barometer: get_reference_temperature - rate %zu: %lf **",
i, values[i]);
@@
-474,7
+474,7
@@
static int get_reference_temperature(double * result)
continue;
}
continue;
}
- for(i=0; i<REF_TEMP_AVG_NUM*list->num_values; ++i)
+ for(
size_t
i=0; i<REF_TEMP_AVG_NUM*list->num_values; ++i)
{
DEBUG ("barometer: get_reference_temperature - history %zu: %lf",
i, values_history[i]);
{
DEBUG ("barometer: get_reference_temperature - history %zu: %lf",
i, values_history[i]);
@@
-499,7
+499,7
@@
static int get_reference_temperature(double * result)
continue;
}
continue;
}
- for(i=0; i<values_num; ++i)
+ for(
size_t
i=0; i<values_num; ++i)
{
DEBUG ("barometer: get_reference_temperature - rate last %zu: %lf **",
i, values[i]);
{
DEBUG ("barometer: get_reference_temperature - rate last %zu: %lf **",
i, values[i]);
@@
-1580,8
+1580,7
@@
static int MPL115_collectd_barometer_read (void)
already available. */
if(!avg_initialized)
{
already available. */
if(!avg_initialized)
{
- int i;
- for(i=0; i<config_oversample-1; ++i)
+ for(int i=0; i<config_oversample-1; ++i)
{
result = MPL115_read_averaged(&pressure, &temperature);
if(result)
{
result = MPL115_read_averaged(&pressure, &temperature);
if(result)