[gtk] Defeat compiler optimization



commit d15a29c876a464954b6b02cc5eb08f4d0b59c1c0
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Mar 31 18:49:15 2018 -0400

    Defeat compiler optimization
    
    We always want to call both update functions here, and
    the compiler unhelpfully optimizes out the second call
    if the first one returns TRUE.

 gtk/gtkfontchooserwidget.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index 0eec375bb0..bd08336b3d 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -2241,8 +2241,10 @@ gtk_font_chooser_widget_merge_font_desc (GtkFontChooserWidget       *fontchooser
       gtk_font_chooser_widget_update_marks (fontchooser);
 
 #if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
-      has_tweak = gtk_font_chooser_widget_update_font_variations (fontchooser) ||
-                  gtk_font_chooser_widget_update_font_features (fontchooser);
+      if (gtk_font_chooser_widget_update_font_features (fontchooser))
+        has_tweak = TRUE;
+      if (gtk_font_chooser_widget_update_font_variations (fontchooser))
+        has_tweak = TRUE;
 #endif
       g_simple_action_set_enabled (G_SIMPLE_ACTION (priv->tweak_action), has_tweak);
     }


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