Defeat compiler optimization
authorMatthias Clasen <mclasen@redhat.com>
Sat, 31 Mar 2018 22:49:15 +0000 (18:49 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 1 Apr 2018 01:02:51 +0000 (21:02 -0400)
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

index 0eec375bb06bac4de454d1db61b487b4a5c20385..bd08336b3d2ea8012d28a2474bbb7361a90ba060 100644 (file)
@@ -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);
     }