[libsoup] Use G_GNUC_BEGIN_IGNORE_DEPRECATIONS (where available)



commit 48260a675ed747cd72eab439aecd74b53389d4ad
Author: Dan Winship <danw gnome org>
Date:   Sat Feb 18 19:41:48 2012 -0500

    Use G_GNUC_BEGIN_IGNORE_DEPRECATIONS (where available)
    
    The XMLRPC API uses GValueArray, so ignore deprecation warnings about
    that.

 libsoup/soup-value-utils.c |    7 +++++++
 libsoup/soup-xmlrpc.c      |   30 ++++++++++++++++++++++++++++++
 tests/getbug.c             |    6 ++++++
 tests/xmlrpc-server-test.c |    4 ++++
 tests/xmlrpc-test.c        |    4 ++++
 5 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/libsoup/soup-value-utils.c b/libsoup/soup-value-utils.c
index 351b3da..41f8c92 100644
--- a/libsoup/soup-value-utils.c
+++ b/libsoup/soup-value-utils.c
@@ -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)
diff --git a/libsoup/soup-xmlrpc.c b/libsoup/soup-xmlrpc.c
index 2a4d427..06c9bca 100644
--- a/libsoup/soup-xmlrpc.c
+++ b/libsoup/soup-xmlrpc.c
@@ -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;
 }
 
diff --git a/tests/getbug.c b/tests/getbug.c
index c1bd566..1af3f53 100644
--- a/tests/getbug.c
+++ b/tests/getbug.c
@@ -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
diff --git a/tests/xmlrpc-server-test.c b/tests/xmlrpc-server-test.c
index 9eae702..ebb7ca6 100644
--- a/tests/xmlrpc-server-test.c
+++ b/tests/xmlrpc-server-test.c
@@ -13,6 +13,10 @@
 
 #include "test-utils.h"
 
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
+
 GMainLoop *loop;
 
 static void
diff --git a/tests/xmlrpc-test.c b/tests/xmlrpc-test.c
index c7c1774..f442e2c 100644
--- a/tests/xmlrpc-test.c
+++ b/tests/xmlrpc-test.c
@@ -12,6 +12,10 @@
 
 #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;



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