- Update to release 9.1

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/fmt?expand=0&rev=48
This commit is contained in:
Jan Engelhardt 2022-08-28 06:39:29 +00:00 committed by Git OBS Bridge
parent 422272881a
commit 2c7995fa56
7 changed files with 19 additions and 119 deletions

View File

@ -1,52 +0,0 @@
From 2a1b3ac629bfec51ce70d3c0ebaf28e706754e19 Mon Sep 17 00:00:00 2001
From: Victor Zverovich <viz@fb.com>
Date: Sun, 10 Jul 2022 08:14:18 -0700
Subject: [PATCH 1/2] Fix large shift in uint128_fallback
---
include/fmt/format.h | 2 ++
test/format-test.cc | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 0bd2fdb1..6516975e 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -366,10 +366,12 @@ class uint128_fallback {
}
FMT_CONSTEXPR auto operator>>(int shift) const -> uint128_fallback {
if (shift == 64) return {0, hi_};
+ if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 64);
return {hi_ >> shift, (hi_ << (64 - shift)) | (lo_ >> shift)};
}
FMT_CONSTEXPR auto operator<<(int shift) const -> uint128_fallback {
if (shift == 64) return {lo_, 0};
+ if (shift > 64) return uint128_fallback(lo_, 0) << (shift - 64);
return {hi_ << shift | (lo_ >> (64 - shift)), (lo_ << shift)};
}
FMT_CONSTEXPR auto operator>>=(int shift) -> uint128_fallback& {
diff --git a/test/format-test.cc b/test/format-test.cc
index 45a92624..8c1c305f 100644
--- a/test/format-test.cc
+++ b/test/format-test.cc
@@ -59,6 +59,8 @@ TEST(uint128_test, shift) {
EXPECT_EQ(static_cast<uint64_t>(n), 0x8000000000000000);
n = n >> 62;
EXPECT_EQ(static_cast<uint64_t>(n), 42);
+ EXPECT_EQ(uint128_fallback(1) << 112, uint128_fallback(0x1000000000000, 0));
+ EXPECT_EQ(uint128_fallback(0x1000000000000, 0) >> 112, uint128_fallback(1));
}
TEST(uint128_test, minus) {
@@ -234,7 +236,7 @@ TEST(util_test, format_system_error) {
throws_on_alloc = true;
}
if (!throws_on_alloc) {
- fmt::print("warning: std::allocator allocates {} chars", max_size);
+ fmt::print("warning: std::allocator allocates {} chars\n", max_size);
return;
}
}
--
2.36.1

View File

@ -1,25 +0,0 @@
From d82e1a108d3b3e3e7b8b019b47df9c4ed127723b Mon Sep 17 00:00:00 2001
From: Victor Zverovich <viz@fb.com>
Date: Wed, 13 Jul 2022 12:33:57 -0700
Subject: [PATCH] Make sure the correct fmod overload is called
---
include/fmt/chrono.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h
index 9b2aa74d..4a2c3a3d 100644
--- a/include/fmt/chrono.h
+++ b/include/fmt/chrono.h
@@ -1777,7 +1777,7 @@ struct chrono_formatter {
format_to(std::back_inserter(buf), runtime("{:.{}f}"),
std::fmod(val * static_cast<rep>(Period::num) /
static_cast<rep>(Period::den),
- 60),
+ static_cast<rep>(60)),
num_fractional_digits);
if (negative) *out++ = '-';
if (buf.size() < 2 || buf[1] == '.') *out++ = '0';
--
2.36.1

View File

@ -1,34 +0,0 @@
From 05be7a0764f8fbfbdf9c9750ec54d49fe3d2419f Mon Sep 17 00:00:00 2001
From: Victor Zverovich <viz@fb.com>
Date: Sun, 10 Jul 2022 08:47:16 -0700
Subject: [PATCH 2/2] Use FMT_USE_FLOAT128 instead of __SIZEOF_FLOAT128__
---
test/format-test.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/format-test.cc b/test/format-test.cc
index 8c1c305f..4ec7c838 100644
--- a/test/format-test.cc
+++ b/test/format-test.cc
@@ -101,7 +101,7 @@ template <typename Float> void check_isfinite() {
TEST(float_test, isfinite) {
check_isfinite<double>();
-#ifdef __SIZEOF_FLOAT128__
+#if FMT_USE_FLOAT128
check_isfinite<fmt::detail::float128>();
#endif
}
@@ -122,7 +122,7 @@ template <typename Float> void check_isnan() {
TEST(float_test, isnan) {
check_isnan<double>();
-#ifdef __SIZEOF_FLOAT128__
+#if FMT_USE_FLOAT128
check_isnan<fmt::detail::float128>();
#endif
}
--
2.36.1

BIN
9.1.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9a1e0e9e843a356d65c7604e2c8bf9402b50fe294c355de0095ebd42fb9bd2c5
size 833639

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Sun Aug 28 06:35:23 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- Update to release 9.1
* fmt::formatted_size now works at compile time
* Fixed handling of invalid UTF-8 (#3038)
* Improved Unicode support in ostream overloads of print
* Added support for wide streams to fmt::streamed
* Added the n specifier that disables the output of delimiters
when formatting ranges (#2981)
- Delete 0001-Fix-large-shift-in-uint128_fallback.patch
0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch
0001-Make-sure-the-correct-fmod-overload-is-called.patch (merged)
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jul 5 14:16:23 UTC 2022 - Jan Engelhardt <jengelh@inai.de> Tue Jul 5 14:16:23 UTC 2022 - Jan Engelhardt <jengelh@inai.de>

View File

@ -18,16 +18,13 @@
%define sover 9 %define sover 9
Name: fmt Name: fmt
Version: 9.0.0 Version: 9.1.0
Release: 0 Release: 0
Summary: A formatting library for C++ Summary: A formatting library for C++
License: MIT License: MIT
URL: http://fmtlib.net/ URL: http://fmtlib.net/
Source0: https://github.com/fmtlib/fmt/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source: https://github.com/fmtlib/fmt/archive/%version.tar.gz
Source1: baselibs.conf Source1: baselibs.conf
Patch1: 0001-Fix-large-shift-in-uint128_fallback.patch
Patch2: 0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch
Patch3: 0001-Make-sure-the-correct-fmod-overload-is-called.patch
BuildRequires: c++_compiler BuildRequires: c++_compiler
BuildRequires: cmake BuildRequires: cmake
BuildRequires: pkg-config BuildRequires: pkg-config