Use G_GNUC_BEGIN_IGNORE_DEPRECATIONS (where available)
authorDan Winship <danw@gnome.org>
Sun, 19 Feb 2012 00:41:48 +0000 (19:41 -0500)
committerDan Winship <danw@gnome.org>
Mon, 5 Mar 2012 00:37:09 +0000 (19:37 -0500)
The XMLRPC API uses GValueArray, so ignore deprecation warnings about
that.

libsoup/soup-value-utils.c
libsoup/soup-xmlrpc.c
tests/getbug.c
tests/xmlrpc-server-test.c
tests/xmlrpc-test.c

index 351b3da..41f8c92 100644 (file)
@@ -249,6 +249,10 @@ soup_value_hash_lookup_vals (GHashTable *hash, const char *first_key, ...)
 }
 
 
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
+
 /**
  * soup_value_array_from_args:
  * @args: arguments to create a #GValueArray from
@@ -455,6 +459,9 @@ soup_value_array_get_nth (GValueArray *array, guint index_, GType type, ...)
        return TRUE;
 }
 
+#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
+G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
 
 static GByteArray *
 soup_byte_array_copy (GByteArray *ba)
index 2a4d427..06c9bca 100644 (file)
@@ -102,7 +102,13 @@ insert_value (xmlNode *parent, GValue *value)
                g_hash_table_foreach (hash, insert_member, &struct_node);
                if (!struct_node)
                        return FALSE;
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
        } else if (type == G_TYPE_VALUE_ARRAY) {
+#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
+G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
                GValueArray *va = g_value_get_boxed (value);
                xmlNode *node;
                int i;
@@ -201,7 +207,13 @@ soup_xmlrpc_request_newv (const char *uri, const char *method_name, va_list args
 
        body = soup_xmlrpc_build_method_call (method_name, params->values,
                                              params->n_values);
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
        g_value_array_free (params);
+#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
+G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
        if (!body)
                return NULL;
 
@@ -520,6 +532,9 @@ parse_value (xmlNode *xmlvalue, GValue *value)
                if (!data || strcmp ((const char *)data->name, "data") != 0)
                        return FALSE;
 
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
                array = g_value_array_new (1);
                for (xval = find_real_node (data->children);
                     xval;
@@ -536,6 +551,9 @@ parse_value (xmlNode *xmlvalue, GValue *value)
                }
                g_value_init (value, G_TYPE_VALUE_ARRAY);
                g_value_take_boxed (value, array);
+#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
+G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
        } else
                return FALSE;
 
@@ -584,6 +602,9 @@ soup_xmlrpc_parse_method_call (const char *method_call, int length,
        if (!node || strcmp ((const char *)node->name, "params") != 0)
                goto fail;
 
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
        *params = g_value_array_new (1);
        param = find_real_node (node->children);
        while (param && !strcmp ((const char *)param->name, "param")) {
@@ -598,6 +619,9 @@ soup_xmlrpc_parse_method_call (const char *method_call, int length,
 
                param = find_real_node (param->next);
        }
+#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
+G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
 
        success = TRUE;
        *method_name = g_strdup ((char *)xmlMethodName);
@@ -645,7 +669,13 @@ soup_xmlrpc_extract_method_call (const char *method_call, int length,
        success = soup_value_array_to_args (params, args);
        va_end (args);
 
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
        g_value_array_free (params);
+#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
+G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
        return success;
 }
 
index c1bd566..1af3f53 100644 (file)
@@ -19,6 +19,9 @@ static GMainLoop *loop;
 static void
 print_value (GValue *value)
 {
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
        if (G_VALUE_HOLDS_STRING (value))
                printf ("%s", g_value_get_string (value));
        else if (G_VALUE_HOLDS_INT (value))
@@ -37,6 +40,9 @@ print_value (GValue *value)
                printf (" ]");
        } else
                printf ("(%s)", g_type_name (G_VALUE_TYPE (value)));
+#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
+G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
 }
 
 static void
index 9eae702..ebb7ca6 100644 (file)
 
 #include "test-utils.h"
 
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
+
 GMainLoop *loop;
 
 static void
index c7c1774..f442e2c 100644 (file)
 
 #include "test-utils.h"
 
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
+
 static SoupSession *session;
 static const char *default_uri = "http://127.0.0.1:47524/xmlrpc-server.php";
 static const char *uri = NULL;