[libgweather/ebassi/libsoup3: 6/6] Run the code base through the style formatter




commit c55d4ee3edb82eceb690f0645870badc17d41bd7
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Oct 19 17:32:05 2021 +0100

    Run the code base through the style formatter
    
    Ensure that the changes are consistent.

 libgweather/gweather-weather.c       | 10 ++++-----
 libgweather/tests/test_libgweather.c |  6 +++---
 libgweather/weather-iwin.c           |  6 +++---
 libgweather/weather-metar.c          | 42 +++++++++++++++++++++---------------
 libgweather/weather-metno.c          |  5 ++---
 libgweather/weather-owm.c            |  9 ++++----
 6 files changed, 41 insertions(+), 37 deletions(-)
---
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c
index aaadb670..2ab98212 100644
--- a/libgweather/gweather-weather.c
+++ b/libgweather/gweather-weather.c
@@ -376,17 +376,15 @@ _gweather_info_request_done (GWeatherInfo *info,
     }
 }
 
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
 void
 _gweather_info_queue_request (GWeatherInfo *info,
                               SoupMessage *msg,
                               GAsyncReadyCallback callback)
 {
     GCancellable *cancellable = g_cancellable_new ();
-    g_object_set_data_full (G_OBJECT (msg), "request-cancellable",
-                            cancellable, g_object_unref);
-    soup_session_send_and_read_async (info->session, msg, G_PRIORITY_DEFAULT,
-                                      cancellable, callback, info);
+    g_object_set_data_full (G_OBJECT (msg), "request-cancellable", cancellable, g_object_unref);
+    soup_session_send_and_read_async (info->session, msg, G_PRIORITY_DEFAULT, cancellable, callback, info);
     g_object_unref (msg);
 }
 #else
@@ -731,7 +729,7 @@ gweather_info_abort (GWeatherInfo *info)
     info->requests_pending = &dummy;
 
     for (iter = list; iter; iter = iter->next) {
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
         g_cancellable_cancel (g_object_get_data (iter->data, "request-cancellable"));
 #else
         soup_session_cancel_message (info->session, iter->data, SOUP_STATUS_CANCELLED);
diff --git a/libgweather/tests/test_libgweather.c b/libgweather/tests/test_libgweather.c
index fe258121..ece4851a 100644
--- a/libgweather/tests/test_libgweather.c
+++ b/libgweather/tests/test_libgweather.c
@@ -403,7 +403,7 @@ test_metar_weather_stations (void)
     SoupSession *session;
     GHashTable *stations_ht;
     char *contents;
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
     GBytes *body;
     GError *error = NULL;
     gsize bsize;
@@ -414,7 +414,7 @@ test_metar_weather_stations (void)
 
     msg = soup_message_new ("GET", METAR_SOURCES);
     session = soup_session_new ();
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
     body = soup_session_send_and_read (session, msg, NULL, &error);
     if (error && error->domain == G_TLS_ERROR) {
 #else
@@ -425,7 +425,7 @@ test_metar_weather_stations (void)
         g_test_failed ();
         return;
     }
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
     g_assert_no_error (error);
     g_assert_cmpint (soup_message_get_status (msg), >=, 200);
     g_assert_cmpint (soup_message_get_status (msg), <, 300);
diff --git a/libgweather/weather-iwin.c b/libgweather/weather-iwin.c
index 11765536..b6a19cfb 100644
--- a/libgweather/weather-iwin.c
+++ b/libgweather/weather-iwin.c
@@ -298,7 +298,7 @@ parseForecastXml (const char *buff, GWeatherInfo *original_info)
     return res;
 }
 
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
 static void
 iwin_finish (GObject *source, GAsyncResult *result, gpointer data)
 {
@@ -325,8 +325,8 @@ iwin_finish (GObject *source, GAsyncResult *result, gpointer data)
     } else if (!SOUP_STATUS_IS_SUCCESSFUL (soup_message_get_status (msg))) {
         g_bytes_unref (body);
         g_warning ("Failed to get IWIN forecast data: %d %s\n",
-               soup_message_get_status (msg),
-               soup_message_get_reason_phrase (msg));
+                   soup_message_get_status (msg),
+                   soup_message_get_reason_phrase (msg));
         _gweather_info_request_done (data, msg);
         return;
     }
diff --git a/libgweather/weather-metar.c b/libgweather/weather-metar.c
index 94600767..e82a9179 100644
--- a/libgweather/weather-metar.c
+++ b/libgweather/weather-metar.c
@@ -546,7 +546,7 @@ metar_parse (gchar *metar, GWeatherInfo *info)
     return TRUE;
 }
 
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
 static void
 metar_finish (GObject *source, GAsyncResult *result, gpointer data)
 #else
@@ -554,7 +554,7 @@ static void
 metar_finish (SoupSession *session, SoupMessage *msg, gpointer data)
 #endif
 {
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
     SoupSession *session = SOUP_SESSION (source);
     SoupMessage *msg = soup_session_get_async_result_message (session, result);
     GError *error = NULL;
@@ -568,7 +568,7 @@ metar_finish (SoupSession *session, SoupMessage *msg, gpointer data)
 
     info = data;
 
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
     body = soup_session_send_and_read_finish (session, result, &error);
     if (!body) {
         if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
@@ -647,7 +647,7 @@ metar_finish (SoupSession *session, SoupMessage *msg, gpointer data)
     if (!info->valid)
         info->valid = success;
 
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
     g_bytes_unref (body);
 #endif
     _gweather_info_request_done (info, msg);
@@ -659,7 +659,7 @@ metar_start_open (GWeatherInfo *info)
 {
     WeatherLocation *loc;
     SoupMessage *msg;
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
     GUri *uri;
 #else
     SoupURI *uri;
@@ -676,19 +676,27 @@ metar_start_open (GWeatherInfo *info)
 
     g_debug ("metar_start_open, requesting: 
https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&hoursBeforeNow=3&mostRecent=true&fields=raw_text&stationString=%s";,
 loc->code);
     query = soup_form_encode (
-        "dataSource", "metars",
-        "requestType", "retrieve",
-        "format", "xml",
-        "hoursBeforeNow", "3",
-        "mostRecent", "true",
-        "fields", "raw_text",
-        "stationString", loc->code,
-        NULL
-    );
-#if SOUP_CHECK_VERSION (2, 99, 2)
+        "dataSource",
+        "metars",
+        "requestType",
+        "retrieve",
+        "format",
+        "xml",
+        "hoursBeforeNow",
+        "3",
+        "mostRecent",
+        "true",
+        "fields",
+        "raw_text",
+        "stationString",
+        loc->code,
+        NULL);
+#if SOUP_CHECK_VERSION(2, 99, 2)
     uri = g_uri_build (SOUP_HTTP_URI_FLAGS,
-                       "https", NULL,
-                       "www.aviationweather.gov", -1,
+                       "https",
+                       NULL,
+                       "www.aviationweather.gov",
+                       -1,
                        "/adds/dataserver_current/httpparam",
                        query,
                        NULL);
diff --git a/libgweather/weather-metno.c b/libgweather/weather-metno.c
index 242a8dd5..94c568c3 100644
--- a/libgweather/weather-metno.c
+++ b/libgweather/weather-metno.c
@@ -378,7 +378,7 @@ out:
     xmlFreeDoc (doc);
 }
 
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
 static void
 metno_finish_new (GObject *source,
                   GAsyncResult *result,
@@ -460,8 +460,7 @@ metno_finish_new (SoupSession *session,
     g_debug ("metno data for %lf, %lf", loc->latitude, loc->longitude);
     g_debug ("%s", msg->response_body->data);
 
-    parse_forecast_xml_new (info, msg->response_body->data,
-                             msg->response_body->length);
+    parse_forecast_xml_new (info, msg->response_body->data, msg->response_body->length);
     num_forecasts = g_slist_length (info->forecast_list);
     g_debug ("metno parsed %d forecast infos", num_forecasts);
     if (!info->valid)
diff --git a/libgweather/weather-owm.c b/libgweather/weather-owm.c
index 10b06cdd..754fbb00 100644
--- a/libgweather/weather-owm.c
+++ b/libgweather/weather-owm.c
@@ -390,7 +390,7 @@ out:
     xmlFreeDoc (doc);
 }
 
-#if SOUP_CHECK_VERSION (2, 99, 2)
+#if SOUP_CHECK_VERSION(2, 99, 2)
 static void
 owm_finish (GObject *source,
             GAsyncResult *result,
@@ -422,8 +422,8 @@ owm_finish (GObject *source,
     } else if (!SOUP_STATUS_IS_SUCCESSFUL (soup_message_get_status (msg))) {
         g_bytes_unref (body);
         g_warning ("Failed to get OpenWeatherMap forecast data: %d %s\n",
-               soup_message_get_status (msg),
-               soup_message_get_reason_phrase (msg));
+                   soup_message_get_status (msg),
+                   soup_message_get_reason_phrase (msg));
         _gweather_info_request_done (data, msg);
         return;
     }
@@ -468,8 +468,7 @@ owm_finish (SoupSession *session,
     g_debug ("owm data for %lf, %lf", loc->latitude, loc->longitude);
     g_debug ("%s", msg->response_body->data);
 
-    parse_forecast_xml (info, msg->response_body->data,
-                        msg->response_body->length);
+    parse_forecast_xml (info, msg->response_body->data, msg->response_body->length);
     _gweather_info_request_done (info, msg);
 }
 #endif


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