Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / selection / sm_compare.cpp
index 8e4af8ba70739c643b6d9b1dd69a9efb2b87b6f1..51aa8a6d47d49c7efb9d2f57aef3784c23f3d1dd 100644 (file)
 #include <cmath>
 
 #include "gromacs/legacyheaders/macros.h"
-
 #include "gromacs/math/utilities.h"
-#include "gromacs/selection/selmethod.h"
 #include "gromacs/utility/common.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/smalloc.h"
 
+#include "selmethod.h"
+
 /** Defines the comparison operator for comparison expressions. */
 typedef enum
 {
@@ -199,17 +199,20 @@ comparison_type(char *str)
 static const char *
 comparison_type_str(e_comparison_t cmpt)
 {
+    const char *p = NULL;
     switch (cmpt)
     {
-        case CMP_INVALID: return "INVALID"; break;
-        case CMP_LESS:    return "<";  break;
-        case CMP_LEQ:     return "<="; break;
-        case CMP_GTR:     return ">";  break;
-        case CMP_GEQ:     return ">="; break;
-        case CMP_EQUAL:   return "=="; break;
-        case CMP_NEQ:     return "!="; break;
+        case CMP_INVALID: p = "INVALID"; break;
+        case CMP_LESS:    p = "<";       break;
+        case CMP_LEQ:     p = "<=";      break;
+        case CMP_GTR:     p = ">";       break;
+        case CMP_GEQ:     p = ">=";      break;
+        case CMP_EQUAL:   p = "==";      break;
+        case CMP_NEQ:     p = "!=";      break;
+            // No default clause so we intentionally get compiler errors
+            // if new selection choices are added later.
     }
-    return NULL;
+    return p;
 }
 
 /*!