Add fallthrough notes to intentional fallthroughs against compiler warnings and for better code readability

This commit is contained in:
KockaAdmiralac 2018-07-15 22:04:09 +02:00
parent f7b3f1ba17
commit e75ef54a75
No known key found for this signature in database
GPG Key ID: A6007A5107D8CFBD
3 changed files with 7 additions and 0 deletions

View File

@ -78,9 +78,11 @@ void ALStream::close()
case Playing: case Playing:
case Paused: case Paused:
stopStream(); stopStream();
/* falls through */
case Stopped: case Stopped:
closeSource(); closeSource();
state = Closed; state = Closed;
/* falls through */
case Closed: case Closed:
return; return;
} }
@ -95,8 +97,10 @@ void ALStream::open(const std::string &filename)
case Playing: case Playing:
case Paused: case Paused:
stopStream(); stopStream();
/* falls through */
case Stopped: case Stopped:
closeSource(); closeSource();
/* falls through */
case Closed: case Closed:
openSource(filename); openSource(filename);
} }

View File

@ -119,9 +119,11 @@ void AudioStream::play(const std::string &filename,
case ALStream::Paused : case ALStream::Paused :
case ALStream::Playing : case ALStream::Playing :
stream.stop(); stream.stop();
/* falls through */
case ALStream::Stopped : case ALStream::Stopped :
if (diffFile) if (diffFile)
stream.close(); stream.close();
/* falls through */
case ALStream::Closed : case ALStream::Closed :
if (diffFile) if (diffFile)
{ {

View File

@ -455,6 +455,7 @@ void EventThread::process(RGSSThreadData &rtData)
case SDL_FINGERDOWN : case SDL_FINGERDOWN :
i = event.tfinger.fingerId; i = event.tfinger.fingerId;
touchState.fingers[i].down = true; touchState.fingers[i].down = true;
/* falls through */
case SDL_FINGERMOTION : case SDL_FINGERMOTION :
i = event.tfinger.fingerId; i = event.tfinger.fingerId;