Centralization for Kelvin and Standardization to milliKelvin

This centralizes all occurrences of Kelvin to dive.h and standardizes all
usages to milliKelvin.

[Dirk Hohndel: renamed the constant plus minor white space cleanup]

Signed-off-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Jan Schubert 2013-01-24 23:09:53 +01:00 committed by Dirk Hohndel
parent 67d8891af5
commit 50d0391dfb
5 changed files with 15 additions and 14 deletions

View file

@ -348,7 +348,7 @@ static void temperature(char *buffer, void *_temperature)
temperature->mkelvin = val.fp * 1000;
break;
case CELSIUS:
temperature->mkelvin = (val.fp + 273.15) * 1000 + 0.5;
temperature->mkelvin = val.fp * 1000 + ZERO_C_IN_MKELVIN + 0.5;
break;
case FAHRENHEIT:
temperature->mkelvin = (val.fp + 459.67) * 5000/9;