diff options
Diffstat (limited to 'gtk/src/values.c')
-rw-r--r-- | gtk/src/values.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gtk/src/values.c b/gtk/src/values.c index 4f6c40769..4124b0a26 100644 --- a/gtk/src/values.c +++ b/gtk/src/values.c @@ -45,7 +45,7 @@ ghb_value_dup(const GValue *val) return copy; } -static void +void debug_show_type(GType tp) { const gchar *str = "unknown"; @@ -61,6 +61,10 @@ debug_show_type(GType tp) { str ="int64"; } + else if (tp == G_TYPE_DOUBLE) + { + str ="double"; + } else if (tp == G_TYPE_BOOLEAN) { str ="bool"; @@ -652,6 +656,22 @@ ghb_array_replace(GValue *gval, guint ii, GValue *val) ((GValue**)arr->data)[ii] = val; } +void +ghb_array_copy(GValue *arr1, GValue *arr2, gint count) +{ + gint len, ii; + + // empty the first array if it is not already empty + len = ghb_array_len(arr1); + for (ii = 0; ii < len; ii++) + ghb_array_remove(arr1, 0); + + len = ghb_array_len(arr2); + count = MIN(count, len); + for (ii = 0; ii < count; ii++) + ghb_array_append(arr1, ghb_value_dup(ghb_array_get_nth(arr2, ii))); +} + gint ghb_array_len(const GValue *gval) { |