13
0

handle compiler stupidity with early return

This commit is contained in:
Paul Davis 2022-06-21 18:42:31 -06:00
parent f7b91d577b
commit 7a32ff33d4

View File

@ -1284,20 +1284,20 @@ void LaunchControlXL::set_track_mode (TrackMode mode) {
LEDColor color_on, color_off; LEDColor color_on, color_off;
switch(mode) { switch(mode) {
case TrackMute: case TrackMute:
color_on = YellowFull; color_on = YellowFull;
color_off = YellowLow; color_off = YellowLow;
break;
case TrackSolo:
color_on = GreenFull;
color_off = GreenLow;
break;
case TrackRecord:
color_on = RedFull;
color_off = RedLow;
break;
default:
break; break;
case TrackSolo:
color_on = GreenFull;
color_off = GreenLow;
break;
case TrackRecord:
color_on = RedFull;
color_off = RedLow;
break;
default:
return; /* stupid compilers */
} }
for ( size_t n = 0 ; n < sizeof (trk_cntrl_btns) / sizeof (trk_cntrl_btns[0]); ++n) { for ( size_t n = 0 ; n < sizeof (trk_cntrl_btns) / sizeof (trk_cntrl_btns[0]); ++n) {