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; rap-graph.dot?id=892cfdeffb2caf963087420e18c15a77d0662a24'>commitdiff
AgeCommit message (Expand)Author
2024-04-14doc: Use "dejavu sans" instead of "Helvetica" or "sans" in dot images....Font-dejavu is (now) an input of fontconfig. Specifying "dejavu sans" makes generated images reproducible even when other fonts are installed (notably font-google-noto). * doc/images/bootstrap-graph.dot, doc/images/bootstrap-packages.dot, doc/images/coreutils-bag-graph.dot, doc/images/coreutils-graph.dot, doc/images/gcc-core-mesboot0-graph.dot, doc/images/service-graph.dot, doc/images/shepherd-graph.dot: Use fontname = "dejavu sans". * doc/guix.texi (Full-Source Bootstrap): Update gcc-core-mesboot0.dot recipe accordingly. Change-Id: If21d7d39d45c66de5bceafb7b825a057d540ee50 Janneke Nieuwenhuizen