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 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);
}

View file

@ -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)
{

View file

@ -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;