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 #1454 from rubenk/libi2c-dev-mark-as-linux-only
[collectd.git]
/
src
/
barometer.c
diff --git
a/src/barometer.c
b/src/barometer.c
index
ee200b6
..
c5e7f77
100644
(file)
--- a/
src/barometer.c
+++ b/
src/barometer.c
@@
-255,7
+255,7
@@
static averaging_t temperature_averaging = { NULL, 0, 0L, 0 };
*/
static int averaging_create(averaging_t *avg, int size)
{
*/
static int averaging_create(averaging_t *avg, int size)
{
- avg->ring_buffer = calloc ((size_t) size, sizeof (*avg));
+ avg->ring_buffer = calloc ((size_t) size, sizeof (*avg
->ring_buffer
));
if (avg->ring_buffer == NULL)
{
ERROR ("barometer: averaging_create - ring buffer allocation of size %d failed",
if (avg->ring_buffer == NULL)
{
ERROR ("barometer: averaging_create - ring buffer allocation of size %d failed",
@@
-407,7
+407,7
@@
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 */
-
in
t i;
+
size_
t i;
gauge_t values_history[REF_TEMP_AVG_NUM];
gauge_t values_history[REF_TEMP_AVG_NUM];
@@
-447,9
+447,8
@@
static int get_reference_temperature(double * result)
for(i=0; i<values_num; ++i)
{
for(i=0; i<values_num; ++i)
{
- DEBUG ("barometer: get_reference_temperature - rate %d: %lf **",
- i,
- values[i]);
+ DEBUG ("barometer: get_reference_temperature - rate %zu: %lf **",
+ i, values[i]);
if(!isnan(values[i]))
{
avg_sum += values[i];
if(!isnan(values[i]))
{
avg_sum += values[i];
@@
-477,9
+476,8
@@
static int get_reference_temperature(double * result)
for(i=0; i<REF_TEMP_AVG_NUM*list->num_values; ++i)
{
for(i=0; i<REF_TEMP_AVG_NUM*list->num_values; ++i)
{
- DEBUG ("barometer: get_reference_temperature - history %d: %lf",
- i,
- values_history[i]);
+ DEBUG ("barometer: get_reference_temperature - history %zu: %lf",
+ i, values_history[i]);
if(!isnan(values_history[i]))
{
avg_sum += values_history[i];
if(!isnan(values_history[i]))
{
avg_sum += values_history[i];
@@
-503,9
+501,8
@@
static int get_reference_temperature(double * result)
for(i=0; i<values_num; ++i)
{
for(i=0; i<values_num; ++i)
{
- DEBUG ("barometer: get_reference_temperature - rate last %d: %lf **",
- i,
- values[i]);
+ DEBUG ("barometer: get_reference_temperature - rate last %zu: %lf **",
+ i, values[i]);
if(!isnan(values[i]))
{
avg_sum += values[i];
if(!isnan(values[i]))
{
avg_sum += values[i];