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 #1842 from rubenk/declare-loop-variable-in-for-loop-controlling...
[collectd.git]
/
src
/
ted.c
diff --git
a/src/ted.c
b/src/ted.c
index
282212b
..
96c94e5
100644
(file)
--- a/
src/ted.c
+++ b/
src/ted.c
@@
-35,6
+35,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"
@@
-107,7
+108,6
@@
static int ted_read_value(double *ret_power, double *ret_voltage)
while (end_flag == 0)
{
ssize_t receive_buffer_length;
while (end_flag == 0)
{
ssize_t receive_buffer_length;
- ssize_t i;
/* check for timeout or input error*/
status = select (fd + 1, &input, NULL, NULL, &timeout);
/* check for timeout or input error*/
status = select (fd + 1, &input, NULL, NULL, &timeout);
@@
-164,7
+164,7
@@
static int ted_read_value(double *ret_power, double *ret_voltage)
* the beginning of the package has been found. */
escape_flag = 0;
* the beginning of the package has been found. */
escape_flag = 0;
- for (i = 0; i < receive_buffer_length; i++)
+ for (
ssize_t
i = 0; i < receive_buffer_length; i++)
{
/* Check if previous byte was the escape byte. */
if (escape_flag == 1)
{
/* Check if previous byte was the escape byte. */
if (escape_flag == 1)
@@
-311,7
+311,6
@@
static int ted_read (void)
double power;
double voltage;
int status;
double power;
double voltage;
int status;
- int i;
status = ted_open_device ();
if (status != 0)
status = ted_open_device ();
if (status != 0)
@@
-319,7
+318,7
@@
static int ted_read (void)
power = NAN;
voltage = NAN;
power = NAN;
voltage = NAN;
- for (i = 0; i <= conf_retries; i++)
+ for (i
nt i
= 0; i <= conf_retries; i++)
{
status = ted_read_value (&power, &voltage);
if (status == 0)
{
status = ted_read_value (&power, &voltage);
if (status == 0)