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
3a044814
Commit
3a044814
authored
Sep 11, 2021
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove data::hex_digits
parent
ad77331c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
include/fmt/format-inl.h
include/fmt/format-inl.h
+2
-5
include/fmt/format.h
include/fmt/format.h
+2
-3
No files found.
include/fmt/format-inl.h
View file @
3a044814
...
@@ -154,7 +154,6 @@ static constexpr uint64_t log10_2_significand = 0x4d104d427de7fbcc;
...
@@ -154,7 +154,6 @@ static constexpr uint64_t log10_2_significand = 0x4d104d427de7fbcc;
#if __cplusplus < 201703L
#if __cplusplus < 201703L
template
<
typename
T
>
constexpr
const
char
basic_data
<
T
>::
digits
[][
2
];
template
<
typename
T
>
constexpr
const
char
basic_data
<
T
>::
digits
[][
2
];
template
<
typename
T
>
constexpr
const
char
basic_data
<
T
>::
hex_digits
[];
template
<
typename
T
>
constexpr
const
unsigned
basic_data
<
T
>::
prefixes
[];
template
<
typename
T
>
constexpr
const
unsigned
basic_data
<
T
>::
prefixes
[];
#endif
#endif
...
@@ -916,8 +915,7 @@ inline uint64_t umul96_lower64(uint32_t x, uint64_t y) FMT_NOEXCEPT {
...
@@ -916,8 +915,7 @@ inline uint64_t umul96_lower64(uint32_t x, uint64_t y) FMT_NOEXCEPT {
inline
int
floor_log10_pow2
(
int
e
)
FMT_NOEXCEPT
{
inline
int
floor_log10_pow2
(
int
e
)
FMT_NOEXCEPT
{
FMT_ASSERT
(
e
<=
1700
&&
e
>=
-
1700
,
"too large exponent"
);
FMT_ASSERT
(
e
<=
1700
&&
e
>=
-
1700
,
"too large exponent"
);
const
int
shift
=
22
;
const
int
shift
=
22
;
return
(
e
*
static_cast
<
int
>
(
log10_2_significand
>>
(
64
-
shift
)))
>>
return
(
e
*
static_cast
<
int
>
(
log10_2_significand
>>
(
64
-
shift
)))
>>
shift
;
shift
;
}
}
// Various fast log computations.
// Various fast log computations.
...
@@ -935,8 +933,7 @@ inline int floor_log10_pow2_minus_log10_4_over_3(int e) FMT_NOEXCEPT {
...
@@ -935,8 +933,7 @@ inline int floor_log10_pow2_minus_log10_4_over_3(int e) FMT_NOEXCEPT {
FMT_ASSERT
(
e
<=
1700
&&
e
>=
-
1700
,
"too large exponent"
);
FMT_ASSERT
(
e
<=
1700
&&
e
>=
-
1700
,
"too large exponent"
);
const
uint64_t
log10_4_over_3_fractional_digits
=
0x1ffbfc2bbc780375
;
const
uint64_t
log10_4_over_3_fractional_digits
=
0x1ffbfc2bbc780375
;
const
int
shift_amount
=
22
;
const
int
shift_amount
=
22
;
return
(
e
*
static_cast
<
int
>
(
log10_2_significand
>>
return
(
e
*
static_cast
<
int
>
(
log10_2_significand
>>
(
64
-
shift_amount
))
-
(
64
-
shift_amount
))
-
static_cast
<
int
>
(
log10_4_over_3_fractional_digits
>>
static_cast
<
int
>
(
log10_4_over_3_fractional_digits
>>
(
64
-
shift_amount
)))
>>
(
64
-
shift_amount
)))
>>
shift_amount
;
shift_amount
;
...
...
include/fmt/format.h
View file @
3a044814
...
@@ -905,7 +905,6 @@ template <typename T = void> struct basic_data {
...
@@ -905,7 +905,6 @@ template <typename T = void> struct basic_data {
{
'9'
,
'0'
},
{
'9'
,
'1'
},
{
'9'
,
'2'
},
{
'9'
,
'3'
},
{
'9'
,
'4'
},
{
'9'
,
'5'
},
{
'9'
,
'0'
},
{
'9'
,
'1'
},
{
'9'
,
'2'
},
{
'9'
,
'3'
},
{
'9'
,
'4'
},
{
'9'
,
'5'
},
{
'9'
,
'6'
},
{
'9'
,
'7'
},
{
'9'
,
'8'
},
{
'9'
,
'9'
}};
{
'9'
,
'6'
},
{
'9'
,
'7'
},
{
'9'
,
'8'
},
{
'9'
,
'9'
}};
FMT_API
static
constexpr
const
char
hex_digits
[]
=
"0123456789abcdef"
;
FMT_API
static
constexpr
const
unsigned
prefixes
[
4
]
=
{
0
,
0
,
0x1000000u
|
'+'
,
FMT_API
static
constexpr
const
unsigned
prefixes
[
4
]
=
{
0
,
0
,
0x1000000u
|
'+'
,
0x1000000u
|
' '
};
0x1000000u
|
' '
};
};
};
...
@@ -1135,7 +1134,7 @@ FMT_CONSTEXPR auto format_uint(Char* buffer, UInt value, int num_digits,
...
@@ -1135,7 +1134,7 @@ FMT_CONSTEXPR auto format_uint(Char* buffer, UInt value, int num_digits,
buffer
+=
num_digits
;
buffer
+=
num_digits
;
Char
*
end
=
buffer
;
Char
*
end
=
buffer
;
do
{
do
{
const
char
*
digits
=
upper
?
"0123456789ABCDEF"
:
data
::
hex_digits
;
const
char
*
digits
=
upper
?
"0123456789ABCDEF"
:
"0123456789abcdef"
;
unsigned
digit
=
(
value
&
((
1
<<
BASE_BITS
)
-
1
));
unsigned
digit
=
(
value
&
((
1
<<
BASE_BITS
)
-
1
));
*--
buffer
=
static_cast
<
Char
>
(
BASE_BITS
<
4
?
static_cast
<
char
>
(
'0'
+
digit
)
*--
buffer
=
static_cast
<
Char
>
(
BASE_BITS
<
4
?
static_cast
<
char
>
(
'0'
+
digit
)
:
digits
[
digit
]);
:
digits
[
digit
]);
...
@@ -1158,7 +1157,7 @@ auto format_uint(Char* buffer, detail::fallback_uintptr n, int num_digits,
...
@@ -1158,7 +1157,7 @@ auto format_uint(Char* buffer, detail::fallback_uintptr n, int num_digits,
auto
p
=
buffer
;
auto
p
=
buffer
;
for
(
int
i
=
0
;
i
<
char_digits
;
++
i
)
{
for
(
int
i
=
0
;
i
<
char_digits
;
++
i
)
{
unsigned
digit
=
(
value
&
((
1
<<
BASE_BITS
)
-
1
));
unsigned
digit
=
(
value
&
((
1
<<
BASE_BITS
)
-
1
));
*--
p
=
static_cast
<
Char
>
(
data
::
hex_digits
[
digit
]);
*--
p
=
static_cast
<
Char
>
(
"0123456789abcdef"
[
digit
]);
value
>>=
BASE_BITS
;
value
>>=
BASE_BITS
;
}
}
}
}
...
...
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