diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2021-11-12 13:48:44 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2021-11-12 14:06:11 +0000 |
commit | 92cc7c20f3d4e2812a3df3daa8becc9ff6ad8101 (patch) | |
tree | c0b853d829917d8ca4ae5ab7ac4cc97a498f4e78 /libgweather | |
parent | 1c140fc8ce08260d5008847945bf345654ad7fa8 (diff) | |
download | libgweather-92cc7c20f3d4e2812a3df3daa8becc9ff6ad8101.tar.gz |
Remove unused assignment
The `esat` variable is only ever used in one branch when calculating the
dew point.
Diffstat (limited to 'libgweather')
-rw-r--r-- | libgweather/gweather-weather.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c index 3135866..6531d21 100644 --- a/libgweather/gweather-weather.c +++ b/libgweather/gweather-weather.c @@ -411,29 +411,32 @@ free_forecast_list (GWeatherInfo *info) /* Relative humidity computation - thanks to <Olof.Oberg@modopaper.modogroup.com> calc_dew is simply the inverse of calc_humidity */ -static inline gdouble -calc_dew (gdouble temp, gdouble humidity) +static inline double +calc_dew (double temp, + double humidity) { - gdouble esat, esurf, tmp; + double esurf; if (temp > -500.0 && humidity > -1.0) { temp = TEMP_F_TO_C (temp); - esat = 6.11 * pow (10.0, (7.5 * temp) / (237.7 + temp)); + double esat = 6.11 * pow (10.0, (7.5 * temp) / (237.7 + temp)); + esurf = (humidity / 100) * esat; } else { esurf = -1.0; - esat = 1.0; } - tmp = log10 (esurf / 6.11); + double tmp = log10 (esurf / 6.11); + return TEMP_C_TO_F (tmp * 237.7 / (tmp + 7.5)); } -static inline gdouble -calc_humidity (gdouble temp, gdouble dewp) +static inline double +calc_humidity (double temp, + double dewp) { - gdouble esat, esurf; + double esat, esurf; if (temp > -500.0 && dewp > -500.0) { temp = TEMP_F_TO_C (temp); |