From: TimePath Date: Sun, 6 Aug 2017 08:13:06 +0000 (+1000) Subject: Remove -Wno-extra X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bcec26f643953107b21f0e02bc494d9f72f13c18;p=xonotic%2Fnetradiant.git Remove -Wno-extra --- diff --git a/CMakeLists.txt b/CMakeLists.txt index bbad9b9e..f68f7c30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,10 +87,10 @@ addflags("-Wall") addflags("-Wextra") addflags("-pedantic") -addflags("-Wno-extra") addflags("-Wno-switch") addflags("-Wno-pedantic") addflags("-Wno-parentheses") +addflags("-Wno-sign-compare") addflags("-Wno-write-strings") addflags("-Wno-unused-function") addflags("-Wno-unused-variable") diff --git a/include/renderable.h b/include/renderable.h index 8b972170..0c0e770b 100644 --- a/include/renderable.h +++ b/include/renderable.h @@ -48,7 +48,7 @@ enum EStyle virtual void PushState() = 0; virtual void PopState() = 0; virtual void SetState( Shader* state, EStyle mode ) = 0; -virtual const EStyle getStyle() const = 0; +virtual EStyle getStyle() const = 0; virtual void Highlight( EHighlightMode mode, bool bEnable = true ) = 0; virtual void setLights( const LightList& lights ){ } diff --git a/libs/memory/allocator.h b/libs/memory/allocator.h index bef7d7cb..845ce140 100644 --- a/libs/memory/allocator.h +++ b/libs/memory/allocator.h @@ -118,11 +118,11 @@ struct rebind typedef NamedAllocator other; }; -explicit NamedAllocator( const char* name ) : m_name( name ){ +explicit NamedAllocator( const char* name ) : DefaultAllocator(), m_name( name ){ } -NamedAllocator( const NamedAllocator& other ) : m_name( other.m_name ){ +NamedAllocator( const NamedAllocator& other ) : DefaultAllocator(), m_name( other.m_name ){ } -template NamedAllocator( const NamedAllocator& other ) : m_name( other.m_name ){ +template NamedAllocator( const NamedAllocator& other ) : DefaultAllocator(), m_name( other.m_name ){ } ~NamedAllocator(){ } diff --git a/libs/render.h b/libs/render.h index b53612bf..d568edb3 100644 --- a/libs/render.h +++ b/libs/render.h @@ -171,7 +171,7 @@ RenderIndex m_prev0; RenderIndex m_prev1; RenderIndex m_prev2; -const RenderIndex find_or_insert( const Vertex& vertex ){ +RenderIndex find_or_insert( const Vertex& vertex ){ RenderIndex index = 0; while ( 1 ) diff --git a/libs/str.h b/libs/str.h index fcc328b1..47be309d 100644 --- a/libs/str.h +++ b/libs/str.h @@ -427,7 +427,7 @@ bool operator >( char* pStr ) const { return ( m_bIgnoreCase ) ? stricmp( m_pStr bool operator >( const char* pStr ) const { return ( m_bIgnoreCase ) ? stricmp( m_pStr, pStr ) > 0 : strcmp( m_pStr, pStr ) > 0; } char& operator []( std::size_t nIndex ) { return m_pStr[nIndex]; } const char& operator []( std::size_t nIndex ) const { return m_pStr[nIndex]; } -const char GetAt( std::size_t nIndex ) { return m_pStr[nIndex]; } +char GetAt( std::size_t nIndex ) { return m_pStr[nIndex]; } }; diff --git a/libs/stringio.h b/libs/stringio.h index ff1a3a67..ac680259 100644 --- a/libs/stringio.h +++ b/libs/stringio.h @@ -219,7 +219,7 @@ inline bool string_parse_size( const char* string, std::size_t& i ){ } -#define RETURN_FALSE_IF_FAIL( expression ) if ( !expression ) {return false; }else +#define RETURN_FALSE_IF_FAIL(expression) do { if (!(expression)) return false; } while (0) inline void Tokeniser_unexpectedError( Tokeniser& tokeniser, const char* token, const char* expected ){ globalErrorStream() << Unsigned( tokeniser.getLine() ) << ":" << Unsigned( tokeniser.getColumn() ) << ": parse error at '" << ( token != 0 ? token : "#EOF" ) << "': expected '" << expected << "'\n"; diff --git a/plugins/md3model/md5.cpp b/plugins/md3model/md5.cpp index 69719051..e1c5de56 100644 --- a/plugins/md3model/md5.cpp +++ b/plugins/md3model/md5.cpp @@ -29,7 +29,7 @@ #include "model.h" -#define MD5_RETURN_FALSE_IF_FAIL( expression ) if ( !( expression ) ) { globalErrorStream() << "md5 parse failed: " # expression "\n"; return false; } else +#define MD5_RETURN_FALSE_IF_FAIL(expression) do { if (!(expression)) { globalErrorStream() << "md5 parse failed: " #expression "\n"; return false; } } while (0) bool MD5_parseToken( Tokeniser& tokeniser, const char* string ){ const char* token = tokeniser.getToken(); diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 0a8c80fd..e1f09679 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -1357,7 +1357,7 @@ void SetState( Shader* state, EStyle style ){ m_state_stack.back().m_state = state; } } -const EStyle getStyle() const { +EStyle getStyle() const { return eFullMaterials; } void PushState(){ diff --git a/radiant/eclass_doom3.cpp b/radiant/eclass_doom3.cpp index f9598e4b..2fde6381 100644 --- a/radiant/eclass_doom3.cpp +++ b/radiant/eclass_doom3.cpp @@ -84,7 +84,7 @@ inline void printParseError( const char* message ){ globalErrorStream() << message; } -#define PARSE_RETURN_FALSE_IF_FAIL( expression ) if ( !( expression ) ) { printParseError( FILE_LINE "\nparse failed: " # expression "\n" ); return false; } else +#define PARSE_RETURN_FALSE_IF_FAIL(expression) do { if (!( expression)) { printParseError(FILE_LINE "\nparse failed: " #expression "\n"); return false; } } while (0) bool EntityClassDoom3_parseToken( Tokeniser& tokeniser ){ const char* token = tokeniser.getToken(); diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index b265c25e..93a78739 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -2066,7 +2066,7 @@ void SetState( Shader* state, EStyle style ){ m_state_stack.back().m_state = state; } } -const EStyle getStyle() const { +EStyle getStyle() const { return eWireframeOnly; } void PushState(){