Permalink
Browse files

misc compiler warning fixes (multiple compilers)

  • Loading branch information...
jacob1 committed Feb 21, 2017
1 parent d9115fc commit ca792f12b5e104353e5281d23f15112d4ba9f5fe
@@ -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, "");
}
@@ -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)
@@ -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())
@@ -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)
@@ -72,7 +72,7 @@ void Button::Draw(const Point& screenPos)
{
if(!drawn)
{
TextPosition();
TextPosition(ButtonText);
drawn = true;
}
Graphics * g = ui::Engine::Ref().g;
@@ -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
@@ -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)
{

0 comments on commit ca792f1

Please sign in to comment.