Fix -Wshadow warnings with GCC.

This commit is contained in:
Vaclav Haisman 2015-05-24 13:32:20 +02:00
parent c51e86819d
commit 83e063488c
No known key found for this signature in database
GPG Key ID: A279EE340F56DD52
6 changed files with 27 additions and 27 deletions

View File

@ -1,6 +1,6 @@
![catch logo](catch-logo-small.png) ![catch logo](catch-logo-small.png)
*v1.1 build 3 (master branch)* *v1.1 build 4 (master branch)*
Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch) Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch)

View File

@ -585,8 +585,8 @@ namespace Clara {
m_arg->description = description; m_arg->description = description;
return *this; return *this;
} }
ArgBuilder& detail( std::string const& detail ) { ArgBuilder& detail( std::string const& d ) {
m_arg->detail = detail; m_arg->detail = d;
return *this; return *this;
} }
@ -670,14 +670,14 @@ namespace Clara {
maxWidth = (std::max)( maxWidth, it->commands().size() ); maxWidth = (std::max)( maxWidth, it->commands().size() );
for( it = itBegin; it != itEnd; ++it ) { for( it = itBegin; it != itEnd; ++it ) {
Detail::Text usage( it->commands(), Detail::TextAttributes() Detail::Text usageText( it->commands(), Detail::TextAttributes()
.setWidth( maxWidth+indent ) .setWidth( maxWidth+indent )
.setIndent( indent ) ); .setIndent( indent ) );
Detail::Text desc( it->description, Detail::TextAttributes() Detail::Text desc( it->description, Detail::TextAttributes()
.setWidth( width - maxWidth - 3 ) ); .setWidth( width - maxWidth - 3 ) );
for( std::size_t i = 0; i < (std::max)( usage.size(), desc.size() ); ++i ) { for( std::size_t i = 0; i < (std::max)( usageText.size(), desc.size() ); ++i ) {
std::string usageCol = i < usage.size() ? usage[i] : ""; std::string usageCol = i < usageText.size() ? usageText[i] : "";
os << usageCol; os << usageCol;
if( i < desc.size() && !desc[i].empty() ) if( i < desc.size() && !desc[i].empty() )

View File

@ -125,10 +125,10 @@ namespace Catch {
} }
void useStream( std::string const& streamName ) { void useStream( std::string const& streamName ) {
Stream stream = createStream( streamName ); Stream newStream = createStream( streamName );
setStreamBuf( stream.streamBuf ); setStreamBuf( newStream.streamBuf );
m_stream.release(); m_stream.release();
m_stream = stream; m_stream = newStream;
} }
std::string getReporterName() const { return m_data.reporterName; } std::string getReporterName() const { return m_data.reporterName; }

View File

@ -59,11 +59,11 @@ namespace Catch {
public: public:
explicit RunContext( Ptr<IConfig const> const& config, Ptr<IStreamingReporter> const& reporter ) explicit RunContext( Ptr<IConfig const> const& cfg, Ptr<IStreamingReporter> const& reporter )
: m_runInfo( config->name() ), : m_runInfo( cfg->name() ),
m_context( getCurrentMutableContext() ), m_context( getCurrentMutableContext() ),
m_activeTestCase( NULL ), m_activeTestCase( NULL ),
m_config( config ), m_config( cfg ),
m_reporter( reporter ), m_reporter( reporter ),
m_prevRunner( m_context.getRunner() ), m_prevRunner( m_context.getRunner() ),
m_prevResultCapture( m_context.getResultCapture() ), m_prevResultCapture( m_context.getResultCapture() ),

View File

@ -13,7 +13,7 @@
namespace Catch { namespace Catch {
// These numbers are maintained by a script // These numbers are maintained by a script
Version libraryVersion( 1, 1, 3, "master" ); Version libraryVersion( 1, 1, 4, "master" );
} }
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@ -1,6 +1,6 @@
/* /*
* CATCH v1.1 build 3 (master branch) * CATCH v1.1 build 4 (master branch)
* Generated: 2015-05-21 06:16:00.388118 * Generated: 2015-05-24 13:31:34.884512
* ---------------------------------------------------------- * ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly * This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
@ -3284,10 +3284,10 @@ namespace Catch {
} }
void useStream( std::string const& streamName ) { void useStream( std::string const& streamName ) {
Stream stream = createStream( streamName ); Stream newStream = createStream( streamName );
setStreamBuf( stream.streamBuf ); setStreamBuf( newStream.streamBuf );
m_stream.release(); m_stream.release();
m_stream = stream; m_stream = newStream;
} }
std::string getReporterName() const { return m_data.reporterName; } std::string getReporterName() const { return m_data.reporterName; }
@ -3902,8 +3902,8 @@ namespace Clara {
m_arg->description = description; m_arg->description = description;
return *this; return *this;
} }
ArgBuilder& detail( std::string const& detail ) { ArgBuilder& detail( std::string const& d ) {
m_arg->detail = detail; m_arg->detail = d;
return *this; return *this;
} }
@ -3986,14 +3986,14 @@ namespace Clara {
maxWidth = (std::max)( maxWidth, it->commands().size() ); maxWidth = (std::max)( maxWidth, it->commands().size() );
for( it = itBegin; it != itEnd; ++it ) { for( it = itBegin; it != itEnd; ++it ) {
Detail::Text usage( it->commands(), Detail::TextAttributes() Detail::Text usageText( it->commands(), Detail::TextAttributes()
.setWidth( maxWidth+indent ) .setWidth( maxWidth+indent )
.setIndent( indent ) ); .setIndent( indent ) );
Detail::Text desc( it->description, Detail::TextAttributes() Detail::Text desc( it->description, Detail::TextAttributes()
.setWidth( width - maxWidth - 3 ) ); .setWidth( width - maxWidth - 3 ) );
for( std::size_t i = 0; i < (std::max)( usage.size(), desc.size() ); ++i ) { for( std::size_t i = 0; i < (std::max)( usageText.size(), desc.size() ); ++i ) {
std::string usageCol = i < usage.size() ? usage[i] : ""; std::string usageCol = i < usageText.size() ? usageText[i] : "";
os << usageCol; os << usageCol;
if( i < desc.size() && !desc[i].empty() ) if( i < desc.size() && !desc[i].empty() )
@ -5235,11 +5235,11 @@ namespace Catch {
public: public:
explicit RunContext( Ptr<IConfig const> const& config, Ptr<IStreamingReporter> const& reporter ) explicit RunContext( Ptr<IConfig const> const& cfg, Ptr<IStreamingReporter> const& reporter )
: m_runInfo( config->name() ), : m_runInfo( cfg->name() ),
m_context( getCurrentMutableContext() ), m_context( getCurrentMutableContext() ),
m_activeTestCase( NULL ), m_activeTestCase( NULL ),
m_config( config ), m_config( cfg ),
m_reporter( reporter ), m_reporter( reporter ),
m_prevRunner( m_context.getRunner() ), m_prevRunner( m_context.getRunner() ),
m_prevResultCapture( m_context.getResultCapture() ), m_prevResultCapture( m_context.getResultCapture() ),
@ -6807,7 +6807,7 @@ namespace Catch {
namespace Catch { namespace Catch {
// These numbers are maintained by a script // These numbers are maintained by a script
Version libraryVersion( 1, 1, 3, "master" ); Version libraryVersion( 1, 1, 4, "master" );
} }
// #included from: catch_message.hpp // #included from: catch_message.hpp