Skip to content

Commit

Permalink
Fix a couple of warnings that cropped up in VC++ 2017
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jul 12, 2017
1 parent 157f9eb commit b911db0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
5 changes: 3 additions & 2 deletions libs/picomodel/picomodel.c
Expand Up @@ -1408,8 +1408,9 @@ int PicoGetHashTableSize( void )
unsigned int calculateHash(unsigned char* str, size_t len)
{
unsigned int hash = 5381;
int c, i;

int c;
size_t i;

for (i = 0; i < len; ++i)
{
c = str[i];
Expand Down
6 changes: 3 additions & 3 deletions plugins/dm.gui/ReadableEditorDialog.cpp
Expand Up @@ -1202,11 +1202,11 @@ void ReadableEditorDialog::checkGuiLayout()
if (dialog.run() == ui::IDialog::RESULT_YES)
{
XData::PageLayout layoutBefore = _xData->getPageLayout();
std::string guiName = GuiSelector::Run(_xData->getPageLayout() == XData::TwoSided, this);
std::string selectedGuiName = GuiSelector::Run(_xData->getPageLayout() == XData::TwoSided, this);

if (!guiName.empty())
if (!selectedGuiName.empty())
{
_guiEntry->SetValue(guiName);
_guiEntry->SetValue(selectedGuiName);
_runningGuiLayoutCheck = false;
updateGuiView();
return;
Expand Down
6 changes: 3 additions & 3 deletions plugins/dm.gui/gui/GuiScript.cpp
Expand Up @@ -222,10 +222,10 @@ void GuiScript::switchOnToken(const std::string& token, parser::DefTokeniser& to
// Another block, a group of statements, enter recursion
while (tokeniser.hasMoreTokens() && _curLevel == blockLevel)
{
std::string token = tokeniser.nextToken();
boost::algorithm::to_lower(token);
std::string nextToken = tokeniser.nextToken();
boost::algorithm::to_lower(nextToken);

switchOnToken(token, tokeniser);
switchOnToken(nextToken, tokeniser);
}
}
else if (token == "set")
Expand Down
18 changes: 9 additions & 9 deletions plugins/dm.gui/gui/GuiWindowDef.cpp
Expand Up @@ -264,11 +264,11 @@ void GuiWindowDef::constructFromTokens(parser::DefTokeniser& tokeniser)
std::string timeStr = tokeniser.nextToken();

// Check the time for validity
std::size_t time = string::convert<std::size_t>(
std::size_t onTime = string::convert<std::size_t>(
timeStr, std::numeric_limits<std::size_t>::max()
);

if (time == std::numeric_limits<std::size_t>::max())
if (onTime == std::numeric_limits<std::size_t>::max())
{
rWarning() << "Invalid time encountered in onTime event in "
<< name << ": " << timeStr << std::endl;
Expand All @@ -279,7 +279,7 @@ void GuiWindowDef::constructFromTokens(parser::DefTokeniser& tokeniser)

script->constructFromTokens(tokeniser);

_timedEvents.insert(TimedEventMap::value_type(time, script));
_timedEvents.insert(TimedEventMap::value_type(onTime, script));
}
else if (token == "onnamedevent")
{
Expand Down Expand Up @@ -399,25 +399,25 @@ void GuiWindowDef::update(const std::size_t timeStep, bool updateChildren)
}
}

void GuiWindowDef::initTime(const std::size_t time, bool updateChildren)
void GuiWindowDef::initTime(const std::size_t toTime, bool updateChildren)
{
this->time = time;
this->time = toTime;

if (updateChildren)
{
for (ChildWindows::const_iterator i = children.begin(); i != children.end(); ++i)
{
(*i)->initTime(time, updateChildren);
(*i)->initTime(toTime, updateChildren);
}
}
}

GuiWindowDefPtr GuiWindowDef::findWindowDef(const std::string& name)
GuiWindowDefPtr GuiWindowDef::findWindowDef(const std::string& windowName)
{
// First look at all direct children
for (ChildWindows::const_iterator i = children.begin(); i != children.end(); ++i)
{
if ((*i)->name == name)
if ((*i)->name == windowName)
{
return (*i);
}
Expand All @@ -426,7 +426,7 @@ GuiWindowDefPtr GuiWindowDef::findWindowDef(const std::string& name)
// Not found, ask each child to search for the windowDef
for (ChildWindows::const_iterator i = children.begin(); i != children.end(); ++i)
{
GuiWindowDefPtr window = (*i)->findWindowDef(name);
GuiWindowDefPtr window = (*i)->findWindowDef(windowName);

if (window != NULL) return window;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/particles/StageDef.cpp
Expand Up @@ -551,7 +551,7 @@ Vector4 StageDef::parseVector4(parser::DefTokeniser& tok)

std::ostream& operator<<(std::ostream& stream, const StageDef& stage)
{
std::size_t prevPrecision = stream.precision();
std::streamsize prevPrecision = stream.precision();

// Three post-comma digits precision
stream.precision(3);
Expand Down
1 change: 0 additions & 1 deletion tools/msvc/dm.stimresponse.vcxproj
Expand Up @@ -121,7 +121,6 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>true</MinimalRebuild>
<ExceptionHandling>
</ExceptionHandling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
Expand Down

0 comments on commit b911db0

Please sign in to comment.