Replace all uses of G_VA_COPY with Standard C va_copy

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2022-10-21 14:48:47 +01:00
parent b8f37a543c
commit 65016fddd9
8 changed files with 56 additions and 56 deletions

View File

@ -125,7 +125,7 @@ _g_cclosure_marshal_BOOLEAN__OBJECTv (GClosure *closure,
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -216,7 +216,7 @@ _g_cclosure_marshal_BOOLEAN__OBJECT_FLAGSv (GClosure *closure,
guint arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -309,7 +309,7 @@ _g_cclosure_marshal_BOOLEAN__OBJECT_OBJECTv (GClosure *closure,
gpointer arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -406,7 +406,7 @@ _g_cclosure_marshal_BOOLEAN__POINTER_INTv (GClosure *closure,
gint arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
arg1 = (gint) va_arg (args_copy, gint);
va_end (args_copy);
@ -494,7 +494,7 @@ _g_cclosure_marshal_BOOLEAN__STRINGv (GClosure *closure,
g_return_if_fail (return_value != NULL);
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_strdup (arg0);
@ -579,7 +579,7 @@ _g_cclosure_marshal_BOOLEAN__UINTv (GClosure *closure,
guint arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (guint) va_arg (args_copy, guint);
va_end (args_copy);
@ -737,7 +737,7 @@ _g_cclosure_marshal_INT__BOXEDv (GClosure *closure,
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_boxed_copy (param_types[0] & ~G_SIGNAL_TYPE_STATIC_SCOPE, arg0);
@ -824,7 +824,7 @@ _g_cclosure_marshal_INT__OBJECTv (GClosure *closure,
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -910,7 +910,7 @@ _g_cclosure_marshal_VOID__BOOLEAN_BOXEDv (GClosure *closure,
gpointer arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gboolean) va_arg (args_copy, gboolean);
arg1 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[1] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg1 != NULL)
@ -995,7 +995,7 @@ _g_cclosure_marshal_VOID__ENUM_OBJECTv (GClosure *closure,
gpointer arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gint) va_arg (args_copy, gint);
arg1 = (gpointer) va_arg (args_copy, gpointer);
if (arg1 != NULL)
@ -1084,7 +1084,7 @@ _g_cclosure_marshal_VOID__ENUM_OBJECT_OBJECTv (GClosure *closure,
gpointer arg2;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gint) va_arg (args_copy, gint);
arg1 = (gpointer) va_arg (args_copy, gpointer);
if (arg1 != NULL)
@ -1179,7 +1179,7 @@ _g_cclosure_marshal_VOID__INT_INT_INTv (GClosure *closure,
gint arg2;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gint) va_arg (args_copy, gint);
arg1 = (gint) va_arg (args_copy, gint);
arg2 = (gint) va_arg (args_copy, gint);
@ -1263,7 +1263,7 @@ _g_cclosure_marshal_VOID__OBJECT_OBJECTv (GClosure *closure,
gpointer arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -1356,7 +1356,7 @@ _g_cclosure_marshal_VOID__OBJECT_OBJECT_ENUMv (GClosure *closure,
gint arg2;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -1459,7 +1459,7 @@ _g_cclosure_marshal_VOID__OBJECT_OBJECT_STRING_STRING_VARIANTv (GClosure *closur
gpointer arg4;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -1574,7 +1574,7 @@ _g_cclosure_marshal_VOID__OBJECT_OBJECT_VARIANT_BOXEDv (GClosure *closure,
gpointer arg3;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -1675,7 +1675,7 @@ _g_cclosure_marshal_VOID__OBJECT_VARIANTv (GClosure *closure,
gpointer arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -1768,7 +1768,7 @@ _g_cclosure_marshal_VOID__POINTER_INT_STRINGv (GClosure *closure,
gpointer arg2;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
arg1 = (gint) va_arg (args_copy, gint);
arg2 = (gpointer) va_arg (args_copy, gpointer);
@ -1855,7 +1855,7 @@ _g_cclosure_marshal_VOID__STRING_BOOLEANv (GClosure *closure,
gboolean arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_strdup (arg0);
@ -1940,7 +1940,7 @@ _g_cclosure_marshal_VOID__STRING_BOXEDv (GClosure *closure,
gpointer arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_strdup (arg0);
@ -2033,7 +2033,7 @@ _g_cclosure_marshal_VOID__STRING_BOXED_BOXEDv (GClosure *closure,
gpointer arg2;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_strdup (arg0);
@ -2132,7 +2132,7 @@ _g_cclosure_marshal_VOID__STRING_INT64_INT64v (GClosure *closure,
gint64 arg2;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_strdup (arg0);
@ -2227,7 +2227,7 @@ _g_cclosure_marshal_VOID__STRING_STRING_STRING_FLAGSv (GClosure *closure,
guint arg3;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_strdup (arg0);
@ -2328,7 +2328,7 @@ _g_cclosure_marshal_VOID__STRING_STRING_VARIANTv (GClosure *closure,
gpointer arg2;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_strdup (arg0);
@ -2423,7 +2423,7 @@ _g_cclosure_marshal_VOID__STRING_VARIANTv (GClosure *closure,
gpointer arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_strdup (arg0);
@ -2516,7 +2516,7 @@ _g_cclosure_marshal_VOID__UINT_UINT_UINTv (GClosure *closure,
guint arg2;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (guint) va_arg (args_copy, guint);
arg1 = (guint) va_arg (args_copy, guint);
arg2 = (guint) va_arg (args_copy, guint);
@ -2600,7 +2600,7 @@ _g_cclosure_marshal_VOID__VARIANT_BOXEDv (GClosure *closure,
gpointer arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_variant_ref_sink (arg0);

View File

@ -858,7 +858,7 @@ build_registry_pathv (gunichar2 *output, gsize output_size, va_list components)
if (output == NULL)
return FALSE;
G_VA_COPY (lentest, components);
va_copy (lentest, components);
for (length = 0, component = va_arg (lentest, gunichar2 *);
component != NULL;

View File

@ -2530,7 +2530,7 @@ g_markup_vprintf_escaped (const gchar *format,
/* Use them to format the arguments
*/
G_VA_COPY (args2, args);
va_copy (args2, args);
output1 = g_strdup_vprintf (format1->str, args);

View File

@ -360,7 +360,7 @@ g_vasprintf (gchar **string,
{
va_list args2;
G_VA_COPY (args2, args);
va_copy (args2, args);
*string = g_new (gchar, g_printf_string_upper_bound (format, args));

View File

@ -1614,7 +1614,7 @@ g_cclosure_marshal_generic_va (GClosure *closure,
args[n_args-1] = &closure->data;
}
G_VA_COPY (args_copy, args_list);
va_copy (args_copy, args_list);
/* Box non-primitive arguments */
for (i = 0; i < n_params; i++)

View File

@ -671,7 +671,7 @@ def generate_body(retval, params, prefix, va_marshal=False):
body += [' va_list args_copy;']
body += ['']
body += [' G_VA_COPY (args_copy, args);']
body += [' va_copy (args_copy, args);']
for idx, arg in enumerate(get_args):
ctype = IN_ARGS[arg]['ctype']

View File

@ -253,7 +253,7 @@ g_cclosure_marshal_VOID__BOOLEANv (GClosure *closure,
gboolean arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gboolean) va_arg (args_copy, gboolean);
va_end (args_copy);
@ -361,7 +361,7 @@ g_cclosure_marshal_VOID__CHARv (GClosure *closure,
gchar arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gchar) va_arg (args_copy, gint);
va_end (args_copy);
@ -469,7 +469,7 @@ g_cclosure_marshal_VOID__UCHARv (GClosure *closure,
guchar arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (guchar) va_arg (args_copy, guint);
va_end (args_copy);
@ -577,7 +577,7 @@ g_cclosure_marshal_VOID__INTv (GClosure *closure,
gint arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gint) va_arg (args_copy, gint);
va_end (args_copy);
@ -685,7 +685,7 @@ g_cclosure_marshal_VOID__UINTv (GClosure *closure,
guint arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (guint) va_arg (args_copy, guint);
va_end (args_copy);
@ -793,7 +793,7 @@ g_cclosure_marshal_VOID__LONGv (GClosure *closure,
glong arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (glong) va_arg (args_copy, glong);
va_end (args_copy);
@ -901,7 +901,7 @@ g_cclosure_marshal_VOID__ULONGv (GClosure *closure,
gulong arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gulong) va_arg (args_copy, gulong);
va_end (args_copy);
@ -1009,7 +1009,7 @@ g_cclosure_marshal_VOID__ENUMv (GClosure *closure,
gint arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gint) va_arg (args_copy, gint);
va_end (args_copy);
@ -1117,7 +1117,7 @@ g_cclosure_marshal_VOID__FLAGSv (GClosure *closure,
guint arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (guint) va_arg (args_copy, guint);
va_end (args_copy);
@ -1225,7 +1225,7 @@ g_cclosure_marshal_VOID__FLOATv (GClosure *closure,
gfloat arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gfloat) va_arg (args_copy, gdouble);
va_end (args_copy);
@ -1333,7 +1333,7 @@ g_cclosure_marshal_VOID__DOUBLEv (GClosure *closure,
gdouble arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gdouble) va_arg (args_copy, gdouble);
va_end (args_copy);
@ -1441,7 +1441,7 @@ g_cclosure_marshal_VOID__STRINGv (GClosure *closure,
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_strdup (arg0);
@ -1553,7 +1553,7 @@ g_cclosure_marshal_VOID__PARAMv (GClosure *closure,
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_param_spec_ref (arg0);
@ -1665,7 +1665,7 @@ g_cclosure_marshal_VOID__BOXEDv (GClosure *closure,
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_boxed_copy (param_types[0] & ~G_SIGNAL_TYPE_STATIC_SCOPE, arg0);
@ -1781,7 +1781,7 @@ g_cclosure_marshal_VOID__POINTERv (GClosure *closure,
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
va_end (args_copy);
@ -1889,7 +1889,7 @@ g_cclosure_marshal_VOID__OBJECTv (GClosure *closure,
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -2001,7 +2001,7 @@ g_cclosure_marshal_VOID__VARIANTv (GClosure *closure,
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_variant_ref_sink (arg0);
@ -2117,7 +2117,7 @@ g_cclosure_marshal_VOID__UINT_POINTERv (GClosure *closure,
gpointer arg1;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (guint) va_arg (args_copy, guint);
arg1 = (gpointer) va_arg (args_copy, gpointer);
va_end (args_copy);
@ -2236,7 +2236,7 @@ g_cclosure_marshal_BOOLEAN__FLAGSv (GClosure *closure,
g_return_if_fail (return_value != NULL);
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (guint) va_arg (args_copy, guint);
va_end (args_copy);
@ -2358,7 +2358,7 @@ g_cclosure_marshal_STRING__OBJECT_POINTERv (GClosure *closure,
g_return_if_fail (return_value != NULL);
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if (arg0 != NULL)
arg0 = g_object_ref (arg0);
@ -2487,7 +2487,7 @@ g_cclosure_marshal_BOOLEAN__BOXED_BOXEDv (GClosure *closure,
g_return_if_fail (return_value != NULL);
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_boxed_copy (param_types[0] & ~G_SIGNAL_TYPE_STATIC_SCOPE, arg0);

View File

@ -497,7 +497,7 @@ class TestGenmarshal(unittest.TestCase):
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_variant_ref_sink (arg0);
@ -639,7 +639,7 @@ class TestGenmarshal(unittest.TestCase):
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_strdup (arg0);
@ -782,7 +782,7 @@ class TestGenmarshal(unittest.TestCase):
gpointer arg0;
va_list args_copy;
G_VA_COPY (args_copy, args);
va_copy (args_copy, args);
arg0 = (gpointer) va_arg (args_copy, gpointer);
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
arg0 = g_param_spec_ref (arg0);