mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 21:35:40 +02:00
Sweep out Wshadow
Most of the changes are completely pointless renaming of constructor arguments so that they do not use the same name as the type members, but 🤷 Closes #2015
This commit is contained in:
@@ -33,12 +33,12 @@
|
||||
namespace Catch {
|
||||
namespace Benchmark {
|
||||
struct Benchmark {
|
||||
Benchmark(std::string &&name)
|
||||
: name(std::move(name)) {}
|
||||
Benchmark(std::string&& benchmarkName)
|
||||
: name(std::move(benchmarkName)) {}
|
||||
|
||||
template <class FUN>
|
||||
Benchmark(std::string &&name, FUN &&func)
|
||||
: fun(std::move(func)), name(std::move(name)) {}
|
||||
Benchmark(std::string&& benchmarkName , FUN &&func)
|
||||
: fun(std::move(func)), name(std::move(benchmarkName)) {}
|
||||
|
||||
template <typename Clock>
|
||||
ExecutionPlan<FloatDuration<Clock>> prepare(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
|
||||
|
@@ -44,11 +44,11 @@ namespace Catch {
|
||||
template <typename Fun>
|
||||
void measure(Fun&& fun) { measure(std::forward<Fun>(fun), is_callable<Fun(int)>()); }
|
||||
|
||||
int runs() const { return k; }
|
||||
int runs() const { return repeats; }
|
||||
|
||||
Chronometer(Detail::ChronometerConcept& meter, int k)
|
||||
Chronometer(Detail::ChronometerConcept& meter, int repeats_)
|
||||
: impl(&meter)
|
||||
, k(k) {}
|
||||
, repeats(repeats_) {}
|
||||
|
||||
private:
|
||||
template <typename Fun>
|
||||
@@ -60,13 +60,13 @@ namespace Catch {
|
||||
void measure(Fun&& fun, std::true_type) {
|
||||
Detail::optimizer_barrier();
|
||||
impl->start();
|
||||
for (int i = 0; i < k; ++i) invoke_deoptimized(fun, i);
|
||||
for (int i = 0; i < repeats; ++i) invoke_deoptimized(fun, i);
|
||||
impl->finish();
|
||||
Detail::optimizer_barrier();
|
||||
}
|
||||
|
||||
Detail::ChronometerConcept* impl;
|
||||
int k;
|
||||
int repeats;
|
||||
};
|
||||
} // namespace Benchmark
|
||||
} // namespace Catch
|
||||
|
@@ -48,8 +48,8 @@ namespace Catch {
|
||||
};
|
||||
template <typename Fun>
|
||||
struct model : public callable {
|
||||
model(Fun&& fun) : fun(std::move(fun)) {}
|
||||
model(Fun const& fun) : fun(fun) {}
|
||||
model(Fun&& fun_) : fun(std::move(fun_)) {}
|
||||
model(Fun const& fun_) : fun(fun_) {}
|
||||
|
||||
model<Fun>* clone() const override { return new model<Fun>(*this); }
|
||||
|
||||
|
@@ -78,8 +78,8 @@ namespace Catch {
|
||||
TokenStream::TokenStream( Args const& args ):
|
||||
TokenStream( args.m_args.begin(), args.m_args.end() ) {}
|
||||
|
||||
TokenStream::TokenStream( Iterator it, Iterator itEnd ):
|
||||
it( it ), itEnd( itEnd ) {
|
||||
TokenStream::TokenStream( Iterator it_, Iterator itEnd_ ):
|
||||
it( it_ ), itEnd( itEnd_ ) {
|
||||
loadBuffer();
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ namespace Catch {
|
||||
|
||||
struct lineOfChars {
|
||||
char c;
|
||||
constexpr lineOfChars( char c ): c( c ) {}
|
||||
constexpr lineOfChars( char c_ ): c( c_ ) {}
|
||||
|
||||
friend std::ostream& operator<<( std::ostream& out, lineOfChars value );
|
||||
};
|
||||
|
Reference in New Issue
Block a user