Change calls to rint into lrint avoiding conversion warnings
Using gcc option "-Wfloat-conversion" is useful to catch potential conversion errors (where lrint should be used). rint returns double and still raises the same warning, this is why this change updates all rint calls to lrint. In few places, where input type is a float, corresponding lrinf is used. Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
This commit is contained in:
@@ -183,7 +183,7 @@ static int calculate_otu(struct dive *dive)
|
||||
if (po2 >= 500)
|
||||
otu += pow((po2 - 500) / 1000.0, 0.83) * t / 30.0;
|
||||
}
|
||||
return rint(otu);
|
||||
return lrint(otu);
|
||||
}
|
||||
/* calculate CNS for a dive - this only takes the first divecomputer into account */
|
||||
int const cns_table[][3] = {
|
||||
|
||||
Reference in New Issue
Block a user