[gnome-commander] Fixes gcc type limits warning



commit 44eeabc449da4de8bdb495579086fce618e03aab
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Sat Apr 22 11:40:56 2017 +0200

    Fixes gcc type limits warning

 src/gnome-cmd-advrename-profile-component.cc |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-cmd-advrename-profile-component.cc b/src/gnome-cmd-advrename-profile-component.cc
index 3bee94a..4f67b03 100644
--- a/src/gnome-cmd-advrename-profile-component.cc
+++ b/src/gnome-cmd-advrename-profile-component.cc
@@ -33,6 +33,9 @@
 #include "tags/gnome-cmd-tags.h"
 #include "utils.h"
 
+// This define is used to remove warnings for CLAMP makro when doying CLAMP((uint) 1, 0, 2)
+#define MYCLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) <= (low)) ? (low) : (x)))
+
 using namespace std;
 
 
@@ -717,11 +720,10 @@ void GnomeCmdAdvrenameProfileComponent::Private::on_counter_step_spin_value_chan
     g_signal_emit (component, signals[COUNTER_CHANGED], 0);
 }
 
-
 void GnomeCmdAdvrenameProfileComponent::Private::on_counter_digits_combo_value_changed (GtkWidget *combo, 
GnomeCmdAdvrenameProfileComponent *component)
 {
     component->profile.counter_width = gtk_combo_box_get_active (GTK_COMBO_BOX (combo));
-    component->profile.counter_width = CLAMP(component->profile.counter_width, 0, 16);
+    component->profile.counter_width = MYCLAMP(component->profile.counter_width, 0, 16);
     g_signal_emit (component, signals[COUNTER_CHANGED], 0);
 }
 


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