[libgweather/static-fixes: 5/6] Remove unused assignment




commit 7f72b9a92bc7bd2e0a734da524a4349924cd82e0
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Nov 12 13:48:44 2021 +0000

    Remove unused assignment
    
    The `esat` variable is only ever used in one branch when calculating the
    dew point.

 libgweather/gweather-weather.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c
index 31358663..6531d21a 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]