Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
ff8d50d0
Commit
ff8d50d0
authored
Mar 06, 2015
by
Kenton Varda
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #187 from johnkdoe/master
zero warnings: use KJ_UNUSED for unused constexpr & local vars
parents
ec94c3dc
64f35316
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
arena.c++
c++/src/kj/arena.c++
+1
-1
string.c++
c++/src/kj/string.c++
+4
-4
No files found.
c++/src/kj/arena.c++
View file @
ff8d50d0
...
...
@@ -66,7 +66,7 @@ void Arena::cleanup() {
namespace
{
constexpr
bool
isPowerOfTwo
(
size_t
value
)
{
constexpr
bool
KJ_UNUSED
isPowerOfTwo
(
size_t
value
)
{
return
(
value
&
(
value
-
1
))
==
0
;
}
...
...
c++/src/kj/string.c++
View file @
ff8d50d0
...
...
@@ -252,7 +252,7 @@ char* DoubleToBuffer(double value, char* buffer) {
return
buffer
;
}
int
snprintf_result
=
int
snprintf_result
KJ_UNUSED
=
snprintf
(
buffer
,
kDoubleToBufferSize
,
"%.*g"
,
DBL_DIG
,
value
);
// The snprintf should never overflow because the buffer is significantly
...
...
@@ -267,7 +267,7 @@ char* DoubleToBuffer(double value, char* buffer) {
// truncated to a double.
volatile
double
parsed_value
=
strtod
(
buffer
,
NULL
);
if
(
parsed_value
!=
value
)
{
int
snprintf_result2
=
int
snprintf_result2
KJ_UNUSED
=
snprintf
(
buffer
,
kDoubleToBufferSize
,
"%.*g"
,
DBL_DIG
+
2
,
value
);
// Should never overflow; see above.
...
...
@@ -311,7 +311,7 @@ char* FloatToBuffer(float value, char* buffer) {
return
buffer
;
}
int
snprintf_result
=
int
snprintf_result
KJ_UNUSED
=
snprintf
(
buffer
,
kFloatToBufferSize
,
"%.*g"
,
FLT_DIG
,
value
);
// The snprintf should never overflow because the buffer is significantly
...
...
@@ -320,7 +320,7 @@ char* FloatToBuffer(float value, char* buffer) {
float
parsed_value
;
if
(
!
safe_strtof
(
buffer
,
&
parsed_value
)
||
parsed_value
!=
value
)
{
int
snprintf_result2
=
int
snprintf_result2
KJ_UNUSED
=
snprintf
(
buffer
,
kFloatToBufferSize
,
"%.*g"
,
FLT_DIG
+
2
,
value
);
// Should never overflow; see above.
...
...
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