From 13094b78a790786030a468453c2b3ead4c7fd9cf Mon Sep 17 00:00:00 2001 From: Fabian Vogt 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..a0381c59 100644 --- a/templates/lib/util.cpp +++ b/templates/lib/util.cpp @@ -23,6 +23,7 @@ #include "metaenumvariable_p.h" #include "metatype.h" +#include #include QString Grantlee::unescapeStringLiteral(const QString &input) @@ -212,7 +213,13 @@ std::pair 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; scm?id=3602ccfcd39dd87dc2dc4b90610d8447e86ec8db'>commitdiff
AgeCommit message (Expand)Author
2024-12-02gnu: libreoffice: Update to 24.8.3.2....* gnu/packages/libreoffice.scm (libreoffice): Update to 24.8.3.2. [source]<uri>: Add secondary uri. [arguments]<#:phases>: Fix build issue related to issue 43579 in phase 'prepare-src. [configure-flags]: Add optimising flags --disable-cve-tests, --enable-readonly-installset, --disable-dependency-tracking. [native-inputs]: Add gcc-toolchain-12. [inputs]: Add argon2, zxcvbn-c. Change-Id: I72e0ebb4d075c47ea168b181f969a97f9249150a Signed-off-by: Ludovic Courtès <ludo@gnu.org> Nicolas Graves
2024-08-31gnu: LibreOffice: Build with libxcrypt....Glibc 2.38 no longer includes libcrypt by default, so we provide this functionality via libxcrypt. https://sourceware.org/glibc/wiki/Release/2.38#Building_libcrypt_is_disabled_by_default * gnu/packages/libreoffice.scm (libreoffice)[inputs]: Add libxcrypt. Change-Id: I3c9e02abb420a710d3a71bf137187dd989eb0398 Leo Famulari
2024-06-13gnu: libreoffice: Update to 7.6.7.2....* gnu/packages/libreoffice.scm (libreoffice): Update to 7.6.7.2. * gnu/packages/hunspell.scm (hunspell-dict-he-il, hunspell-dict-it-it): Update to 7.6.7.2. Change-Id: I289a0b2b9648930b46102c055c642c333a4229fd Co-authored-by: Ludovic Courtès <ludo@gnu.org> Nicolas Graves