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
222f2d28
Commit
222f2d28
authored
Nov 25, 2015
by
vitaut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MSVC warnings
parent
f60c4b99
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
format.h
format.h
+14
-10
No files found.
format.h
View file @
222f2d28
...
...
@@ -232,6 +232,11 @@ inline DummyInt isinf(...) { return DummyInt(); }
inline
DummyInt
_finite
(...)
{
return
DummyInt
();
}
inline
DummyInt
isnan
(...)
{
return
DummyInt
();
}
inline
DummyInt
_isnan
(...)
{
return
DummyInt
();
}
// A helper function to suppress bogus "conditional expression is constant"
// warnings.
template
<
typename
T
>
inline
T
check
(
T
value
)
{
return
value
;
}
}
}
// namespace fmt
...
...
@@ -250,24 +255,28 @@ class numeric_limits<fmt::internal::DummyInt> :
using
namespace
fmt
::
internal
;
// The resolution "priority" is:
// isinf macro > std::isinf > ::isinf > fmt::internal::isinf
if
(
sizeof
(
isinf
(
x
))
==
sizeof
(
bool
)
||
sizeof
(
isinf
(
x
))
==
sizeof
(
int
))
if
(
check
(
sizeof
(
isinf
(
x
))
==
sizeof
(
bool
)
||
sizeof
(
isinf
(
x
))
==
sizeof
(
int
)))
{
return
isinf
(
x
);
return
!
_finite
(
x
);
}
return
!
_finite
(
static_cast
<
double
>
(
x
));
}
// Portable version of isnan.
template
<
typename
T
>
static
bool
isnotanumber
(
T
x
)
{
using
namespace
fmt
::
internal
;
if
(
sizeof
(
isnan
(
x
))
==
sizeof
(
bool
)
||
sizeof
(
isnan
(
x
))
==
sizeof
(
int
))
if
(
check
(
sizeof
(
isnan
(
x
))
==
sizeof
(
bool
)
||
sizeof
(
isnan
(
x
))
==
sizeof
(
int
)))
{
return
isnan
(
x
);
return
_isnan
(
x
)
!=
0
;
}
return
_isnan
(
static_cast
<
double
>
(
x
))
!=
0
;
}
// Portable version of signbit.
static
bool
isnegative
(
double
x
)
{
using
namespace
fmt
::
internal
;
if
(
sizeof
(
signbit
(
x
))
==
sizeof
(
int
))
if
(
check
(
sizeof
(
signbit
(
x
))
==
sizeof
(
int
)
))
return
signbit
(
x
);
if
(
x
<
0
)
return
true
;
if
(
!
isnotanumber
(
x
))
return
false
;
...
...
@@ -1006,11 +1015,6 @@ struct Not { enum { value = 0 }; };
template
<
>
struct
Not
<
false
>
{
enum
{
value
=
1
};
};
// A helper function to suppress bogus "conditional expression is constant"
// warnings.
template
<
typename
T
>
inline
T
check
(
T
value
)
{
return
value
;
}
// Makes an Arg object from any type.
template
<
typename
Char
>
class
MakeValue
:
public
Arg
{
...
...
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