1
0
Fork 0
forked from suyu/suyu

Merge pull request #4526 from lioncash/core-semi

core: Resolve several -Wextra-semi warnings
This commit is contained in:
bunnei 2020-08-15 02:14:11 -04:00 committed by GitHub
commit 2b601e8636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 7 deletions

View file

@ -342,8 +342,9 @@ ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) {
*/ */
#define CASCADE_RESULT(target, source) \ #define CASCADE_RESULT(target, source) \
auto CONCAT2(check_result_L, __LINE__) = source; \ auto CONCAT2(check_result_L, __LINE__) = source; \
if (CONCAT2(check_result_L, __LINE__).Failed()) \ if (CONCAT2(check_result_L, __LINE__).Failed()) { \
return CONCAT2(check_result_L, __LINE__).Code(); \ return CONCAT2(check_result_L, __LINE__).Code(); \
} \
target = std::move(*CONCAT2(check_result_L, __LINE__)) target = std::move(*CONCAT2(check_result_L, __LINE__))
/** /**
@ -351,6 +352,9 @@ ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) {
* non-success, or discarded otherwise. * non-success, or discarded otherwise.
*/ */
#define CASCADE_CODE(source) \ #define CASCADE_CODE(source) \
auto CONCAT2(check_result_L, __LINE__) = source; \ do { \
if (CONCAT2(check_result_L, __LINE__).IsError()) \ auto CONCAT2(check_result_L, __LINE__) = source; \
return CONCAT2(check_result_L, __LINE__); if (CONCAT2(check_result_L, __LINE__).IsError()) { \
return CONCAT2(check_result_L, __LINE__); \
} \
} while (false)

View file

@ -90,7 +90,7 @@ u32 Controller_NPad::IndexToNPad(std::size_t index) {
default: default:
UNIMPLEMENTED_MSG("Unknown npad index {}", index); UNIMPLEMENTED_MSG("Unknown npad index {}", index);
return 0; return 0;
}; }
} }
Controller_NPad::Controller_NPad(Core::System& system) : ControllerBase(system), system(system) {} Controller_NPad::Controller_NPad(Core::System& system) : ControllerBase(system), system(system) {}
@ -630,7 +630,7 @@ Controller_NPad::LedPattern Controller_NPad::GetLedPattern(u32 npad_id) {
default: default:
UNIMPLEMENTED_MSG("Unhandled npad_id {}", npad_id); UNIMPLEMENTED_MSG("Unhandled npad_id {}", npad_id);
return LedPattern{0, 0, 0, 0}; return LedPattern{0, 0, 0, 0};
}; }
} }
void Controller_NPad::SetVibrationEnabled(bool can_vibrate) { void Controller_NPad::SetVibrationEnabled(bool can_vibrate) {

View file

@ -21,8 +21,9 @@ namespace Service::Nvidia::Devices {
/// implement the ioctl interface. /// implement the ioctl interface.
class nvdevice { class nvdevice {
public: public:
explicit nvdevice(Core::System& system) : system{system} {}; explicit nvdevice(Core::System& system) : system{system} {}
virtual ~nvdevice() = default; virtual ~nvdevice() = default;
union Ioctl { union Ioctl {
u32_le raw; u32_le raw;
BitField<0, 8, u32> cmd; BitField<0, 8, u32> cmd;