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
537c6c4e
Commit
537c6c4e
authored
Jul 01, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a warning.
parent
8e451911
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
format.cc
format.cc
+2
-2
format.h
format.h
+14
-7
No files found.
format.cc
View file @
537c6c4e
...
...
@@ -537,7 +537,7 @@ void fmt::BasicWriter<Char>::FormatDouble(T value, const FormatSpec &spec) {
template
<
typename
Char
>
template
<
typename
StringChar
>
void
fmt
::
BasicWriter
<
Char
>::
write_str
(
const
Arg
::
StringValue
<
StringChar
>
&
str
,
const
FormatSpec
&
spec
)
{
const
internal
::
StringValue
<
StringChar
>
&
str
,
const
FormatSpec
&
spec
)
{
if
(
spec
.
type_
&&
spec
.
type_
!=
's'
)
internal
::
ReportUnknownType
(
spec
.
type_
,
"string"
);
const
StringChar
*
s
=
str
.
value
;
...
...
@@ -1064,7 +1064,7 @@ void fmt::BasicWriter<Char>::FormatParser::Format(
writer
.
write_str
(
arg
.
string
,
spec
);
break
;
case
Arg
:
:
WSTRING
:
writer
.
write_str
(
arg
.
wstring
,
spec
);
writer
.
write_str
(
internal
::
CharTraits
<
Char
>::
convert
(
arg
.
wstring
)
,
spec
);
break
;
case
Arg
:
:
POINTER
:
if
(
spec
.
type_
&&
spec
.
type_
!=
'p'
)
...
...
format.h
View file @
537c6c4e
...
...
@@ -355,6 +355,12 @@ void Array<T, SIZE>::append(const T *begin, const T *end) {
size_
+=
num_elements
;
}
template
<
typename
Char
>
struct
StringValue
{
const
Char
*
value
;
std
::
size_t
size
;
};
template
<
typename
Char
>
class
CharTraits
;
...
...
@@ -379,6 +385,11 @@ class CharTraits<char> : public BasicCharTraits<char> {
static
char
ConvertChar
(
char
value
)
{
return
value
;
}
static
StringValue
<
char
>
convert
(
StringValue
<
wchar_t
>
)
{
StringValue
<
char
>
s
=
{
""
,
0
};
return
s
;
}
template
<
typename
T
>
static
int
FormatFloat
(
char
*
buffer
,
std
::
size_t
size
,
const
char
*
format
,
unsigned
width
,
int
precision
,
T
value
);
...
...
@@ -392,6 +403,8 @@ class CharTraits<wchar_t> : public BasicCharTraits<wchar_t> {
static
wchar_t
ConvertChar
(
char
value
)
{
return
value
;
}
static
wchar_t
ConvertChar
(
wchar_t
value
)
{
return
value
;
}
static
StringValue
<
wchar_t
>
convert
(
StringValue
<
wchar_t
>
s
)
{
return
s
;
}
template
<
typename
T
>
static
int
FormatFloat
(
wchar_t
*
buffer
,
std
::
size_t
size
,
const
wchar_t
*
format
,
unsigned
width
,
int
precision
,
T
value
);
...
...
@@ -605,12 +618,6 @@ struct ArgInfo {
};
Type
type
;
template
<
typename
Char
>
struct
StringValue
{
const
Char
*
value
;
std
::
size_t
size
;
};
typedef
void
(
*
FormatFunc
)(
void
*
writer
,
const
void
*
arg
,
const
FormatSpec
&
spec
);
...
...
@@ -1251,7 +1258,7 @@ class BasicWriter {
template
<
typename
StringChar
>
void
write_str
(
const
Arg
::
StringValue
<
StringChar
>
&
str
,
const
FormatSpec
&
spec
);
const
internal
::
StringValue
<
StringChar
>
&
str
,
const
FormatSpec
&
spec
);
// This method is private to disallow writing a wide string to a
// char stream and vice versa. If you want to print a wide string
...
...
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