Commit 490f9312 authored by Christian Hergert's avatar Christian Hergert
Browse files

graph: backport va_list fixes

This ensures that we pass va_list pointers by reference so that the va_list
stack pointer is advanced.
parent cae32aca
......@@ -30,10 +30,10 @@ void _dzl_graph_view_column_get_value (DzlGraphColumn *self,
GValue *value);
void _dzl_graph_view_column_collect (DzlGraphColumn *self,
guint index,
va_list args);
va_list *args);
void _dzl_graph_view_column_lcopy (DzlGraphColumn *self,
guint index,
va_list args);
va_list *args);
void _dzl_graph_view_column_get (DzlGraphColumn *column,
guint index,
...);
......
......@@ -143,17 +143,18 @@ _dzl_graph_view_column_get_value (DzlGraphColumn *self,
void
_dzl_graph_view_column_collect (DzlGraphColumn *self,
guint index,
va_list args)
va_list *args)
{
GValue *value;
gchar *errmsg = NULL;
g_return_if_fail (DZL_IS_GRAPH_COLUMN (self));
g_return_if_fail (index < self->values->len);
g_return_if_fail (args != NULL);
value = &((GValue *)(gpointer)self->values->data)[index];
G_VALUE_COLLECT (value, args, 0, &errmsg);
G_VALUE_COLLECT (value, *args, 0, &errmsg);
if (G_UNLIKELY (errmsg != NULL))
{
......@@ -173,7 +174,7 @@ _dzl_graph_view_column_set (DzlGraphColumn *self,
g_return_if_fail (index < self->values->len);
va_start (args, index);
_dzl_graph_view_column_collect (self, index, args);
_dzl_graph_view_column_collect (self, index, &args);
va_end (args);
}
......@@ -188,14 +189,14 @@ _dzl_graph_view_column_get (DzlGraphColumn *self,
g_return_if_fail (index < self->values->len);
va_start (args, index);
_dzl_graph_view_column_lcopy (self, index, args);
_dzl_graph_view_column_lcopy (self, index, &args);
va_end (args);
}
void
_dzl_graph_view_column_lcopy (DzlGraphColumn *self,
guint index,
va_list args)
va_list *args)
{
const GValue *value;
gchar *errmsg = NULL;
......@@ -208,7 +209,7 @@ _dzl_graph_view_column_lcopy (DzlGraphColumn *self,
if (!G_IS_VALUE (value))
return;
G_VALUE_LCOPY (value, args, 0, &errmsg);
G_VALUE_LCOPY (value, *args, 0, &errmsg);
if (G_UNLIKELY (errmsg != NULL))
{
......
......@@ -365,7 +365,7 @@ dzl_graph_view_model_iter_set (DzlGraphModelIter *iter,
column = g_ptr_array_index (priv->columns, column_id);
_dzl_graph_view_column_collect (column, impl->index, args);
_dzl_graph_view_column_collect (column, impl->index, &args);
column_id = va_arg (args, gint);
}
......@@ -407,7 +407,7 @@ dzl_graph_view_model_iter_get (DzlGraphModelIter *iter,
column = g_ptr_array_index (priv->columns, column_id);
_dzl_graph_view_column_lcopy (column, impl->index, args);
_dzl_graph_view_column_lcopy (column, impl->index, &args);
column_id = va_arg (args, gint);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment