|
From: Yoda-JM <yo...@us...> - 2009-10-29 14:28:13
|
Module: performous
Branch: master
Commit: c9cff8e1aa97a33d77d994e3418e0830fdbf7901
Author: Vincent Le Ligeour <yo...@us...>
Date: Thu Oct 29 15:27:59 2009 +0100
Removed MacOSX incompatible gcc warning / Added comment on gcc 4.0.1 bug / Used static_cast instead of C-style cast
---
game/CMakeLists.txt | 2 +-
game/player.cc | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index a64bcf6..20b0f94 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -30,7 +30,7 @@ endif(PortMidi_FOUND)
if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
# -pedantic cannot be used because ffmpeg headers are b0rked
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++98 -Wall -Wextra -Wno-ignored-qualifiers")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++98 -Wall -Wextra")
# Needed for ffmpeg.cc to compile cleanly on OSX (it's a (unsigned long) long story)
add_definitions("-D__STDC_CONSTANT_MACROS")
endif(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/game/player.cc b/game/player.cc
index 0ec9186..618ed3f 100644
--- a/game/player.cc
+++ b/game/player.cc
@@ -40,7 +40,8 @@ void Player::calcRowRank() {
// Calculate max score of the completed row
Notes::const_reverse_iterator maxScoreIt(m_scoreIt);
// FIXME: MacOSX needs the following cast to compile correctly
- while ((maxScoreIt != (Notes::const_reverse_iterator)m_song.notes.rend()) && (maxScoreIt->type != Note::SLEEP)) {
+ // it is related to the fact that OSX default compiler is 4.0.1 that is buggy when not casting
+ while ((maxScoreIt != static_cast<Notes::const_reverse_iterator>(m_song.notes.rend())) && (maxScoreIt->type != Note::SLEEP)) {
m_maxLineScore += m_song.m_scoreFactor * maxScoreIt->maxScore();
maxScoreIt++;
}
|