[gtk+] label: Remove some unneeded conditionals



commit 2397d76137178839678b2e5d30d6886d48ea0f58
Author: Timm Bäder <mail baedert org>
Date:   Wed Jan 13 19:07:20 2016 +0100

    label: Remove some unneeded conditionals
    
    We are never passing NULL here.

 gtk/gtklabel.c |   39 ++++++++++-----------------------------
 1 files changed, 10 insertions(+), 29 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 7efb749..9d13def 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -4584,26 +4584,16 @@ window_to_layout_coords (GtkLabel *label,
 {
   GtkAllocation allocation;
   gint lx, ly;
-  GtkWidget *widget;
 
-  widget = GTK_WIDGET (label);
-  
   /* get layout location in widget->window coords */
   get_layout_location (label, &lx, &ly);
+  gtk_widget_get_allocation (GTK_WIDGET (label), &allocation);
 
-  gtk_widget_get_allocation (widget, &allocation);
+  *x += allocation.x; /* go to widget->window */
+  *x -= lx;                   /* go to layout */
 
-  if (x)
-    {
-      *x += allocation.x; /* go to widget->window */
-      *x -= lx;                   /* go to layout */
-    }
-
-  if (y)
-    {
-      *y += allocation.y; /* go to widget->window */
-      *y -= ly;                   /* go to layout */
-    }
+  *y += allocation.y; /* go to widget->window */
+  *y -= ly;                   /* go to layout */
 }
 
 static void
@@ -4612,26 +4602,17 @@ layout_to_window_coords (GtkLabel *label,
                          gint     *y)
 {
   gint lx, ly;
-  GtkWidget *widget;
   GtkAllocation allocation;
 
-  widget = GTK_WIDGET (label);
-  
   /* get layout location in widget->window coords */
   get_layout_location (label, &lx, &ly);
-  gtk_widget_get_allocation (widget, &allocation);
+  gtk_widget_get_allocation (GTK_WIDGET (label), &allocation);
 
-  if (x)
-    {
-      *x += lx;           /* go to widget->window */
-      *x -= allocation.x; /* go to selection window */
-    }
+  *x += lx;           /* go to widget->window */
+  *x -= allocation.x; /* go to selection window */
 
-  if (y)
-    {
-      *y += ly;           /* go to widget->window */
-      *y -= allocation.y; /* go to selection window */
-    }
+  *y += ly;           /* go to widget->window */
+  *y -= allocation.y; /* go to selection window */
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]