- fix warning (fall through)

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7871 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 3e31cc826e5db4ab3f2b50b35e2ebace141da792
Former-commit-id: 0bc4abe3559c6520f417a9eeb021561b32fec28e
This commit is contained in:
torcs-ng 2022-01-05 16:32:51 +00:00
parent f61c1da1a7
commit 9d76275de9
5 changed files with 978 additions and 942 deletions

View file

@ -428,7 +428,7 @@ void TSimpleStrategy::Update(PtCarElt Car,
//==========================================================================* //==========================================================================*
// State (Sequential logic system) // State (Sequential logic system)
//--------------------------------------------------------------------------* //--------------------------------------------------------------------------*
void TSimpleStrategy::CheckPitState(float PitScaleBrake) void TSimpleStrategy::CheckPitState(float /*PitScaleBrake*/)
{ {
if (oPit == NULL) // No Pit no service if (oPit == NULL) // No Pit no service
return; return;
@ -485,8 +485,10 @@ void TSimpleStrategy::CheckPitState(float PitScaleBrake)
// We reached the poit to stopp // We reached the poit to stopp
oState = PIT_ASKED; oState = PIT_ASKED;
LogSimplix.debug("#PIT_ENTER: %g\n", TrackPos); LogSimplix.debug("#PIT_ENTER: %g\n", TrackPos);
// falls through... // falls through...
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
case PIT_ASKED: case PIT_ASKED:
// We are still going to the pit // We are still going to the pit
@ -496,7 +498,7 @@ void TSimpleStrategy::CheckPitState(float PitScaleBrake)
oDriver->oStanding = true; // For motion survey! oDriver->oStanding = true; // For motion survey!
oPitTicker = 0; // Start service timer oPitTicker = 0; // Start service timer
CarAccelCmd = 0; // release throttle CarAccelCmd = 0; // release throttle
CarBrakeCmd = 1.0 * PitScaleBrake; // Start braking CarBrakeCmd = 1.0; // Start braking
CarRaceCmd = RM_CMD_PIT_ASKED; // Tell TORCS to service us! To test oPitTicker comment out CarRaceCmd = RM_CMD_PIT_ASKED; // Tell TORCS to service us! To test oPitTicker comment out
oState = PIT_SERVICE; oState = PIT_SERVICE;
} }

View file

@ -138,6 +138,7 @@ grAdaptScreenSize(void)
switch (grNbArrangeScreens) { switch (grNbArrangeScreens) {
default: default:
grNbArrangeScreens = 0; grNbArrangeScreens = 0;
[[fallthrough]];
case 0: case 0:
// Top & Bottom half of the window // Top & Bottom half of the window
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw, grWinh / 2, 0.0); grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw, grWinh / 2, 0.0);
@ -167,6 +168,9 @@ grAdaptScreenSize(void)
switch (grNbArrangeScreens) { switch (grNbArrangeScreens) {
default: default:
grNbArrangeScreens = 0; grNbArrangeScreens = 0;
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
case 0: case 0:
// Left/Right below wide // Left/Right below wide
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw, grWinh / 2, 0.0); grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw, grWinh / 2, 0.0);
@ -224,8 +228,12 @@ grAdaptScreenSize(void)
grScreens[3]->activate(grWinx + grWinw * 3/4, grWiny, grWinw / 4, grWinh, 0.0); grScreens[3]->activate(grWinx + grWinw * 3/4, grWiny, grWinw / 4, grWinh, 0.0);
break; break;
} }
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
default: default:
grNbArrangeScreens = 0; grNbArrangeScreens = 0;
[[fallthrough]];
case 0: case 0:
// Top/Bottom Left/Rigth Quarters // Top/Bottom Left/Rigth Quarters
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0); grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
@ -290,6 +298,9 @@ grAdaptScreenSize(void)
switch (grNbArrangeScreens) { switch (grNbArrangeScreens) {
default: default:
grNbArrangeScreens = 0; grNbArrangeScreens = 0;
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
case 0: case 0:
// Top/Bottom Left/Middle/Rigth Matrix // Top/Bottom Left/Middle/Rigth Matrix
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0); grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
@ -323,8 +334,14 @@ grAdaptScreenSize(void)
grScreens[5]->activate(grWinx + grWinw * 5/6, grWiny, grWinw / 6, grWinh, 0.0); grScreens[5]->activate(grWinx + grWinw * 5/6, grWiny, grWinw / 6, grWinh, 0.0);
break; break;
} }
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
default: default:
grNbArrangeScreens = 0; grNbArrangeScreens = 0;
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
case 0: case 0:
// Top/Bottom Left/Middle/Rigth Matrix // Top/Bottom Left/Middle/Rigth Matrix
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 3, grWinh / 2, 0.0); grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 3, grWinh / 2, 0.0);

View file

@ -320,6 +320,9 @@ ReStoreRaceResults(const char *race)
GfParmReleaseHandle(carparam); GfParmReleaseHandle(carparam);
break; break;
} }
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
/* Otherwise, fall through */ /* Otherwise, fall through */
case RM_TYPE_QUALIF: case RM_TYPE_QUALIF:

View file

@ -54,8 +54,10 @@ ReStateManage(void)
{ {
int mode = RM_SYNC | RM_NEXT_STEP; int mode = RM_SYNC | RM_NEXT_STEP;
do { do
switch (ReInfo->_reState) { {
switch (ReInfo->_reState)
{
case RE_STATE_CONFIG: case RE_STATE_CONFIG:
GfLogInfo("%s now in CONFIG state\n", ReInfo->_reName); GfLogInfo("%s now in CONFIG state\n", ReInfo->_reName);
// Race configuration // Race configuration
@ -73,6 +75,9 @@ ReStateManage(void)
GfMemoryManagerSetGroup(1); GfMemoryManagerSetGroup(1);
#endif #endif
// ... Use new Memory Manager // ... Use new Memory Manager
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
case RE_STATE_EVENT_LOOP: case RE_STATE_EVENT_LOOP:
GfLogInfo("%s now in EVENT_INIT_LOOP state\n", ReInfo->_reName); GfLogInfo("%s now in EVENT_INIT_LOOP state\n", ReInfo->_reName);

View file

@ -347,18 +347,27 @@ void Application::generate()
if (DoSaveElevation) { if (DoSaveElevation) {
break; break;
} }
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
case 2: case 2:
sprintf(buf, "%s-elv2.png", OutputFileName); sprintf(buf, "%s-elv2.png", OutputFileName);
SaveElevation(Track, TrackHandle, buf, OutMeshName, 1); SaveElevation(Track, TrackHandle, buf, OutMeshName, 1);
if (DoSaveElevation) { if (DoSaveElevation) {
break; break;
} }
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
case 3: case 3:
sprintf(buf, "%s-elv3.png", OutputFileName); sprintf(buf, "%s-elv3.png", OutputFileName);
SaveElevation(Track, TrackHandle, buf, OutMeshName, 0); SaveElevation(Track, TrackHandle, buf, OutMeshName, 0);
if (DoSaveElevation) { if (DoSaveElevation) {
break; break;
} }
#if ( __GNUC__ >= 5 || _MSVC_VER >= 1910)
[[fallthrough]];
#endif
case 4: case 4:
sprintf(buf, "%s-elv4.png", OutputFileName); sprintf(buf, "%s-elv4.png", OutputFileName);
SaveElevation(Track, TrackHandle, buf, OutTrackName, 2); SaveElevation(Track, TrackHandle, buf, OutTrackName, 2);