Skip to content

Commit

Permalink
resolve several warnings thrown by msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Jul 18, 2021
1 parent 78dba8f commit 31117f8
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 73 deletions.
8 changes: 4 additions & 4 deletions src/Etterna/Actor/Menus/DifficultyList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ StepsDisplayList::UpdatePositions()
void
StepsDisplayList::PositionItems()
{
for (auto i = 0; i < m_Lines.size(); ++i) {
const bool bUnused = i >= static_cast<int>(m_Rows.size());
for (size_t i = 0; i < m_Lines.size(); ++i) {
const bool bUnused = i >= m_Rows.size();
m_Lines[i].m_Meter.SetVisible(!bUnused);
}

Expand All @@ -226,9 +226,9 @@ StepsDisplayList::PositionItems()
m_Lines[m].m_Meter.SetY(row.m_fY);
}

for (auto m = 0; m < m_Lines.size(); ++m) {
for (size_t m = 0; m < m_Lines.size(); ++m) {
bool bHidden = true;
if (m_bShown && m < static_cast<int>(m_Rows.size()))
if (m_bShown && m < m_Rows.size())
bHidden = m_Rows[m].m_bHidden;

const float fDiffuseAlpha = bHidden ? 0.0f : 1.0f;
Expand Down
10 changes: 3 additions & 7 deletions src/Etterna/Actor/Menus/OptionsList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,6 @@ OptionsList::SwitchMenu(int iDir)
TweenOnCurrentRow(iDir > 0);
}

void
OptionsList::MoveItem(const std::string& sRowName, int iMove)
{
}

bool
OptionsList::Input(const InputEventPlus& input)
{
Expand Down Expand Up @@ -479,10 +474,11 @@ OptionsList::Input(const InputEventPlus& input)
}

return true;
} else if (input.MenuI == GAME_BUTTON_SELECT) {
}
if (input.MenuI == GAME_BUTTON_SELECT) {
if (input.type != IET_FIRST_PRESS)
return false;
// if( input.type == IET_RELEASE )
//if( input.type == IET_RELEASE )
{
Close();
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/Etterna/Actor/Menus/OptionsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class OptionsList : public ActorFrame
ThemeMetric<std::string> TOP_MENU;

void SelectItem(const std::string& sRowName, int iMenuItem);
void MoveItem(const std::string& sRowName, int iMove);
void MoveItem(const std::string& sRowName, int iMove) {}
void SwitchMenu(int iDir);
void PositionCursor();
void SelectionsChanged(const std::string& sRowName);
Expand Down
2 changes: 1 addition & 1 deletion src/Etterna/MinaCalc/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ Calc::InitAdjDiff(Calc& calc, const int& hi)
std::array<float, NUM_Skillset> tp_mods = {};

// ok this loop is pretty wack i know, for each interval
for (auto i = 0; i < calc.numitv; ++i) {
for (size_t i = 0; i < static_cast<size_t>(calc.numitv); ++i) {
tp_mods.fill(1.F);

/* total pattern mods for each skillset, we want this to be
Expand Down
2 changes: 1 addition & 1 deletion src/Etterna/MinaCalc/UlbuAcolytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fast_walk_and_check_for_skip(const std::vector<NoteInfo>& ni,
calc.numitv = time_to_itv_idx(ni.back().rowTime / rate) + 1;

// are there more intervals than our emplaced max
if (calc.numitv >= calc.itv_size.size()) {
if (calc.numitv >= static_cast<int>(calc.itv_size.size())) {
// hard cap for memory considerations
if (calc.numitv >= max_intervals)
return true;
Expand Down
28 changes: 22 additions & 6 deletions src/Etterna/Models/Fonts/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,20 @@ Font::LoadFontPageSettings(FontPageSettings& cfg,

wchar_t c;
if (sCodepoint.substr(0, 2) == "U+" &&
IsHexVal(sCodepoint.substr(2)))
sscanf(sCodepoint.substr(2).c_str(), "%x", &c);
else if (sCodepoint.size() > 0 &&
IsHexVal(sCodepoint.substr(2))) {
int c2;
if (!sscanf(sCodepoint.substr(2).c_str(), "%x", &c2))
Locator::getLogger()->warn(
"Font definition '{}' has an invalid value '{}'.",
ini.GetPath().c_str(),
sName.c_str());
else
c = c2;
}
else if (!sCodepoint.empty() &&
utf8_get_char_len(sCodepoint[0]) ==
static_cast<int>(sCodepoint.size())) {
c = utf8_get_char(sCodepoint.c_str());
c = utf8_get_char(sCodepoint);
if (c == static_cast<wchar_t>(-1))
Locator::getLogger()->warn("Font definition '{}' has an invalid value '{}'.",
ini.GetPath().c_str(),
Expand Down Expand Up @@ -607,9 +615,17 @@ Font::LoadFontPageSettings(FontPageSettings& cfg,
int count = -1;
int first = 0;
if (!asMatches[2].empty()) {
sscanf(asMatches[2].c_str(), "%x", &first);
if (!sscanf(asMatches[2].c_str(), "%x", &first))
Locator::getLogger()->warn(
"Font definition {} parse error: {}",
ini.GetPath().c_str(),
sName.c_str());
int last;
sscanf(asMatches[3].c_str(), "%x", &last);
if (!sscanf(asMatches[3].c_str(), "%x", &last))
Locator::getLogger()->warn(
"Font definition {} parse error: {}",
ini.GetPath().c_str(),
sName.c_str());
if (last < first) {
LuaHelpers::ReportScriptErrorFmt(
"Font definition \"%s\" has an invalid range \"%s\": "
Expand Down
1 change: 1 addition & 0 deletions src/Etterna/Models/Misc/HighScore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ HighScore::LoadInputData() -> bool
e.what());
return false;
}
return true;
}

// should just get rid of impl -mina
Expand Down
Loading

0 comments on commit 31117f8

Please sign in to comment.