X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fted.c;h=96c94e5d3f64d0bbb854dd83df7640ec49424f22;hb=44a3b66cc3486489c8a5c30f54a168f0db0929f6;hp=28ee8e485ecfc3165f075a33f706bb5eb5b251a5;hpb=4103105fb43cd72294f165b2541540b3a8a99532;p=collectd.git diff --git a/src/ted.c b/src/ted.c index 28ee8e48..96c94e5d 100644 --- a/src/ted.c +++ b/src/ted.c @@ -108,7 +108,6 @@ static int ted_read_value(double *ret_power, double *ret_voltage) 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); @@ -165,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; - 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) @@ -312,7 +311,6 @@ static int ted_read (void) double power; double voltage; int status; - int i; status = ted_open_device (); if (status != 0) @@ -320,7 +318,7 @@ static int ted_read (void) power = NAN; voltage = NAN; - for (i = 0; i <= conf_retries; i++) + for (int i = 0; i <= conf_retries; i++) { status = ted_read_value (&power, &voltage); if (status == 0)