Skip to content

Commit

Permalink
add pedantic errors and fix them
Browse files Browse the repository at this point in the history
  • Loading branch information
dmah42 committed Jan 10, 2014
1 parent 5a71bd6 commit 77cd980
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)

set(CMAKE_CXX_FLAGS "-Wall -Werror --std=c++0x")
set(CMAKE_CXX_FLAGS "-Wall -Werror -pedantic-errors --std=c++0x")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-fno-strict-aliasing -O3 -DNDEBUG")

Expand Down
6 changes: 3 additions & 3 deletions include/benchmark/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class State {
STATE_STARTING, // KeepRunning called, waiting for other threads
STATE_RUNNING, // Running and being timed
STATE_STOPPING, // Not being timed but waiting for other threads
STATE_STOPPED, // Stopped
STATE_STOPPED // Stopped
};

EState state_;
Expand Down Expand Up @@ -290,7 +290,7 @@ class State {
std::unique_ptr<ThreadStats> stats_;

friend class internal::Benchmark;
DISALLOW_COPY_AND_ASSIGN(State);
DISALLOW_COPY_AND_ASSIGN(State)
};

// Interface for custom benchmark result printers.
Expand Down Expand Up @@ -475,7 +475,7 @@ class Benchmark {
friend struct ::benchmark::internal::Benchmark::Instance;
friend void ::benchmark::internal::RunMatchingBenchmarks(
const std::string&, const BenchmarkReporter*);
DISALLOW_COPY_AND_ASSIGN(Benchmark);
DISALLOW_COPY_AND_ASSIGN(Benchmark)
};

// ------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions src/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ class State::FastClock {
} while (done == 0);
}

DISALLOW_COPY_AND_ASSIGN(FastClock);
DISALLOW_COPY_AND_ASSIGN(FastClock)
};

struct State::ThreadStats {
Expand Down Expand Up @@ -572,7 +572,7 @@ struct State::SharedState {
}

~SharedState() { pthread_mutex_destroy(&mu); }
DISALLOW_COPY_AND_ASSIGN(SharedState);
DISALLOW_COPY_AND_ASSIGN(SharedState)
};

namespace internal {
Expand Down Expand Up @@ -793,9 +793,9 @@ void Benchmark::RunInstance(const Instance& b, const BenchmarkReporter* br) {
// Initialize the test runners.
State::SharedState state(&b);
{
std::unique_ptr<State> runners[b.threads];
std::vector<std::unique_ptr<State>> runners;
for (int i = 0; i < b.threads; ++i)
runners[i].reset(new State(&clock, &state, i));
runners.push_back(std::unique_ptr<State>(new State(&clock, &state, i)));

// Run them all.
for (int i = 0; i < b.threads; ++i) {
Expand Down

0 comments on commit 77cd980

Please sign in to comment.