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
bd0067ee
Commit
bd0067ee
authored
Nov 25, 2014
by
Daniel.Perry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made code compile under windows with level 4 warnings
parent
4c59aa87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
format.cc
format.cc
+26
-0
format.h
format.h
+10
-2
No files found.
format.cc
View file @
bd0067ee
...
@@ -84,6 +84,7 @@ using fmt::internal::Arg;
...
@@ -84,6 +84,7 @@ using fmt::internal::Arg;
#if _MSC_VER
#if _MSC_VER
# pragma warning(push)
# pragma warning(push)
# pragma warning(disable: 4127) // conditional expression is constant
# pragma warning(disable: 4127) // conditional expression is constant
# pragma warning(disable: 4702) // unreachable code
#endif
#endif
namespace
{
namespace
{
...
@@ -239,6 +240,8 @@ void check_sign(const Char *&s, const Arg &arg) {
...
@@ -239,6 +240,8 @@ void check_sign(const Char *&s, const Arg &arg) {
// left alignment if it is negative.
// left alignment if it is negative.
class
WidthHandler
:
public
fmt
::
internal
::
ArgVisitor
<
WidthHandler
,
unsigned
>
{
class
WidthHandler
:
public
fmt
::
internal
::
ArgVisitor
<
WidthHandler
,
unsigned
>
{
private:
private:
WidthHandler
&
operator
=
(
WidthHandler
const
&
);
//no impl
fmt
::
FormatSpec
&
spec_
;
fmt
::
FormatSpec
&
spec_
;
public:
public:
...
@@ -283,6 +286,8 @@ class PrecisionHandler :
...
@@ -283,6 +286,8 @@ class PrecisionHandler :
template
<
typename
T
>
template
<
typename
T
>
class
ArgConverter
:
public
fmt
::
internal
::
ArgVisitor
<
ArgConverter
<
T
>
,
void
>
{
class
ArgConverter
:
public
fmt
::
internal
::
ArgVisitor
<
ArgConverter
<
T
>
,
void
>
{
private:
private:
ArgConverter
&
operator
=
(
ArgConverter
const
&
);
//no impl
fmt
::
internal
::
Arg
&
arg_
;
fmt
::
internal
::
Arg
&
arg_
;
wchar_t
type_
;
wchar_t
type_
;
...
@@ -321,6 +326,7 @@ class ArgConverter : public fmt::internal::ArgVisitor<ArgConverter<T>, void> {
...
@@ -321,6 +326,7 @@ class ArgConverter : public fmt::internal::ArgVisitor<ArgConverter<T>, void> {
// Converts an integer argument to char for printf.
// Converts an integer argument to char for printf.
class
CharConverter
:
public
fmt
::
internal
::
ArgVisitor
<
CharConverter
,
void
>
{
class
CharConverter
:
public
fmt
::
internal
::
ArgVisitor
<
CharConverter
,
void
>
{
private:
private:
CharConverter
&
operator
=
(
CharConverter
const
&
);
// no impl
fmt
::
internal
::
Arg
&
arg_
;
fmt
::
internal
::
Arg
&
arg_
;
public:
public:
...
@@ -525,6 +531,8 @@ template <typename Char>
...
@@ -525,6 +531,8 @@ template <typename Char>
class
fmt
::
internal
::
ArgFormatter
:
class
fmt
::
internal
::
ArgFormatter
:
public
fmt
::
internal
::
ArgVisitor
<
fmt
::
internal
::
ArgFormatter
<
Char
>
,
void
>
{
public
fmt
::
internal
::
ArgVisitor
<
fmt
::
internal
::
ArgFormatter
<
Char
>
,
void
>
{
private:
private:
ArgFormatter
&
operator
=
(
ArgFormatter
const
&
);
// no impl
fmt
::
BasicFormatter
<
Char
>
&
formatter_
;
fmt
::
BasicFormatter
<
Char
>
&
formatter_
;
fmt
::
BasicWriter
<
Char
>
&
writer_
;
fmt
::
BasicWriter
<
Char
>
&
writer_
;
fmt
::
FormatSpec
&
spec_
;
fmt
::
FormatSpec
&
spec_
;
...
@@ -1124,6 +1132,24 @@ template int fmt::internal::CharTraits<wchar_t>::format_float(
...
@@ -1124,6 +1132,24 @@ template int fmt::internal::CharTraits<wchar_t>::format_float(
wchar_t
*
buffer
,
std
::
size_t
size
,
const
wchar_t
*
format
,
wchar_t
*
buffer
,
std
::
size_t
size
,
const
wchar_t
*
format
,
unsigned
width
,
int
precision
,
long
double
value
);
unsigned
width
,
int
precision
,
long
double
value
);
template
<
>
template
<
>
char
*
fmt
::
BasicWriter
<
char
>::
append_float_length
<
float
>
(
char
*
format_ptr
)
{
return
format_ptr
;
}
template
<
>
template
<
>
wchar_t
*
fmt
::
BasicWriter
<
wchar_t
>::
append_float_length
<
float
>
(
wchar_t
*
format_ptr
)
{
return
format_ptr
;
}
template
<
>
template
<
>
char
*
fmt
::
BasicWriter
<
char
>::
append_float_length
<
double
>
(
char
*
format_ptr
)
{
return
format_ptr
;
}
template
<
>
template
<
>
wchar_t
*
fmt
::
BasicWriter
<
wchar_t
>::
append_float_length
<
double
>
(
wchar_t
*
format_ptr
)
{
return
format_ptr
;
}
template
<
>
template
<
>
char
*
fmt
::
BasicWriter
<
char
>::
append_float_length
<
long
double
>
(
char
*
format_ptr
)
{
*
format_ptr
++
=
'L'
;
return
format_ptr
;
}
template
<
>
template
<
>
wchar_t
*
fmt
::
BasicWriter
<
wchar_t
>::
append_float_length
<
long
double
>
(
wchar_t
*
format_ptr
)
{
*
format_ptr
++
=
'L'
;
return
format_ptr
;
}
#if _MSC_VER
#if _MSC_VER
# pragma warning(pop)
# pragma warning(pop)
#endif
#endif
format.h
View file @
bd0067ee
...
@@ -407,13 +407,16 @@ inline int getsign(double value) {
...
@@ -407,13 +407,16 @@ inline int getsign(double value) {
return
sign
;
return
sign
;
}
}
inline
int
isinfinity
(
double
x
)
{
return
!
_finite
(
x
);
}
inline
int
isinfinity
(
double
x
)
{
return
!
_finite
(
x
);
}
inline
int
isinfinity
(
long
double
x
)
{
return
!
_finite
(
static_cast
<
double
>
(
x
));
}
#endif
#endif
/*
template <typename T>
template <typename T>
struct IsLongDouble { enum {VALUE = 0}; };
struct IsLongDouble { enum {VALUE = 0}; };
template <>
template <>
struct IsLongDouble<long double> { enum {VALUE = 1}; };
struct IsLongDouble<long double> { enum {VALUE = 1}; };
*/
template
<
typename
Char
>
template
<
typename
Char
>
class
BasicCharTraits
{
class
BasicCharTraits
{
...
@@ -996,6 +999,8 @@ class PrintfFormatter : private FormatterBase {
...
@@ -996,6 +999,8 @@ class PrintfFormatter : private FormatterBase {
template
<
typename
Char
>
template
<
typename
Char
>
class
BasicFormatter
:
private
internal
::
FormatterBase
{
class
BasicFormatter
:
private
internal
::
FormatterBase
{
private:
private:
BasicFormatter
&
operator
=
(
BasicFormatter
const
&
);
// no impl
BasicWriter
<
Char
>
&
writer_
;
BasicWriter
<
Char
>
&
writer_
;
const
Char
*
start_
;
const
Char
*
start_
;
...
@@ -1496,6 +1501,9 @@ class BasicWriter {
...
@@ -1496,6 +1501,9 @@ class BasicWriter {
// Do not implement!
// Do not implement!
void
operator
<<
(
typename
internal
::
CharTraits
<
Char
>::
UnsupportedStrType
);
void
operator
<<
(
typename
internal
::
CharTraits
<
Char
>::
UnsupportedStrType
);
template
<
typename
T
>
Char
*
append_float_length
(
Char
*
format_ptr
);
friend
class
internal
::
ArgFormatter
<
Char
>
;
friend
class
internal
::
ArgFormatter
<
Char
>
;
friend
class
internal
::
PrintfFormatter
<
Char
>
;
friend
class
internal
::
PrintfFormatter
<
Char
>
;
...
@@ -1926,8 +1934,8 @@ void BasicWriter<Char>::write_double(
...
@@ -1926,8 +1934,8 @@ void BasicWriter<Char>::write_double(
*
format_ptr
++
=
'.'
;
*
format_ptr
++
=
'.'
;
*
format_ptr
++
=
'*'
;
*
format_ptr
++
=
'*'
;
}
}
if
(
internal
::
IsLongDouble
<
T
>::
VALUE
)
*
format_ptr
++
=
'L'
;
format_ptr
=
append_float_length
<
T
>
(
format_ptr
)
;
*
format_ptr
++
=
type
;
*
format_ptr
++
=
type
;
*
format_ptr
=
'\0'
;
*
format_ptr
=
'\0'
;
...
...
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