[Orxonox-commit 5010] r9676 - in code/trunk/src: libraries/core/command orxonox/gametypes
landauf at orxonox.net
landauf at orxonox.net
Sun Sep 29 16:27:06 CEST 2013
Author: landauf
Date: 2013-09-29 16:27:05 +0200 (Sun, 29 Sep 2013)
New Revision: 9676
Modified:
code/trunk/src/libraries/core/command/IOConsoleWindows.cc
code/trunk/src/libraries/core/command/IOConsoleWindows.h
code/trunk/src/orxonox/gametypes/Dynamicmatch.h
Log:
fixed warnings with gcc 4.7
Modified: code/trunk/src/libraries/core/command/IOConsoleWindows.cc
===================================================================
--- code/trunk/src/libraries/core/command/IOConsoleWindows.cc 2013-09-26 21:03:33 UTC (rev 9675)
+++ code/trunk/src/libraries/core/command/IOConsoleWindows.cc 2013-09-29 14:27:05 UTC (rev 9676)
@@ -101,7 +101,7 @@
this->shell_->unregisterListener(this);
// Erase input and status lines
- COORD pos = {0, this->inputLineRow_};
+ COORD pos = makeCOORD(0, this->inputLineRow_);
this->writeText(std::string((this->inputLineHeight_ + this->statusLines_) * this->terminalWidth_, ' '), pos);
// Move cursor to the beginning of the line
SetConsoleCursorPosition(stdOutHandle_, pos);
@@ -296,12 +296,12 @@
if (linesDown > 0)
{
// Scroll input and status lines down
- SMALL_RECT oldRect = {0, this->inputLineRow_,
- this->terminalWidth_ - 1, this->inputLineRow_ + this->inputLineHeight_ + this->statusLines_ - 1};
+ SMALL_RECT oldRect = makeSMALL_RECT(0, this->inputLineRow_,
+ this->terminalWidth_ - 1, this->inputLineRow_ + this->inputLineHeight_ + this->statusLines_ - 1);
this->inputLineRow_ += linesDown;
ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, this->inputLineRow_), &fillChar);
// Move cursor down to the new bottom so the user can see the status lines
- COORD pos = {0, this->inputLineRow_ + this->inputLineHeight_ - 1 + this->statusLines_};
+ COORD pos = makeCOORD(0, this->inputLineRow_ + this->inputLineHeight_ - 1 + this->statusLines_);
SetConsoleCursorPosition(stdOutHandle_, pos);
// Get cursor back to the right position
this->cursorChanged();
@@ -310,7 +310,7 @@
if (lines - linesDown > 0)
{
// Scroll output up
- SMALL_RECT oldRect = {0, lines - linesDown, this->terminalWidth_ - 1, this->inputLineRow_ - 1};
+ SMALL_RECT oldRect = makeSMALL_RECT(0, lines - linesDown, this->terminalWidth_ - 1, this->inputLineRow_ - 1);
ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, 0), &fillChar);
}
}
@@ -357,13 +357,13 @@
{
// Scroll status lines up
int statusLineRow = this->inputLineRow_ + this->inputLineHeight_;
- SMALL_RECT oldRect = {0, statusLineRow, this->terminalWidth_ - 1, statusLineRow + this->statusLines_};
+ SMALL_RECT oldRect = makeSMALL_RECT(0, statusLineRow, this->terminalWidth_ - 1, statusLineRow + this->statusLines_);
CHAR_INFO fillChar = {{' '}, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED};
ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, statusLineRow + newLines), &fillChar);
// Clear potential leftovers
if (-newLines - this->statusLines_ > 0)
{
- COORD pos = {0, this->inputLineRow_ + newInputLineHeight + this->statusLines_};
+ COORD pos = makeCOORD(0, this->inputLineRow_ + newInputLineHeight + this->statusLines_);
this->writeText(std::string((-newLines - this->statusLines_) * this->terminalWidth_, ' '), pos);
}
}
@@ -397,7 +397,7 @@
this->lastOutputLineHeight_ = 1 + it->first.size() / this->terminalWidth_;
this->createNewOutputLines(this->lastOutputLineHeight_);
// Write the text
- COORD pos = {0, this->inputLineRow_ - this->lastOutputLineHeight_};
+ COORD pos = makeCOORD(0, this->inputLineRow_ - this->lastOutputLineHeight_);
this->printOutputLine(it->first, it->second, pos);
}
}
Modified: code/trunk/src/libraries/core/command/IOConsoleWindows.h
===================================================================
--- code/trunk/src/libraries/core/command/IOConsoleWindows.h 2013-09-26 21:03:33 UTC (rev 9675)
+++ code/trunk/src/libraries/core/command/IOConsoleWindows.h 2013-09-29 14:27:05 UTC (rev 9676)
@@ -79,12 +79,18 @@
void createNewOutputLines(int lines);
void printOutputLine(const std::string& line, Shell::LineType type, const COORD& pos);
- static inline COORD makeCOORD(int x, int y)
+ static inline COORD makeCOORD(SHORT x, SHORT y)
{
COORD val = {x, y};
return val;
}
+ static inline SMALL_RECT makeSMALL_RECT(SHORT left, SHORT top, SHORT right, SHORT bottom)
+ {
+ SMALL_RECT val = {left, top, right, bottom};
+ return val;
+ }
+
Shell* shell_;
InputBuffer* buffer_;
std::ostream cout_;
Modified: code/trunk/src/orxonox/gametypes/Dynamicmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.h 2013-09-26 21:03:33 UTC (rev 9675)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.h 2013-09-29 14:27:05 UTC (rev 9676)
@@ -82,7 +82,7 @@
protected:
- inline int getPlayerCount() const
+ inline unsigned int getPlayerCount() const
{ return this->numberOf[chaser] + numberOf[piggy] + this->numberOf[killer]; }
std::map< PlayerInfo*, int > playerParty_; //player's parties are recorded here
More information about the Orxonox-commit
mailing list