Skip to content

Commit

Permalink
misc compiler warning fixes (multiple compilers)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Feb 21, 2017
1 parent d9115fc commit ca792f1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/gui/console/ConsoleModel.cpp
Expand Up @@ -32,7 +32,7 @@ void ConsoleModel::SetCurrentCommandIndex(size_t index)

ConsoleCommand ConsoleModel::GetCurrentCommand()
{
if(currentCommandIndex < 0 || currentCommandIndex >= previousCommands.size())
if (currentCommandIndex >= previousCommands.size())
{
return ConsoleCommand("", 0, "");
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/game/GameView.cpp
Expand Up @@ -100,9 +100,9 @@ class SplitButton : public ui::Button
return;
SetToolTip(x, y);
}
virtual void TextPosition()
virtual void TextPosition(std::string ButtonText)
{
ui::Button::TextPosition();
ui::Button::TextPosition(ButtonText);
textPosition.X += 3;
}
void SetToolTips(std::string newToolTip1, std::string newToolTip2)
Expand Down
10 changes: 5 additions & 5 deletions src/gui/interface/Button.cpp
Expand Up @@ -16,10 +16,10 @@ Button::Button(Point position, Point size, std::string buttonText, std::string t
toggle(false),
actionCallback(NULL)
{
TextPosition();
TextPosition(ButtonText);
}

void Button::TextPosition()
void Button::TextPosition(std::string ButtonText)
{
buttonDisplayText = ButtonText;
if(buttonDisplayText.length())
Expand All @@ -38,13 +38,13 @@ void Button::TextPosition()
void Button::SetIcon(Icon icon)
{
Appearance.icon = icon;
TextPosition();
TextPosition(ButtonText);
}

void Button::SetText(std::string buttonText)
{
ButtonText = buttonText;
TextPosition();
TextPosition(ButtonText);
}

void Button::SetTogglable(bool togglable)
Expand Down Expand Up @@ -72,7 +72,7 @@ void Button::Draw(const Point& screenPos)
{
if(!drawn)
{
TextPosition();
TextPosition(ButtonText);
drawn = true;
}
Graphics * g = ui::Engine::Ref().g;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/interface/Button.h
Expand Up @@ -34,7 +34,7 @@ class Button : public Component

virtual void Draw(const Point& screenPos);

virtual void TextPosition();
virtual void TextPosition(std::string);
inline bool GetState() { return state; }
virtual void DoAction(); //action of button what ever it may be
virtual void DoAltAction(); //action of button what ever it may be
Expand Down
5 changes: 1 addition & 4 deletions src/gui/interface/Textbox.cpp
Expand Up @@ -202,10 +202,7 @@ void Textbox::pasteIntoSelection()

if (limit != std::string::npos)
{
if(limit-backingText.length() >= 0)
newText = newText.substr(0, limit-backingText.length());
else
newText = "";
newText = newText.substr(0, limit-backingText.length());
}
if (!multiline && Graphics::textwidth((char*)std::string(backingText+newText).c_str()) > regionWidth)
{
Expand Down

0 comments on commit ca792f1

Please sign in to comment.