]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/bool.qh
Uncrustify lib/*
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / bool.qh
index 7a719af409ca1aaa49cc602518ab12529341495f..34e8bfc66999b66968cc4b08e8de1b283167dbea 100644 (file)
@@ -2,36 +2,34 @@
 #define BOOL_H
 
 #ifndef QCC_SUPPORT_BOOL
-    // Boolean Constants
-    const int true     = 1;
-    const int false = 0;
+       // Boolean Constants
+       const int true  = 1;
+       const int false = 0;
 #endif
 
 // Transitional aliases
-[[deprecated("use true")]] [[alias("true")]] const bool TRUE;
-[[deprecated("use false")]] [[alias("false")]] const bool FALSE;
+[[deprecated("use true")]][[alias("true")]] const bool TRUE;
+[[deprecated("use false")]][[alias("false")]] const bool FALSE;
 
 // get true/false value of a string with multiple different inputs
 float InterpretBoolean(string input)
 {
-    switch (strtolower(input))
-    {
-        case "yes":
-        case "true":
-        case "on":
-            return true;
+       switch (strtolower(input))
+       {
+               case "yes":
+               case "true":
+               case "on":
+                       return true;
 
-        case "no":
-        case "false":
-        case "off":
-            return false;
+               case "no":
+               case "false":
+               case "off":
+                       return false;
 
-        default: return stof(input);
-    }
+               default: return stof(input);
+       }
 }
 
-float boolean(float value) { // if value is 0 return false (0), otherwise return true (1)
-    return (value == 0) ? false : true;
-}
+#define boolean(value) ((value) != 0)
 
 #endif