general: Enforce C4800 everywhere except in video_core

This commit is contained in:
Morph 2022-10-21 02:34:06 -04:00
parent 93297d14d8
commit e6ab1f673b
14 changed files with 57 additions and 41 deletions

View file

@ -774,6 +774,7 @@ if (MSVC)
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
/we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
/we4800 # Implicit conversion from 'type' to bool. Possible information loss
)
else()
target_compile_options(core PRIVATE

View file

@ -127,7 +127,7 @@ void ProgramMetadata::LoadManual(bool is_64_bit, ProgramAddressSpaceType address
}
bool ProgramMetadata::Is64BitProgram() const {
return npdm_header.has_64_bit_instructions;
return npdm_header.has_64_bit_instructions.As<bool>();
}
ProgramAddressSpaceType ProgramMetadata::GetAddressSpaceType() const {

View file

@ -1158,27 +1158,27 @@ bool EmulatedController::IsControllerSupported(bool use_temporary_value) const {
const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type;
switch (type) {
case NpadStyleIndex::ProController:
return supported_style_tag.fullkey;
return supported_style_tag.fullkey.As<bool>();
case NpadStyleIndex::Handheld:
return supported_style_tag.handheld;
return supported_style_tag.handheld.As<bool>();
case NpadStyleIndex::JoyconDual:
return supported_style_tag.joycon_dual;
return supported_style_tag.joycon_dual.As<bool>();
case NpadStyleIndex::JoyconLeft:
return supported_style_tag.joycon_left;
return supported_style_tag.joycon_left.As<bool>();
case NpadStyleIndex::JoyconRight:
return supported_style_tag.joycon_right;
return supported_style_tag.joycon_right.As<bool>();
case NpadStyleIndex::GameCube:
return supported_style_tag.gamecube;
return supported_style_tag.gamecube.As<bool>();
case NpadStyleIndex::Pokeball:
return supported_style_tag.palma;
return supported_style_tag.palma.As<bool>();
case NpadStyleIndex::NES:
return supported_style_tag.lark;
return supported_style_tag.lark.As<bool>();
case NpadStyleIndex::SNES:
return supported_style_tag.lucia;
return supported_style_tag.lucia.As<bool>();
case NpadStyleIndex::N64:
return supported_style_tag.lagoon;
return supported_style_tag.lagoon.As<bool>();
case NpadStyleIndex::SegaGenesis:
return supported_style_tag.lager;
return supported_style_tag.lager.As<bool>();
default:
return false;
}

View file

@ -751,8 +751,8 @@ static void Break(Core::System& system, u32 reason, u64 info1, u64 info2) {
}
system.GetReporter().SaveSvcBreakReport(
static_cast<u32>(break_reason.break_type.Value()), break_reason.signal_debugger, info1,
info2, has_dumped_buffer ? std::make_optional(debug_buffer) : std::nullopt);
static_cast<u32>(break_reason.break_type.Value()), break_reason.signal_debugger.As<bool>(),
info1, info2, has_dumped_buffer ? std::make_optional(debug_buffer) : std::nullopt);
if (!break_reason.signal_debugger) {
LOG_CRITICAL(

View file

@ -164,7 +164,7 @@ protected:
u32_le size;
u32_le library_version;
u32_le theme_color;
u8 play_startup_sound;
bool play_startup_sound;
u64_le system_tick;
};
static_assert(sizeof(CommonArguments) == 0x20, "CommonArguments has incorrect size.");

View file

@ -1502,25 +1502,25 @@ bool Controller_NPad::IsControllerSupported(Core::HID::NpadStyleIndex controller
Core::HID::NpadStyleTag style = GetSupportedStyleSet();
switch (controller) {
case Core::HID::NpadStyleIndex::ProController:
return style.fullkey;
return style.fullkey.As<bool>();
case Core::HID::NpadStyleIndex::JoyconDual:
return style.joycon_dual;
return style.joycon_dual.As<bool>();
case Core::HID::NpadStyleIndex::JoyconLeft:
return style.joycon_left;
return style.joycon_left.As<bool>();
case Core::HID::NpadStyleIndex::JoyconRight:
return style.joycon_right;
return style.joycon_right.As<bool>();
case Core::HID::NpadStyleIndex::GameCube:
return style.gamecube;
return style.gamecube.As<bool>();
case Core::HID::NpadStyleIndex::Pokeball:
return style.palma;
return style.palma.As<bool>();
case Core::HID::NpadStyleIndex::NES:
return style.lark;
return style.lark.As<bool>();
case Core::HID::NpadStyleIndex::SNES:
return style.lucia;
return style.lucia.As<bool>();
case Core::HID::NpadStyleIndex::N64:
return style.lagoon;
return style.lagoon.As<bool>();
case Core::HID::NpadStyleIndex::SegaGenesis:
return style.lager;
return style.lager.As<bool>();
default:
return false;
}