[gtkmm/wip/dboles/make_managed-3: 1/2] gtk-demo/demowindow: Avoid compiler warning by g++



commit a74c3321ca2ed69ae5afe58e0e20e73a1acae6a7
Author: Daniel Boles <dboles src gmail com>
Date:   Sun Oct 7 15:35:13 2018 +0100

    gtk-demo/demowindow: Avoid compiler warning by g++
    
    Flip the if/else case so that the /* Fall through */ comment comes
    before the next case label, which suppresses a warning from
    -Wimplicit-fallthrough and looks clearer anyway.

 demos/gtk-demo/demowindow.cc | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/demos/gtk-demo/demowindow.cc b/demos/gtk-demo/demowindow.cc
index 88c8e2a4..a758819d 100644
--- a/demos/gtk-demo/demowindow.cc
+++ b/demos/gtk-demo/demowindow.cc
@@ -350,14 +350,12 @@ void DemoWindow::load_file(const std::string& filename)
          while (isspace (*p))
            p++;
 
-          if (*p)
-          {
-            p = lines[i];
-            state++;
-            /* Fall through */
-          }
-         else
-           break;
+          if (!*p)
+            break;
+
+          p = lines[i];
+          state++;
+          /* Fall through */
 
        case 3:
          /* Reading program body */


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