chore(cpn): stop compiler warnings (#6523)

This commit is contained in:
Neil Horne
2025-08-17 20:17:47 +10:00
committed by GitHub
parent d6b765f677
commit a9a0edefe8
3 changed files with 18 additions and 4 deletions
+12 -1
View File
@@ -436,7 +436,7 @@ void GeneralSettings::convert(RadioDataConversionState & cstate)
// Try to intelligently copy any custom controls
// step 1 clear current config
memset(&inputConfig[0], 0, sizeof(InputConfig) * CPN_MAX_INPUTS);
memset(&switchConfig[0], 0, sizeof(SwitchConfig) * CPN_MAX_SWITCHES);
switchConfigClear();
// step 2 load default config
setDefaultControlTypes(cstate.toType);
// step 3 copy matching config based on tags
@@ -1006,3 +1006,14 @@ AbstractStaticItemModel * GeneralSettings::templateSetupItemModel()
mdl->loadItemList();
return mdl;
}
GeneralSettings::SwitchConfig::SwitchConfig()
{
memset((void*)this, 0, sizeof(SwitchConfig));
}
void GeneralSettings::switchConfigClear()
{
for (int i = 0; i < CPN_MAX_SWITCHES; i++)
switchConfig[i] = SwitchConfig();
}