[libsoup] Use G_DEFINE_QUARK() for the SOUP_HTTP_ERROR error domain



commit e337a6f79490f6cf6b3000df7ee1daa3962567e2
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Fri Aug 23 15:01:08 2019 +0300

    Use G_DEFINE_QUARK() for the SOUP_HTTP_ERROR error domain
    
    Also move the documentation together with the definition.

 libsoup/soup-status.c | 17 +----------------
 libsoup/soup-status.h |  8 +++++++-
 2 files changed, 8 insertions(+), 17 deletions(-)
---
diff --git a/libsoup/soup-status.c b/libsoup/soup-status.c
index 6dbb9edb..ee0b88c9 100644
--- a/libsoup/soup-status.c
+++ b/libsoup/soup-status.c
@@ -160,14 +160,6 @@
  * have always had the names they have now.
  **/
 
-/**
- * SOUP_HTTP_ERROR:
- *
- * A #GError domain representing an HTTP status. Use a #SoupStatus for
- * the <structfield>code</structfield> value.
- **/
-
-
 /* The reason_phrases are not localized because:
  *
  * 1. Only ASCII can be used portably in the HTTP Status-Line, so we
@@ -312,11 +304,4 @@ soup_status_proxify (guint status_code)
                return status_code;
 }
 
-GQuark
-soup_http_error_quark (void)
-{
-       static GQuark error;
-       if (!error)
-               error = g_quark_from_static_string ("soup_http_error_quark");
-       return error;
-}
+G_DEFINE_QUARK (soup-http-error-quark, soup_http_error)
diff --git a/libsoup/soup-status.h b/libsoup/soup-status.h
index 1cc05ae2..5263df33 100644
--- a/libsoup/soup-status.h
+++ b/libsoup/soup-status.h
@@ -98,7 +98,13 @@ const char *soup_status_get_phrase (guint status_code);
 SOUP_AVAILABLE_IN_2_26
 guint       soup_status_proxify    (guint status_code);
 
-#define SOUP_HTTP_ERROR soup_http_error_quark()
+/**
+ * SOUP_HTTP_ERROR:
+ *
+ * A #GError domain representing an HTTP status. Use a #SoupStatus for
+ * the <structfield>code</structfield> value.
+ **/
+#define SOUP_HTTP_ERROR (soup_http_error_quark())
 SOUP_AVAILABLE_IN_2_4
 GQuark soup_http_error_quark (void);
 


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