Restore and fix compile warnings

This commit is contained in:
Eduardo Bart 2012-06-17 18:47:05 -03:00
parent ad04043a88
commit f650b0e5bb
8 changed files with 11 additions and 10 deletions

View File

@ -21,8 +21,8 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
ELSE()
SET(ARCH_FLAGS "-m32 -march=i686 -mtune=generic")
ENDIF()
SET(WARNS_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-but-set-variable")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARNS} ${ARCH_FLAGS} -std=gnu++0x -pipe")
SET(WARNS_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-unused-variable")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNS_FLAGS} ${ARCH_FLAGS} -std=gnu++0x -pipe")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -ggdb -fno-omit-frame-pointer")
SET(CMAKE_CXX_FLAGS_RELEASE "-O2")

View File

@ -93,7 +93,7 @@ public:
void update_what() {
m_what = format("failed to cast value of type '%s' to type '%s'", demangle_type<T>(), demangle_type<R>());
}
virtual const char* what() { return m_what.c_str(); }
virtual const char* what() const throw() { return m_what.c_str(); }
private:
std::string m_what;
};

View File

@ -32,7 +32,7 @@ AnimatedText::AnimatedText()
m_cachedText.setAlign(Fw::AlignLeft);
}
void AnimatedText::draw(const Point& dest, const Rect& visibleRect)
void AnimatedText::drawText(const Point& dest, const Rect& visibleRect)
{
Point p = dest;
Size textSize = m_cachedText.getTextSize();

View File

@ -33,7 +33,7 @@ class AnimatedText : public Thing
public:
AnimatedText();
void draw(const Point& dest, const Rect& visibleRect);
void drawText(const Point& dest, const Rect& visibleRect);
void startAnimation();
void setColor(int color);

View File

@ -177,7 +177,7 @@ void MapView::draw(const Rect& rect)
p.x = p.x * horizontalStretchFactor;
p.y = p.y * verticalStretchFactor;
p += rect.topLeft();
staticText->draw(p, rect);
staticText->drawText(p, rect);
}
for(const AnimatedTextPtr& animatedText : g_map.getAnimatedTexts()) {
@ -195,7 +195,7 @@ void MapView::draw(const Rect& rect)
p.x = p.x * horizontalStretchFactor;
p.y = p.y * verticalStretchFactor;
p += rect.topLeft();
animatedText->draw(p, rect);
animatedText->drawText(p, rect);
}
} else if(m_viewMode > NEAR_VIEW) {
// draw a cross in the center instead of our creature

View File

@ -32,7 +32,7 @@ StaticText::StaticText()
m_cachedText.setAlign(Fw::AlignCenter);
}
void StaticText::draw(const Point& dest, const Rect& parentRect)
void StaticText::drawText(const Point& dest, const Rect& parentRect)
{
Size textSize = m_cachedText.getTextSize();
Rect rect = Rect(dest - Point(textSize.width() / 2, textSize.height()) + Point(20, 5), textSize);

View File

@ -33,7 +33,7 @@ class StaticText : public Thing
public:
StaticText();
void draw(const Point& dest, const Rect& parentRect);
void drawText(const Point& dest, const Rect& parentRect);
std::string getName() { return m_name; }
Otc::SpeakType getMessageType() { return m_messageType; }

View File

@ -27,8 +27,9 @@
#include <framework/graphics/declarations.h>
#include <framework/graphics/coordsbuffer.h>
struct ThingType
class ThingType
{
public:
enum Dimension {
Width = 0,
Height,