chore(cpn): stop compiler warnings (#6523)
This commit is contained in:
@@ -436,7 +436,7 @@ void GeneralSettings::convert(RadioDataConversionState & cstate)
|
|||||||
// Try to intelligently copy any custom controls
|
// Try to intelligently copy any custom controls
|
||||||
// step 1 clear current config
|
// step 1 clear current config
|
||||||
memset(&inputConfig[0], 0, sizeof(InputConfig) * CPN_MAX_INPUTS);
|
memset(&inputConfig[0], 0, sizeof(InputConfig) * CPN_MAX_INPUTS);
|
||||||
memset(&switchConfig[0], 0, sizeof(SwitchConfig) * CPN_MAX_SWITCHES);
|
switchConfigClear();
|
||||||
// step 2 load default config
|
// step 2 load default config
|
||||||
setDefaultControlTypes(cstate.toType);
|
setDefaultControlTypes(cstate.toType);
|
||||||
// step 3 copy matching config based on tags
|
// step 3 copy matching config based on tags
|
||||||
@@ -1006,3 +1006,14 @@ AbstractStaticItemModel * GeneralSettings::templateSetupItemModel()
|
|||||||
mdl->loadItemList();
|
mdl->loadItemList();
|
||||||
return mdl;
|
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();
|
||||||
|
}
|
||||||
|
|||||||
@@ -379,9 +379,12 @@ class GeneralSettings {
|
|||||||
unsigned int offColorLuaOverride;
|
unsigned int offColorLuaOverride;
|
||||||
RGBLedColor onColor;
|
RGBLedColor onColor;
|
||||||
RGBLedColor offColor;
|
RGBLedColor offColor;
|
||||||
|
|
||||||
|
SwitchConfig();
|
||||||
};
|
};
|
||||||
|
|
||||||
SwitchConfig switchConfig[CPN_MAX_SWITCHES];
|
SwitchConfig switchConfig[CPN_MAX_SWITCHES];
|
||||||
|
void switchConfigClear();
|
||||||
|
|
||||||
bool switchPositionAllowed(int index) const;
|
bool switchPositionAllowed(int index) const;
|
||||||
bool switchSourceAllowed(int index) const;
|
bool switchSourceAllowed(int index) const;
|
||||||
|
|||||||
@@ -1814,7 +1814,7 @@ AbstractStaticItemModel * ModelData::funcSwitchGroupsModel()
|
|||||||
mdl->setName(AIM_MODELDATA_FUNCSWITCHGROUPS);
|
mdl->setName(AIM_MODELDATA_FUNCSWITCHGROUPS);
|
||||||
|
|
||||||
mdl->appendToItemList(tr("---"), 0);
|
mdl->appendToItemList(tr("---"), 0);
|
||||||
for (unsigned int i = 1; i <= Boards::getCapability(getCurrentBoard(), Board::FunctionSwitchGroups); i += 1) {
|
for (int i = 1; i <= Boards::getCapability(getCurrentBoard(), Board::FunctionSwitchGroups); i++) {
|
||||||
mdl->appendToItemList(tr("Group ") + QString::number(i), i);
|
mdl->appendToItemList(tr("Group ") + QString::number(i), i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1838,7 +1838,7 @@ void ModelData::setFuncSwitchGroup(unsigned int index, unsigned int value)
|
|||||||
|
|
||||||
unsigned int ModelData::getFuncSwitchAlwaysOnGroup(unsigned int group) const
|
unsigned int ModelData::getFuncSwitchAlwaysOnGroup(unsigned int group) const
|
||||||
{
|
{
|
||||||
if (group > 0 && group <= Boards::getCapability(getCurrentBoard(), Board::FunctionSwitchGroups)) {
|
if (group > 0 && group <= (unsigned int)Boards::getCapability(getCurrentBoard(), Board::FunctionSwitchGroups)) {
|
||||||
return cfsGroupOn[group];
|
return cfsGroupOn[group];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1855,7 +1855,7 @@ unsigned int ModelData::getFuncSwitchAlwaysOnGroupForSwitch(unsigned int index)
|
|||||||
|
|
||||||
void ModelData::setFuncSwitchAlwaysOnGroup(unsigned int group, unsigned int value)
|
void ModelData::setFuncSwitchAlwaysOnGroup(unsigned int group, unsigned int value)
|
||||||
{
|
{
|
||||||
if (group > 0 && group <= Boards::getCapability(getCurrentBoard(), Board::FunctionSwitchGroups)) {
|
if (group > 0 && group <= (unsigned int)Boards::getCapability(getCurrentBoard(), Board::FunctionSwitchGroups)) {
|
||||||
cfsGroupOn[group] = value;
|
cfsGroupOn[group] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user