gsignal: Use new g_newa0() function

Replace old `g_alloca()` and `memset()` with `g_newa0()`
This commit is contained in:
Nishal Kulkarni 2021-11-25 13:48:04 +05:30 committed by Philip Withnall
parent 8bf62d6309
commit 34cf69ef17

View File

@ -2266,8 +2266,7 @@ g_signal_chain_from_overridden_handler (gpointer instance,
va_start (var_args, instance);
signal_return_type = node->return_type;
instance_and_params = g_alloca (sizeof (GValue) * (n_params + 1));
memset (instance_and_params, 0, sizeof (GValue) * (n_params + 1));
instance_and_params = g_newa0 (GValue, n_params + 1);
param_values = instance_and_params + 1;
for (i = 0; i < node->n_params; i++)
@ -3462,8 +3461,7 @@ g_signal_emit_valist (gpointer instance,
n_params = node->n_params;
signal_return_type = node->return_type;
instance_and_params = g_alloca (sizeof (GValue) * (n_params + 1));
memset (instance_and_params, 0, sizeof (GValue) * (n_params + 1));
instance_and_params = g_newa0 (GValue, n_params + 1);
param_values = instance_and_params + 1;
for (i = 0; i < node->n_params; i++)