Fix compiler warnings
[ctsim.git] / libctgraphics / ezset.cpp
index 872d4e95cc5be57eb292baec38208ce807cdc11b..8cde00af76f99493f7c008c55a584207d56a43e7 100644 (file)
@@ -4,9 +4,7 @@
 **      EZSET - Parameter control for EZPLOT
 **
 **  This is part of the CTSim program
-**  Copyright (c) 1983-2001 Kevin Rosenberg
-**
-**  $Id$
+**  Copyright (c) 1983-2009 Kevin Rosenberg
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -219,25 +217,33 @@ EZPlot::do_cmd (int lx)
     o_grid = FALSE;
     break;
   case S_XLENGTH:
-    if (m_pol.readFloat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
-      if (f > 0.0 && f <= 1.0)
+    if (m_pol.readFloat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+      if (f > 0.0 && f <= 1.0) {
         o_xlength = f;
-      break;
+      }
+    }
+    break;
   case S_YLENGTH:
-    if (m_pol.readFloat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
-      if (f > 0.0 && f <= 1.0)
+    if (m_pol.readFloat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+      if (f > 0.0 && f <= 1.0) {
         o_ylength = f;
-      break;
+      }
+    }
+    break;
   case S_XPORIGIN:
-    if (m_pol.readFloat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
-      if (f >= 0.0 && f < 1.0)
+    if (m_pol.readFloat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+      if (f >= 0.0 && f < 1.0) {
         o_xporigin = f;
-      break;
+      }
+    }
+    break;
   case S_YPORIGIN:
-    if (m_pol.readFloat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
-      if (f >= 0.0 && f < 1.0)
+    if (m_pol.readFloat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+      if (f >= 0.0 && f < 1.0) {
         o_yporigin = f;
-      break;
+      }
+    }
+    break;
   case S_TAG:
     if (m_pol.readWord("no", 2) == TRUE)
       o_tag = FALSE;
@@ -329,10 +335,12 @@ EZPlot::do_cmd (int lx)
         if (n > 1 && n < 100)
           o_xmajortick = n;
     } else if (lx == S_MINOR)
-      if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
-        if (n >= 0 && n < 100)
+      if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
+        if (n >= 0 && n < 100) {
           o_xminortick = n;
-        break;
+        }
+      }
+    break;
   case S_YTICKS:
     if (m_pol.readUserToken(str,&lx) == FALSE)
       break;
@@ -345,14 +353,18 @@ EZPlot::do_cmd (int lx)
     else if (lx == S_LABEL)
       o_ytlabel = TRUE;
     else if (lx == S_MAJOR) {
-      if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
-        if (n > 1 && n < 100)
+      if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
+        if (n > 1 && n < 100) {
           o_ymajortick = n;
-    } else if (lx == S_MINOR)
-      if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
-        if (n >= 0 && n < 100)
+        }
+      }
+    } else if (lx == S_MINOR) 
+      if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
+        if (n >= 0 && n < 100) {
           o_yminortick = n;
-        break;
+        }
+      }
+    break;
   case S_LXFRAC:
     if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
       if (n >= 0) {
@@ -384,7 +396,7 @@ EZPlot::do_cmd (int lx)
 
 
 void
-EZPlot::bad_option (char *opt)
+EZPlot::bad_option (const char *opt)
 {
   sys_error (ERR_WARNING, "INVALID option: %s", opt);
 }