mirror of
https://github.com/shadps4-emu/ext-fmt.git
synced 2024-11-23 09:49:42 +00:00
Cleanup warnings with nvhpc/21.9. (#2582)
* Cleanup warnings with nvhpc/21.9. * Move __NVCOMPILER check. * Be more explicit. * Immediately executed lambda. * Fix shadowing warning.
This commit is contained in:
parent
812733cc96
commit
e67f92c55c
@ -24,7 +24,8 @@
|
||||
# define FMT_CLANG_VERSION 0
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
|
||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && \
|
||||
!defined(__NVCOMPILER)
|
||||
# define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
|
||||
#else
|
||||
# define FMT_GCC_VERSION 0
|
||||
|
@ -970,11 +970,14 @@ FMT_CONSTEXPR auto count_digits(UInt n) -> int {
|
||||
if (num_bits<UInt>() == 32)
|
||||
return (FMT_BUILTIN_CLZ(static_cast<uint32_t>(n) | 1) ^ 31) / BITS + 1;
|
||||
#endif
|
||||
int num_digits = 0;
|
||||
do {
|
||||
++num_digits;
|
||||
} while ((n >>= BITS) != 0);
|
||||
return num_digits;
|
||||
// Lambda avoids unreachable code warnings from NVHPC.
|
||||
return [](UInt m) {
|
||||
int num_digits = 0;
|
||||
do {
|
||||
++num_digits;
|
||||
} while ((m >>= BITS) != 0);
|
||||
return num_digits;
|
||||
}(n);
|
||||
}
|
||||
|
||||
template <> auto count_digits<4>(detail::fallback_uintptr n) -> int;
|
||||
|
Loading…
Reference in New Issue
Block a user