Fix warnings from edits to master
This commit is contained in:
parent
739af475b3
commit
25f9b090ec
@ -283,12 +283,12 @@ class fp {
|
|||||||
typedef uint64_t significand_type;
|
typedef uint64_t significand_type;
|
||||||
|
|
||||||
// All sizes are in bits.
|
// All sizes are in bits.
|
||||||
static constexpr int char_size = std::numeric_limits<unsigned char>::digits;
|
static FMT_CONSTEXPR_DECL const int char_size = std::numeric_limits<unsigned char>::digits;
|
||||||
// Subtract 1 to account for an implicit most significant bit in the
|
// Subtract 1 to account for an implicit most significant bit in the
|
||||||
// normalized form.
|
// normalized form.
|
||||||
static constexpr int double_significand_size =
|
static FMT_CONSTEXPR_DECL const int double_significand_size =
|
||||||
std::numeric_limits<double>::digits - 1;
|
std::numeric_limits<double>::digits - 1;
|
||||||
static constexpr uint64_t implicit_bit = 1ull << double_significand_size;
|
static FMT_CONSTEXPR_DECL const uint64_t implicit_bit = 1ull << double_significand_size;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
significand_type f;
|
significand_type f;
|
||||||
@ -317,7 +317,7 @@ class fp {
|
|||||||
f += implicit_bit;
|
f += implicit_bit;
|
||||||
else
|
else
|
||||||
biased_e = 1; // Subnormals use biased exponent 1 (min exponent).
|
biased_e = 1; // Subnormals use biased exponent 1 (min exponent).
|
||||||
e = biased_e - exponent_bias - double_significand_size;
|
e = static_cast<int>(biased_e - exponent_bias - double_significand_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normalizes the value converted from double and multiplied by (1 << SHIFT).
|
// Normalizes the value converted from double and multiplied by (1 << SHIFT).
|
||||||
@ -2660,7 +2660,7 @@ class basic_writer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct double_writer {
|
struct double_writer {
|
||||||
unsigned n;
|
size_t n;
|
||||||
char sign;
|
char sign;
|
||||||
basic_memory_buffer<char_type> &buffer;
|
basic_memory_buffer<char_type> &buffer;
|
||||||
|
|
||||||
@ -2914,7 +2914,7 @@ void basic_writer<Range>::write_double(T value, const format_specs &spec) {
|
|||||||
internal::fp product = fp_value * dec_pow;
|
internal::fp product = fp_value * dec_pow;
|
||||||
// Generate output.
|
// Generate output.
|
||||||
internal::fp one(1ull << -product.e, product.e);
|
internal::fp one(1ull << -product.e, product.e);
|
||||||
uint32_t hi = product.f >> -one.e;
|
uint64_t hi = product.f >> -one.e;
|
||||||
uint64_t f = product.f & (one.f - 1);
|
uint64_t f = product.f & (one.f - 1);
|
||||||
typedef back_insert_range<internal::basic_buffer<char_type>> range;
|
typedef back_insert_range<internal::basic_buffer<char_type>> range;
|
||||||
basic_writer<range> w{range(buffer)};
|
basic_writer<range> w{range(buffer)};
|
||||||
@ -2934,7 +2934,7 @@ void basic_writer<Range>::write_double(T value, const format_specs &spec) {
|
|||||||
normalized_spec.type_ = handler.type;
|
normalized_spec.type_ = handler.type;
|
||||||
write_double_sprintf(value, normalized_spec, buffer);
|
write_double_sprintf(value, normalized_spec, buffer);
|
||||||
}
|
}
|
||||||
unsigned n = buffer.size();
|
size_t n = buffer.size();
|
||||||
align_spec as = spec;
|
align_spec as = spec;
|
||||||
if (spec.align() == ALIGN_NUMERIC) {
|
if (spec.align() == ALIGN_NUMERIC) {
|
||||||
if (sign) {
|
if (sign) {
|
||||||
|
|||||||
@ -36,7 +36,7 @@ elseif (CMAKE_CXX_STANDARD EQUAL 14)
|
|||||||
set(CXX_STANDARD_FLAG -std=c++1y)
|
set(CXX_STANDARD_FLAG -std=c++1y)
|
||||||
endif ()
|
endif ()
|
||||||
elseif (CMAKE_CXX_STANDARD EQUAL 11)
|
elseif (CMAKE_CXX_STANDARD EQUAL 11)
|
||||||
check_cxx_compiler_flag(-std=c++11 has_std_14_flag)
|
check_cxx_compiler_flag(-std=c++11 has_std_11_flag)
|
||||||
check_cxx_compiler_flag(-std=c++0x has_std_0x_flag)
|
check_cxx_compiler_flag(-std=c++0x has_std_0x_flag)
|
||||||
|
|
||||||
if (has_std_11_flag)
|
if (has_std_11_flag)
|
||||||
|
|||||||
@ -150,8 +150,6 @@ if (FMT_PEDANTIC)
|
|||||||
target_include_directories(no-windows-h-test SYSTEM PUBLIC gtest gmock)
|
target_include_directories(no-windows-h-test SYSTEM PUBLIC gtest gmock)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
message(STATUS USER_DEFINED_LITERALS: ${SUPPORTS_USER_DEFINED_LITERALS})
|
|
||||||
|
|
||||||
add_test(compile-test ${CMAKE_CTEST_COMMAND}
|
add_test(compile-test ${CMAKE_CTEST_COMMAND}
|
||||||
--build-and-test
|
--build-and-test
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/compile-test"
|
"${CMAKE_CURRENT_SOURCE_DIR}/compile-test"
|
||||||
|
|||||||
@ -475,7 +475,13 @@ double _strtod_l(const char *nptr, char **endptr, _locale_t locale) {
|
|||||||
# pragma warning(pop)
|
# pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LocaleType newlocale(int category_mask, const char *locale, LocaleType base) {
|
#if defined(__THROW) && FMT_GCC_VERSION > 0 && FMT_GCC_VERSION <= 408
|
||||||
|
#define FMT_LOCALE_THROW __THROW
|
||||||
|
#else
|
||||||
|
#define FMT_LOCALE_THROW
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LocaleType newlocale(int category_mask, const char *locale, LocaleType base) FMT_LOCALE_THROW {
|
||||||
return LocaleMock::instance->newlocale(category_mask, locale, base);
|
return LocaleMock::instance->newlocale(category_mask, locale, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,15 +491,17 @@ typedef int FreeLocaleResult;
|
|||||||
typedef void FreeLocaleResult;
|
typedef void FreeLocaleResult;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FreeLocaleResult freelocale(LocaleType locale) {
|
FreeLocaleResult freelocale(LocaleType locale) FMT_LOCALE_THROW {
|
||||||
LocaleMock::instance->freelocale(locale);
|
LocaleMock::instance->freelocale(locale);
|
||||||
return FreeLocaleResult();
|
return FreeLocaleResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
double strtod_l(const char *nptr, char **endptr, LocaleType locale) {
|
double strtod_l(const char *nptr, char **endptr, LocaleType locale) FMT_LOCALE_THROW {
|
||||||
return LocaleMock::instance->strtod_l(nptr, endptr, locale);
|
return LocaleMock::instance->strtod_l(nptr, endptr, locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef FMT_LOCALE_THROW
|
||||||
|
|
||||||
TEST(LocaleTest, LocaleMock) {
|
TEST(LocaleTest, LocaleMock) {
|
||||||
ScopedMock<LocaleMock> mock;
|
ScopedMock<LocaleMock> mock;
|
||||||
LocaleType locale = reinterpret_cast<LocaleType>(11);
|
LocaleType locale = reinterpret_cast<LocaleType>(11);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user