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
7561ff27
Commit
7561ff27
authored
Feb 15, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings about unsigned long long as well.
parent
7325ebc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
22 deletions
+12
-22
format.h
format.h
+12
-22
No files found.
format.h
View file @
7561ff27
...
@@ -70,12 +70,6 @@
...
@@ -70,12 +70,6 @@
# define FMT_NOEXCEPT(expr)
# define FMT_NOEXCEPT(expr)
#endif
#endif
#if FMT_GCC_VERSION >= 406
# define FMT_GCC_DIAGNOSTIC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wlong-long"
#endif
#if _MSC_VER
#if _MSC_VER
# pragma warning(push)
# pragma warning(push)
# pragma warning(disable: 4521)
# pragma warning(disable: 4521)
...
@@ -87,8 +81,10 @@ namespace fmt {
...
@@ -87,8 +81,10 @@ namespace fmt {
// that don't support the diagnostic pragma.
// that don't support the diagnostic pragma.
#ifdef __GNUC__
#ifdef __GNUC__
__extension__
typedef
long
long
LongLong
;
__extension__
typedef
long
long
LongLong
;
__extension__
typedef
unsigned
long
long
ULongLong
;
#else
#else
typedef
long
long
LongLong
;
typedef
long
long
LongLong
;
typedef
unsigned
long
long
ULongLong
;
#endif
#endif
namespace
internal
{
namespace
internal
{
...
@@ -241,7 +237,7 @@ template <>
...
@@ -241,7 +237,7 @@ template <>
struct
IntTraits
<
long
>
:
SignedIntTraits
<
long
,
unsigned
long
>
{};
struct
IntTraits
<
long
>
:
SignedIntTraits
<
long
,
unsigned
long
>
{};
template
<
>
template
<
>
struct
IntTraits
<
LongLong
>
:
SignedIntTraits
<
LongLong
,
unsigned
long
l
ong
>
{};
struct
IntTraits
<
LongLong
>
:
SignedIntTraits
<
LongLong
,
ULongL
ong
>
{};
template
<
typename
T
>
template
<
typename
T
>
struct
IsLongDouble
{
enum
{
VALUE
=
0
};
};
struct
IsLongDouble
{
enum
{
VALUE
=
0
};
};
...
@@ -542,7 +538,7 @@ DEFINE_INT_FORMATTERS(long)
...
@@ -542,7 +538,7 @@ DEFINE_INT_FORMATTERS(long)
DEFINE_INT_FORMATTERS
(
unsigned
)
DEFINE_INT_FORMATTERS
(
unsigned
)
DEFINE_INT_FORMATTERS
(
unsigned
long
)
DEFINE_INT_FORMATTERS
(
unsigned
long
)
DEFINE_INT_FORMATTERS
(
LongLong
)
DEFINE_INT_FORMATTERS
(
LongLong
)
DEFINE_INT_FORMATTERS
(
unsigned
long
l
ong
)
DEFINE_INT_FORMATTERS
(
ULongL
ong
)
/**
/**
\rst
\rst
...
@@ -732,8 +728,8 @@ class BasicWriter {
...
@@ -732,8 +728,8 @@ class BasicWriter {
/**
/**
Formats *value* and writes it to the stream.
Formats *value* and writes it to the stream.
*/
*/
BasicWriter
&
operator
<<
(
unsigned
long
l
ong
value
)
{
BasicWriter
&
operator
<<
(
ULongL
ong
value
)
{
return
*
this
<<
IntFormatSpec
<
unsigned
long
l
ong
>
(
value
);
return
*
this
<<
IntFormatSpec
<
ULongL
ong
>
(
value
);
}
}
BasicWriter
&
operator
<<
(
double
value
)
{
BasicWriter
&
operator
<<
(
double
value
)
{
...
@@ -984,7 +980,7 @@ class BasicFormatter {
...
@@ -984,7 +980,7 @@ class BasicFormatter {
long
long_value
;
long
long_value
;
unsigned
long
ulong_value
;
unsigned
long
ulong_value
;
LongLong
long_long_value
;
LongLong
long_long_value
;
unsigned
long
l
ong
ulong_long_value
;
ULongL
ong
ulong_long_value
;
long
double
long_double_value
;
long
double
long_double_value
;
const
void
*
pointer_value
;
const
void
*
pointer_value
;
StringValue
string
;
StringValue
string
;
...
@@ -1000,7 +996,7 @@ class BasicFormatter {
...
@@ -1000,7 +996,7 @@ class BasicFormatter {
Arg
(
unsigned
long
value
)
:
type
(
ULONG
),
ulong_value
(
value
),
formatter
(
0
)
{}
Arg
(
unsigned
long
value
)
:
type
(
ULONG
),
ulong_value
(
value
),
formatter
(
0
)
{}
Arg
(
LongLong
value
)
Arg
(
LongLong
value
)
:
type
(
LONG_LONG
),
long_long_value
(
value
),
formatter
(
0
)
{}
:
type
(
LONG_LONG
),
long_long_value
(
value
),
formatter
(
0
)
{}
Arg
(
unsigned
long
l
ong
value
)
Arg
(
ULongL
ong
value
)
:
type
(
ULONG_LONG
),
ulong_long_value
(
value
),
formatter
(
0
)
{}
:
type
(
ULONG_LONG
),
ulong_long_value
(
value
),
formatter
(
0
)
{}
Arg
(
float
value
)
:
type
(
DOUBLE
),
double_value
(
value
),
formatter
(
0
)
{}
Arg
(
float
value
)
:
type
(
DOUBLE
),
double_value
(
value
),
formatter
(
0
)
{}
Arg
(
double
value
)
:
type
(
DOUBLE
),
double_value
(
value
),
formatter
(
0
)
{}
Arg
(
double
value
)
:
type
(
DOUBLE
),
double_value
(
value
),
formatter
(
0
)
{}
...
@@ -1066,8 +1062,6 @@ class BasicFormatter {
...
@@ -1066,8 +1062,6 @@ class BasicFormatter {
int
num_open_braces_
;
int
num_open_braces_
;
int
next_arg_index_
;
int
next_arg_index_
;
typedef
unsigned
long
long
ULongLong
;
friend
class
internal
::
FormatterProxy
<
Char
>
;
friend
class
internal
::
FormatterProxy
<
Char
>
;
// Forbid copying from a temporary as in the following example:
// Forbid copying from a temporary as in the following example:
...
@@ -1293,12 +1287,12 @@ class FormatInt {
...
@@ -1293,12 +1287,12 @@ class FormatInt {
private:
private:
// Buffer should be large enough to hold all digits (digits10 + 1),
// Buffer should be large enough to hold all digits (digits10 + 1),
// a sign and a null character.
// a sign and a null character.
enum
{
BUFFER_SIZE
=
std
::
numeric_limits
<
unsigned
long
l
ong
>::
digits10
+
3
};
enum
{
BUFFER_SIZE
=
std
::
numeric_limits
<
ULongL
ong
>::
digits10
+
3
};
mutable
char
buffer_
[
BUFFER_SIZE
];
mutable
char
buffer_
[
BUFFER_SIZE
];
char
*
str_
;
char
*
str_
;
// Formats value in reverse and returns the number of digits.
// Formats value in reverse and returns the number of digits.
char
*
FormatDecimal
(
unsigned
long
l
ong
value
)
{
char
*
FormatDecimal
(
ULongL
ong
value
)
{
char
*
buffer_end
=
buffer_
+
BUFFER_SIZE
-
1
;
char
*
buffer_end
=
buffer_
+
BUFFER_SIZE
-
1
;
while
(
value
>=
100
)
{
while
(
value
>=
100
)
{
// Integer division is slow so do it for a group of two digits instead
// Integer division is slow so do it for a group of two digits instead
...
@@ -1320,7 +1314,7 @@ class FormatInt {
...
@@ -1320,7 +1314,7 @@ class FormatInt {
}
}
void
FormatSigned
(
LongLong
value
)
{
void
FormatSigned
(
LongLong
value
)
{
unsigned
long
l
ong
abs_value
=
value
;
ULongL
ong
abs_value
=
value
;
bool
negative
=
value
<
0
;
bool
negative
=
value
<
0
;
if
(
negative
)
if
(
negative
)
abs_value
=
0
-
value
;
abs_value
=
0
-
value
;
...
@@ -1335,7 +1329,7 @@ class FormatInt {
...
@@ -1335,7 +1329,7 @@ class FormatInt {
explicit
FormatInt
(
LongLong
value
)
{
FormatSigned
(
value
);
}
explicit
FormatInt
(
LongLong
value
)
{
FormatSigned
(
value
);
}
explicit
FormatInt
(
unsigned
value
)
:
str_
(
FormatDecimal
(
value
))
{}
explicit
FormatInt
(
unsigned
value
)
:
str_
(
FormatDecimal
(
value
))
{}
explicit
FormatInt
(
unsigned
long
value
)
:
str_
(
FormatDecimal
(
value
))
{}
explicit
FormatInt
(
unsigned
long
value
)
:
str_
(
FormatDecimal
(
value
))
{}
explicit
FormatInt
(
unsigned
long
l
ong
value
)
:
str_
(
FormatDecimal
(
value
))
{}
explicit
FormatInt
(
ULongL
ong
value
)
:
str_
(
FormatDecimal
(
value
))
{}
/**
/**
Returns the number of characters written to the output buffer.
Returns the number of characters written to the output buffer.
...
@@ -1428,10 +1422,6 @@ inline Formatter<Write> Print(StringRef format) {
...
@@ -1428,10 +1422,6 @@ inline Formatter<Write> Print(StringRef format) {
}
}
}
}
#ifdef FMT_GCC_DIAGNOSTIC
# pragma GCC diagnostic pop
#endif
#if _MSC_VER
#if _MSC_VER
# pragma warning(pop)
# pragma warning(pop)
#endif
#endif
...
...
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