From b0cf4d057de5b4e4d411c387487c60dc10d212e2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 21 Apr 2013 21:31:29 -0400 Subject: [PATCH] Make transition-duration unsigned The code doesn't deal with negative durations, so better don't allow them. --- gtk/gtkstack.c | 10 +++++----- gtk/gtkstack.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index c1d7f99dae..5cd929a0dc 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -103,7 +103,7 @@ struct _GtkStackPrivate { gboolean homogeneous; GtkStackTransitionType transition_type; - gint transition_duration; + guint transition_duration; GtkStackChildInfo *last_visible_child; cairo_surface_t *last_visible_surface; @@ -216,7 +216,7 @@ gtk_stack_get_property (GObject *object, g_value_set_string (value, gtk_stack_get_visible_child_name (stack)); break; case PROP_TRANSITION_DURATION: - g_value_set_int (value, gtk_stack_get_transition_duration (stack)); + g_value_set_uint (value, gtk_stack_get_transition_duration (stack)); break; case PROP_TRANSITION_TYPE: g_value_set_enum (value, gtk_stack_get_transition_type (stack)); @@ -247,7 +247,7 @@ gtk_stack_set_property (GObject *object, gtk_stack_set_visible_child_name (stack, g_value_get_string (value)); break; case PROP_TRANSITION_DURATION: - gtk_stack_set_transition_duration (stack, g_value_get_int (value)); + gtk_stack_set_transition_duration (stack, g_value_get_uint (value)); break; case PROP_TRANSITION_TYPE: gtk_stack_set_transition_type (stack, g_value_get_enum (value)); @@ -1101,7 +1101,7 @@ gtk_stack_get_homogeneous (GtkStack *stack) * * Since: 3.10 */ -gint +guint gtk_stack_get_transition_duration (GtkStack *stack) { g_return_val_if_fail (GTK_IS_STACK (stack), 0); @@ -1123,7 +1123,7 @@ gtk_stack_get_transition_duration (GtkStack *stack) */ void gtk_stack_set_transition_duration (GtkStack *stack, - gint transition_duration) + guint transition_duration) { g_return_if_fail (GTK_IS_STACK (stack)); diff --git a/gtk/gtkstack.h b/gtk/gtkstack.h index a0136e7ace..46c73671c9 100644 --- a/gtk/gtkstack.h +++ b/gtk/gtkstack.h @@ -79,8 +79,8 @@ void gtk_stack_set_homogeneous (GtkStack gboolean homogeneous); gboolean gtk_stack_get_homogeneous (GtkStack *stack); void gtk_stack_set_transition_duration (GtkStack *stack, - gint transition_duration); -gint gtk_stack_get_transition_duration (GtkStack *stack); + guint transition_duration); +guint gtk_stack_get_transition_duration (GtkStack *stack); void gtk_stack_set_transition_type (GtkStack *stack, GtkStackTransitionType transition_type); GtkStackTransitionType gtk_stack_get_transition_type (GtkStack *stack);