Skip to content

Commit 4953b14

Browse files
committed
Issue #7
Remove default clause of adau1361.cpp and use -Wswitch-enum to detect the coverage error. Test passed.
1 parent 5695bef commit 4953b14

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/codec/adau1361.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
* Author: Seiichi "Suikan" Horie
66
*/
77

8+
// GCC/Clang : Promote the switch-enum warning to error.
9+
// MSVC : ignored.
10+
#pragma GCC diagnostic error "-Wswitch-enum"
11+
812
#include "adau1361.hpp"
913

1014
#include <assert.h>
@@ -94,9 +98,6 @@ void ::rpp_driver::Adau1361::SetGain(CodecChannel channel, float left_gain,
9498
adau1361_lower_.SetHpOutputGain(hp_output_left_gain_,
9599
hp_output_right_gain_, hp_output_mute_);
96100
break;
97-
default:
98-
assert(false);
99-
break;
100101
}
101102
CODEC_SYSLOG("Leave.")
102103
}
@@ -130,9 +131,6 @@ void ::rpp_driver::Adau1361::Mute(CodecChannel channel, bool mute) {
130131
adau1361_lower_.SetHpOutputGain(hp_output_left_gain_,
131132
hp_output_right_gain_, hp_output_mute_);
132133
break;
133-
default:
134-
assert(false);
135-
break;
136134
}
137135
CODEC_SYSLOG("Leave.")
138136
}

0 commit comments

Comments
 (0)