summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-05-04 19:21:56 -0400
committerMatthias Clasen <mclasen@redhat.com>2013-05-04 19:21:56 -0400
commit3b4804bbf16fa6323a733d82ecf4283da5c98bc5 (patch)
treec368efa1af932fc7abffbfbf70f51fdbd9f62a1e
parent38688cad00938c40663800f9771b6c28bb6bbb6b (diff)
downloadgtk+-3b4804bbf16fa6323a733d82ecf4283da5c98bc5.tar.gz
Always use gint for border_width
This avoids an evil trap when doing MAX (..., ... - 2 * border_width) and the expression on the right gets promoted to unsigned, instead of going negative as you would expect. https://bugzilla.gnome.org/show_bug.cgi?id=699633
-rw-r--r--gtk/gtkalignment.c2
-rw-r--r--gtk/gtkframe.c2
-rw-r--r--gtk/gtknotebook.c2
-rw-r--r--gtk/gtkviewport.c2
-rw-r--r--gtk/gtkwindow.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkalignment.c b/gtk/gtkalignment.c
index f85c90dc32..bb5eb4a331 100644
--- a/gtk/gtkalignment.c
+++ b/gtk/gtkalignment.c
@@ -512,7 +512,7 @@ gtk_alignment_size_allocate (GtkWidget *widget,
GtkAllocation child_allocation;
GtkWidget *child;
gint width, height;
- guint border_width;
+ gint border_width;
gint padding_horizontal, padding_vertical;
gint baseline;
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index 9b81631394..2e01d951e3 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -816,7 +816,7 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame,
GtkAllocation allocation;
GtkBorder padding;
gint top_margin;
- guint border_width;
+ gint border_width;
gtk_widget_get_allocation (widget, &allocation);
get_padding_and_border (frame, &padding);
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 3265f982e9..c446a26748 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2459,7 +2459,7 @@ gtk_notebook_size_allocate (GtkWidget *widget,
if (priv->children)
{
- guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ gint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
GtkNotebookPage *page;
GtkAllocation child_allocation;
GList *children;
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 0469c5bce4..145e7603ab 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -318,7 +318,7 @@ viewport_get_view_allocation (GtkViewport *viewport,
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding, border;
- guint border_width;
+ gint border_width;
gtk_widget_get_allocation (widget, &allocation);
border_width = gtk_container_get_border_width (GTK_CONTAINER (viewport));
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index fcd2486735..669b535fde 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6357,7 +6357,7 @@ _gtk_window_set_allocation (GtkWindow *window,
GtkWidget *widget = (GtkWidget *)window;
GtkWindowPrivate *priv = window->priv;
GtkAllocation child_allocation;
- guint border_width;
+ gint border_width;
GtkBorder window_border = { 0 };
gint title_height = 0;