]> git.pld-linux.org Git - packages/grantlee-qt5.git/commitdiff
- added x87fix.patch from https://github.com/steveire/grantlee/commit/7e34ffaff40fc08... master auto/th/grantlee-qt5-5.3.1-1
authorWitold Filipczyk <witekfl@poczta.onet.pl>
Sun, 23 Apr 2023 16:05:27 +0000 (18:05 +0200)
committerWitold Filipczyk <witekfl@poczta.onet.pl>
Sun, 23 Apr 2023 16:05:27 +0000 (18:05 +0200)
grantlee-qt5.spec
x87fix.patch [new file with mode: 0644]

index 0ac4d87a5217309a3b6b9c8850fb4564c3549f33..791b8f36b2d3c9e5ce6e69380059abc8dbfd99f2 100644 (file)
@@ -13,6 +13,7 @@ License:      LGPL v2.1+
 Group:         Libraries
 Source0:       https://github.com/steveire/grantlee/releases/download/v%{version}/grantlee-%{version}.tar.gz
 # Source0-md5: 4ef8eae5dd61e3c7603d76208eb4d922
+Patch0:                x87fix.patch
 URL:           http://www.grantlee.org/
 BuildRequires: Qt5Core-devel >= %{qt_ver}
 BuildRequires: Qt5Gui-devel >= %{qt_ver}
@@ -59,6 +60,7 @@ Pliki nagłówkowe bibliotek grantlee.
 
 %prep
 %setup -q -n grantlee-%{version}
+%patch0 -p1
 
 %build
 install -d build
diff --git a/x87fix.patch b/x87fix.patch
new file mode 100644 (file)
index 0000000..402fe7a
--- /dev/null
@@ -0,0 +1,40 @@
+From 7e34ffaff40fc085a15bb0ffabb5f247795581fd Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fabian@ritter-vogt.de>
+Date: Sun, 13 Nov 2022 14:01:21 +0100
+Subject: [PATCH] Fix formatting of some larger file sizes on 32bit x86
+
+With the x87 FPU available, GCC uses long double precision for some variables.
+Due to the function call passing a double, some comparisons break down.
+That resulted in "1.00 YB" being printed as "1000.00 ZB" instead.
+
+Fixes #85
+---
+ templates/lib/util.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/templates/lib/util.cpp b/templates/lib/util.cpp
+index 504674a7..5924cdf5 100644
+--- a/templates/lib/util.cpp
++++ b/templates/lib/util.cpp
+@@ -23,6 +23,7 @@
+ #include "metaenumvariable_p.h"
+ #include "metatype.h"
++#include <cfloat>
+ #include <QtCore/QStringList>
+ QString Grantlee::unescapeStringLiteral(const QString &input)
+@@ -212,7 +213,13 @@ std::pair<qreal, QString> Grantlee::calcFileSize(qreal size, int unitSystem,
+   bool found = false;
+   int count = 0;
+   const qreal baseVal = (_unitSystem == 10) ? 1000.0F : 1024.0F;
++#if FLT_EVAL_METHOD == 2
++  // Avoid that this is treated as long double, as the increased
++  // precision breaks the comparison below.
++  volatile qreal current = 1.0F;
++#else
+   qreal current = 1.0F;
++#endif
+   int units = decimalUnits.size();
+   while (!found && (count < units)) {
+     current *= baseVal;
This page took 0.163064 seconds and 4 git commands to generate.