Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
2523f3b9
Commit
2523f3b9
authored
Dec 10, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more -Wshadow warnings
parent
f9fc8fd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
format.h
format.h
+13
-13
No files found.
format.h
View file @
2523f3b9
...
...
@@ -1098,8 +1098,8 @@ class IntFormatSpec : public SpecT {
T
value_
;
public:
IntFormatSpec
(
T
val
ue
,
const
SpecT
&
spec
=
SpecT
())
:
SpecT
(
spec
),
value_
(
val
ue
)
{}
IntFormatSpec
(
T
val
,
const
SpecT
&
spec
=
SpecT
())
:
SpecT
(
spec
),
value_
(
val
)
{}
T
value
()
const
{
return
value_
;
}
};
...
...
@@ -1885,13 +1885,13 @@ void BasicWriter<Char>::write_double(
if
(
value
!=
value
)
{
// Format NaN ourselves because sprintf's output is not consistent
// across platforms.
std
::
size_t
size
=
4
;
std
::
size_t
nan_
size
=
4
;
const
char
*
nan
=
upper
?
" NAN"
:
" nan"
;
if
(
!
sign
)
{
--
size
;
--
nan_
size
;
++
nan
;
}
CharPtr
out
=
write_str
(
nan
,
size
,
spec
);
CharPtr
out
=
write_str
(
nan
,
nan_
size
,
spec
);
if
(
sign
)
*
out
=
sign
;
return
;
...
...
@@ -1900,13 +1900,13 @@ void BasicWriter<Char>::write_double(
if
(
internal
::
isinfinity
(
value
))
{
// Format infinity ourselves because sprintf's output is not consistent
// across platforms.
std
::
size_t
size
=
4
;
std
::
size_t
inf_
size
=
4
;
const
char
*
inf
=
upper
?
" INF"
:
" inf"
;
if
(
!
sign
)
{
--
size
;
--
inf_
size
;
++
inf
;
}
CharPtr
out
=
write_str
(
inf
,
size
,
spec
);
CharPtr
out
=
write_str
(
inf
,
inf_
size
,
spec
);
if
(
sign
)
*
out
=
sign
;
return
;
...
...
@@ -1949,19 +1949,19 @@ void BasicWriter<Char>::write_double(
// Format using snprintf.
Char
fill
=
static_cast
<
Char
>
(
spec
.
fill
());
for
(;;)
{
std
::
size_t
size
=
buffer_
.
capacity
()
-
offset
;
std
::
size_t
buffer_
size
=
buffer_
.
capacity
()
-
offset
;
#if _MSC_VER
// MSVC's vsnprintf_s doesn't work with zero size, so reserve
// space for at least one extra character to make the size non-zero.
// Note that the buffer's capacity will increase by more than 1.
if
(
size
==
0
)
{
if
(
buffer_
size
==
0
)
{
buffer_
.
reserve
(
offset
+
1
);
size
=
buffer_
.
capacity
()
-
offset
;
buffer_
size
=
buffer_
.
capacity
()
-
offset
;
}
#endif
Char
*
start
=
&
buffer_
[
offset
];
int
n
=
internal
::
CharTraits
<
Char
>::
format_float
(
start
,
size
,
format
,
width_for_sprintf
,
spec
.
precision
(),
value
);
start
,
buffer_
size
,
format
,
width_for_sprintf
,
spec
.
precision
(),
value
);
if
(
n
>=
0
&&
offset
+
n
<
buffer_
.
capacity
())
{
if
(
sign
)
{
if
((
spec
.
align
()
!=
ALIGN_RIGHT
&&
spec
.
align
()
!=
ALIGN_DEFAULT
)
||
...
...
@@ -1975,7 +1975,7 @@ void BasicWriter<Char>::write_double(
}
if
(
spec
.
align
()
==
ALIGN_CENTER
&&
spec
.
width
()
>
static_cast
<
unsigned
>
(
n
))
{
unsigned
width
=
spec
.
width
();
width
=
spec
.
width
();
CharPtr
p
=
grow_buffer
(
width
);
std
::
copy
(
p
,
p
+
n
,
p
+
(
width
-
n
)
/
2
);
fill_padding
(
p
,
spec
.
width
(),
n
,
fill
);
...
...
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