[gtkmm/wip/dboles/make_managed-4: 1/2] gtk-demo/demowindow: Avoid compiler warning by g++
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/wip/dboles/make_managed-4: 1/2] gtk-demo/demowindow: Avoid compiler warning by g++
- Date: Sun, 7 Oct 2018 18:03:43 +0000 (UTC)
commit d19912063c0531c2d0b8310608fba114ab1667ed
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 | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/demos/gtk-demo/demowindow.cc b/demos/gtk-demo/demowindow.cc
index d7e99ae0..3c02f36d 100644
--- a/demos/gtk-demo/demowindow.cc
+++ b/demos/gtk-demo/demowindow.cc
@@ -361,20 +361,13 @@ void DemoWindow::load_file(const std::string& filename)
while (isspace (*p))
p++;
- if (*p)
- {
- p = lines[i];
- state++;
- /* Fall through */
- // TODO: Replace with [[fallthrough]] annotation (to case 3)
- // when we ue C++17.
- /* Reading program body */
- start = refBufferSource->insert(start, p);
- start = refBufferSource->insert(start, "\n");
+ if (!*p)
break;
- }
- else
- break;
+
+ p = lines[i];
+ state++;
+ /* Fall through */
+ // TODO: Replace with [[fallthrough]] annotation once we use C++17
case 3:
/* Reading program body */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]