[glib/gvariant-varargs] remove get_arg magic
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/gvariant-varargs] remove get_arg magic
- Date: Mon, 8 Mar 2010 02:37:21 +0000 (UTC)
commit 7cf7ef131a07a5842977ab4d27b173b1f8f6a7f3
Author: Ryan Lortie <desrt desrt ca>
Date: Sun Mar 7 21:37:03 2010 -0500
remove get_arg magic
glib/gvariant.c | 50 ++++++++++++++++++++------------------------------
1 files changed, 20 insertions(+), 30 deletions(-)
---
diff --git a/glib/gvariant.c b/glib/gvariant.c
index 9fb32cb..1f78786 100644
--- a/glib/gvariant.c
+++ b/glib/gvariant.c
@@ -2882,16 +2882,6 @@ valid_format_string (const gchar *format_string,
}
/* Variable Arguments {{{1 */
-#undef DEBUG_GVARIANT_VARARGS
-
-#ifdef DEBUG_GVARIANT_VARARGS
-#define get_arg(a,t) \
- ({ g_print (G_STRLOC " (%s): get %s\n", G_STRFUNC, #t); va_arg (a, t); })
-#else
-#define get_arg va_arg
-#endif
-
-
/* We consider 2 main classes of format strings:
*
* - recursive format strings
@@ -3155,7 +3145,7 @@ g_variant_valist_skip_leaf (const gchar **str,
if (g_variant_format_string_is_nnp (*str))
{
g_variant_format_string_scan (*str, NULL, str);
- get_arg (*app, gpointer);
+ va_arg (*app, gpointer);
return;
}
@@ -3168,16 +3158,16 @@ g_variant_valist_skip_leaf (const gchar **str,
case 'i':
case 'u':
case 'h':
- get_arg (*app, int);
+ va_arg (*app, int);
return;
case 'x':
case 't':
- get_arg (*app, guint64);
+ va_arg (*app, guint64);
return;
case 'd':
- get_arg (*app, gdouble);
+ va_arg (*app, gdouble);
return;
default:
@@ -3190,39 +3180,39 @@ g_variant_valist_new_leaf (const gchar **str,
va_list *app)
{
if (g_variant_format_string_is_nnp (*str))
- return g_variant_valist_new_nnp (str, get_arg (*app, gpointer));
+ return g_variant_valist_new_nnp (str, va_arg (*app, gpointer));
switch (*(*str)++)
{
case 'b':
- return g_variant_new_boolean (get_arg (*app, gboolean));
+ return g_variant_new_boolean (va_arg (*app, gboolean));
case 'y':
- return g_variant_new_byte (get_arg (*app, guint));
+ return g_variant_new_byte (va_arg (*app, guint));
case 'n':
- return g_variant_new_int16 (get_arg (*app, gint));
+ return g_variant_new_int16 (va_arg (*app, gint));
case 'q':
- return g_variant_new_uint16 (get_arg (*app, guint));
+ return g_variant_new_uint16 (va_arg (*app, guint));
case 'i':
- return g_variant_new_int32 (get_arg (*app, gint));
+ return g_variant_new_int32 (va_arg (*app, gint));
case 'u':
- return g_variant_new_uint32 (get_arg (*app, guint));
+ return g_variant_new_uint32 (va_arg (*app, guint));
case 'x':
- return g_variant_new_int64 (get_arg (*app, gint64));
+ return g_variant_new_int64 (va_arg (*app, gint64));
case 't':
- return g_variant_new_uint64 (get_arg (*app, guint64));
+ return g_variant_new_uint64 (va_arg (*app, guint64));
case 'h':
- return g_variant_new_handle (get_arg (*app, gint));
+ return g_variant_new_handle (va_arg (*app, gint));
case 'd':
- return g_variant_new_double (get_arg (*app, gdouble));
+ return g_variant_new_double (va_arg (*app, gdouble));
default:
g_assert_not_reached ();
@@ -3235,7 +3225,7 @@ g_variant_valist_get_leaf (const gchar **str,
gboolean free,
va_list *app)
{
- gpointer ptr = get_arg (*app, gpointer);
+ gpointer ptr = va_arg (*app, gpointer);
if (ptr == NULL)
{
@@ -3351,7 +3341,7 @@ g_variant_valist_skip (const gchar **str,
(*str)++;
if (!g_variant_format_string_is_nnp (*str))
- get_arg (*app, gboolean);
+ va_arg (*app, gboolean);
g_variant_valist_skip (str, app);
}
@@ -3381,7 +3371,7 @@ g_variant_valist_new (const gchar **str,
if (g_variant_format_string_is_nnp (*str))
{
- gpointer nnp = get_arg (*app, gpointer);
+ gpointer nnp = va_arg (*app, gpointer);
if (nnp != NULL)
value = g_variant_valist_new_nnp (str, nnp);
@@ -3390,7 +3380,7 @@ g_variant_valist_new (const gchar **str,
}
else
{
- gboolean just = get_arg (*app, gboolean);
+ gboolean just = va_arg (*app, gboolean);
if (just)
value = g_variant_valist_new (str, app);
@@ -3447,7 +3437,7 @@ g_variant_valist_get (const gchar **str,
if (!g_variant_format_string_is_nnp (*str))
{
- gboolean *ptr = get_arg (*app, gboolean *);
+ gboolean *ptr = va_arg (*app, gboolean *);
if (ptr != NULL)
*ptr = value != NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]