From e75ef54a7507dde7957398970e53af246a6f0245 Mon Sep 17 00:00:00 2001 From: KockaAdmiralac <1405223@gmail.com> Date: Sun, 15 Jul 2018 22:04:09 +0200 Subject: [PATCH] Add fallthrough notes to intentional fallthroughs against compiler warnings and for better code readability --- src/alstream.cpp | 4 ++++ src/audiostream.cpp | 2 ++ src/eventthread.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/src/alstream.cpp b/src/alstream.cpp index d423953..9746061 100644 --- a/src/alstream.cpp +++ b/src/alstream.cpp @@ -78,9 +78,11 @@ void ALStream::close() case Playing: case Paused: stopStream(); + /* falls through */ case Stopped: closeSource(); state = Closed; + /* falls through */ case Closed: return; } @@ -95,8 +97,10 @@ void ALStream::open(const std::string &filename) case Playing: case Paused: stopStream(); + /* falls through */ case Stopped: closeSource(); + /* falls through */ case Closed: openSource(filename); } diff --git a/src/audiostream.cpp b/src/audiostream.cpp index 5302497..72b9642 100644 --- a/src/audiostream.cpp +++ b/src/audiostream.cpp @@ -119,9 +119,11 @@ void AudioStream::play(const std::string &filename, case ALStream::Paused : case ALStream::Playing : stream.stop(); + /* falls through */ case ALStream::Stopped : if (diffFile) stream.close(); + /* falls through */ case ALStream::Closed : if (diffFile) { diff --git a/src/eventthread.cpp b/src/eventthread.cpp index 25e5c78..400cdd0 100644 --- a/src/eventthread.cpp +++ b/src/eventthread.cpp @@ -455,6 +455,7 @@ void EventThread::process(RGSSThreadData &rtData) case SDL_FINGERDOWN : i = event.tfinger.fingerId; touchState.fingers[i].down = true; + /* falls through */ case SDL_FINGERMOTION : i = event.tfinger.fingerId;