diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 5d466eeb..9a5f85c2 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -1646,8 +1646,7 @@ struct fixed_handler { // Implementation of Dragonbox algorithm: https://github.com/jk-jeon/dragonbox. namespace dragonbox { // Computes 128-bit result of multiplication of two 64-bit unsigned integers. -FMT_SAFEBUFFERS inline uint128_wrapper umul128(uint64_t x, - uint64_t y) FMT_NOEXCEPT { +inline uint128_wrapper umul128(uint64_t x, uint64_t y) FMT_NOEXCEPT { #if FMT_USE_INT128 return static_cast(x) * static_cast(y); #elif defined(_MSC_VER) && defined(_M_X64) @@ -1675,8 +1674,7 @@ FMT_SAFEBUFFERS inline uint128_wrapper umul128(uint64_t x, } // Computes upper 64 bits of multiplication of two 64-bit unsigned integers. -FMT_SAFEBUFFERS inline uint64_t umul128_upper64(uint64_t x, - uint64_t y) FMT_NOEXCEPT { +inline uint64_t umul128_upper64(uint64_t x, uint64_t y) FMT_NOEXCEPT { #if FMT_USE_INT128 auto p = static_cast(x) * static_cast(y); return static_cast(p >> 64); @@ -1689,8 +1687,7 @@ FMT_SAFEBUFFERS inline uint64_t umul128_upper64(uint64_t x, // Computes upper 64 bits of multiplication of a 64-bit unsigned integer and a // 128-bit unsigned integer. -FMT_SAFEBUFFERS inline uint64_t umul192_upper64(uint64_t x, uint128_wrapper y) - FMT_NOEXCEPT { +inline uint64_t umul192_upper64(uint64_t x, uint128_wrapper y) FMT_NOEXCEPT { uint128_wrapper g0 = umul128(x, y.high()); g0 += umul128_upper64(x, y.low()); return g0.high(); @@ -1704,8 +1701,7 @@ inline uint32_t umul96_upper32(uint32_t x, uint64_t y) FMT_NOEXCEPT { // Computes middle 64 bits of multiplication of a 64-bit unsigned integer and a // 128-bit unsigned integer. -FMT_SAFEBUFFERS inline uint64_t umul192_middle64(uint64_t x, uint128_wrapper y) - FMT_NOEXCEPT { +inline uint64_t umul192_middle64(uint64_t x, uint128_wrapper y) FMT_NOEXCEPT { uint64_t g01 = x * y.high(); uint64_t g10 = umul128_upper64(x, y.low()); return g01 + g10; @@ -2124,8 +2120,8 @@ FMT_ALWAYS_INLINE int remove_trailing_zeros(uint64_t& n) FMT_NOEXCEPT { // The main algorithm for shorter interval case template -FMT_ALWAYS_INLINE FMT_SAFEBUFFERS decimal_fp shorter_interval_case( - int exponent) FMT_NOEXCEPT { +FMT_ALWAYS_INLINE decimal_fp shorter_interval_case(int exponent) + FMT_NOEXCEPT { decimal_fp ret_value; // Compute k and beta const int minus_k = floor_log10_pow2_minus_log10_4_over_3(exponent); @@ -2171,8 +2167,7 @@ FMT_ALWAYS_INLINE FMT_SAFEBUFFERS decimal_fp shorter_interval_case( return ret_value; } -template -FMT_SAFEBUFFERS decimal_fp to_decimal(T x) FMT_NOEXCEPT { +template decimal_fp to_decimal(T x) FMT_NOEXCEPT { // Step 1: integer promotion & Schubfach multiplier calculation. using carrier_uint = typename float_info::carrier_uint; diff --git a/include/fmt/format.h b/include/fmt/format.h index da121cbd..4e773f58 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -745,8 +745,10 @@ void basic_memory_buffer::grow(size_t size) { const size_t max_size = std::allocator_traits::max_size(alloc_); size_t old_capacity = this->capacity(); size_t new_capacity = old_capacity + old_capacity / 2; - if (size > new_capacity) new_capacity = size; - else if (new_capacity > max_size) new_capacity = (std::max)(size, max_size); + if (size > new_capacity) + new_capacity = size; + else if (new_capacity > max_size) + new_capacity = (std::max)(size, max_size); T* old_data = this->data(); T* new_data = std::allocator_traits::allocate(alloc_, new_capacity); @@ -979,13 +981,6 @@ template <> int count_digits<4>(detail::fallback_uintptr n); # define FMT_ALWAYS_INLINE inline #endif -// To suppress unnecessary security cookie checks -#if FMT_MSC_VER && !FMT_CLANG_VERSION -# define FMT_SAFEBUFFERS __declspec(safebuffers) -#else -# define FMT_SAFEBUFFERS -#endif - #ifdef FMT_BUILTIN_CLZ // Optional version of count_digits for better performance on 32-bit platforms. inline int count_digits(uint32_t n) {