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; 3dd422c'>commitdiff
AgeCommit message (Expand)Author
2024-11-20gnu: ncmpcpp: Update to 0.10.1....* gnu/packages/mpd.scm (ncmpcpp): Update to 0.10.1. [origin]: Change URI to github. [native-inputs]: Add libtool, autoconf-2.71, automake. [arguments]: Use G-expressions. Change-Id: Id2662c10c143736d10320550b6ce6fffe841984c Mazin AlHaddad
2024-11-02gnu: mpd-mpc: build from git source....* gnu/packages/mpd.scm (mpd-mpc)[source]: Switch to git-fetch. Change-Id: I56e11e9565c3b1d8130f3f4806d99ad55d94ee26 Zheng Junjie
2024-11-02gnu: mpd-mpc: Update to 0.35....* gnu/packages/mpd.scm (mpd-mpc): Update to 0.35. Change-Id: I72237f9fd0e9a8549ba316ae2cb65ed60f4f02c7 Ian Eure
2024-08-31gnu: mpd: Add 'bash' input for 'wrap-program'....It is required for cross-compilation. * gnu/packages/mpd.scm (sonata)[native-inputs]: Remove labels. [inputs]: Add 'bash-minimal'. (mcg)[inputs]: Likewise. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Change-Id: I46f0f5f57a6053c7b03f0a3830df3b8bc752f361 Maxime Devos
2024-08-31build-systems: gnu: Export %default-gnu-imported-modules and %default-gnu-mod......Until now users would have to cargo cult or inspect the private %default-modules variable of (guix build-systems gnu) to discover which modules to include when extending the used modules via the #:modules argument. The renaming was automated via the command: $ git grep -l %gnu-build-system-modules | xargs sed 's/%gnu-build-system-modules/%default-gnu-imported-modules/' -i * guix/build-system/gnu.scm (%gnu-build-system-modules): Rename to... (%default-gnu-imported-modules): ... this. (%default-modules): Rename to... (%default-gnu-modules): ... this. Export. (dist-package, gnu-build, gnu-cross-build): Adjust accordingly. Change-Id: Idef307fff13cb76f3182d782b26e1cd3a5c757ee Maxim Cournoyer