Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
77cd9803
Commit
77cd9803
authored
Jan 10, 2014
by
Dominic Hamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pedantic errors and fix them
parent
5a71bd6e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
CMakeLists.txt
CMakeLists.txt
+1
-1
benchmark.h
include/benchmark/benchmark.h
+3
-3
benchmark.cc
src/benchmark.cc
+4
-4
No files found.
CMakeLists.txt
View file @
77cd9803
...
@@ -7,7 +7,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
...
@@ -7,7 +7,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/lib
)
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/lib
)
set
(
CMAKE_ARCHIVE_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_DEBUG
"-g -O0 -DDEBUG"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-fno-strict-aliasing -O3 -DNDEBUG"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-fno-strict-aliasing -O3 -DNDEBUG"
)
...
...
include/benchmark/benchmark.h
View file @
77cd9803
...
@@ -250,7 +250,7 @@ class State {
...
@@ -250,7 +250,7 @@ class State {
STATE_STARTING
,
// KeepRunning called, waiting for other threads
STATE_STARTING
,
// KeepRunning called, waiting for other threads
STATE_RUNNING
,
// Running and being timed
STATE_RUNNING
,
// Running and being timed
STATE_STOPPING
,
// Not being timed but waiting for other threads
STATE_STOPPING
,
// Not being timed but waiting for other threads
STATE_STOPPED
,
// Stopped
STATE_STOPPED
// Stopped
};
};
EState
state_
;
EState
state_
;
...
@@ -290,7 +290,7 @@ class State {
...
@@ -290,7 +290,7 @@ class State {
std
::
unique_ptr
<
ThreadStats
>
stats_
;
std
::
unique_ptr
<
ThreadStats
>
stats_
;
friend
class
internal
::
Benchmark
;
friend
class
internal
::
Benchmark
;
DISALLOW_COPY_AND_ASSIGN
(
State
)
;
DISALLOW_COPY_AND_ASSIGN
(
State
)
};
};
// Interface for custom benchmark result printers.
// Interface for custom benchmark result printers.
...
@@ -475,7 +475,7 @@ class Benchmark {
...
@@ -475,7 +475,7 @@ class Benchmark {
friend
struct
::
benchmark
::
internal
::
Benchmark
::
Instance
;
friend
struct
::
benchmark
::
internal
::
Benchmark
::
Instance
;
friend
void
::
benchmark
::
internal
::
RunMatchingBenchmarks
(
friend
void
::
benchmark
::
internal
::
RunMatchingBenchmarks
(
const
std
::
string
&
,
const
BenchmarkReporter
*
);
const
std
::
string
&
,
const
BenchmarkReporter
*
);
DISALLOW_COPY_AND_ASSIGN
(
Benchmark
)
;
DISALLOW_COPY_AND_ASSIGN
(
Benchmark
)
};
};
// ------------------------------------------------------
// ------------------------------------------------------
...
...
src/benchmark.cc
View file @
77cd9803
...
@@ -507,7 +507,7 @@ class State::FastClock {
...
@@ -507,7 +507,7 @@ class State::FastClock {
}
while
(
done
==
0
);
}
while
(
done
==
0
);
}
}
DISALLOW_COPY_AND_ASSIGN
(
FastClock
)
;
DISALLOW_COPY_AND_ASSIGN
(
FastClock
)
};
};
struct
State
::
ThreadStats
{
struct
State
::
ThreadStats
{
...
@@ -572,7 +572,7 @@ struct State::SharedState {
...
@@ -572,7 +572,7 @@ struct State::SharedState {
}
}
~
SharedState
()
{
pthread_mutex_destroy
(
&
mu
);
}
~
SharedState
()
{
pthread_mutex_destroy
(
&
mu
);
}
DISALLOW_COPY_AND_ASSIGN
(
SharedState
)
;
DISALLOW_COPY_AND_ASSIGN
(
SharedState
)
};
};
namespace
internal
{
namespace
internal
{
...
@@ -793,9 +793,9 @@ void Benchmark::RunInstance(const Instance& b, const BenchmarkReporter* br) {
...
@@ -793,9 +793,9 @@ void Benchmark::RunInstance(const Instance& b, const BenchmarkReporter* br) {
// Initialize the test runners.
// Initialize the test runners.
State
::
SharedState
state
(
&
b
);
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
)
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.
// Run them all.
for
(
int
i
=
0
;
i
<
b
.
threads
;
++
i
)
{
for
(
int
i
=
0
;
i
<
b
.
threads
;
++
i
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment