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; nu/services?id=dec74d456365ae2d57213cbf0d0a9fd726600cbe'>diff
AgeCommit message (Expand)Author
2022-09-29services: certbot: Create "live" directory during activation....When trying to run certbot, the mcron command fails, as /etc/letsencrypt/live is missing. This patch adds it into the certbot activation service. * gnu/services/certbot.scm (certbot-activation): Make /etc/letsencrypt/live. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Mája Tomášek
2022-09-29services: shepherd: Leave the finalization thread in peace....This gets rid of that (in)famous at boot time: error in finalization thread: Success This was caused by the file-descriptor closing loop, which would clause the finalization pipe, leading the finalization thread to (erroneously) error out. Thanks to Josselin Poiret for locating the problem! * gnu/services/shepherd.scm (shepherd-boot-gexp): In 'loop', replace 'close-fdes' with a pair of 'fcntl' calls to add FD_CLOEXEC. Ludovic Courtès
2022-09-28services: Add file system utilities to profile....* gnu/services/base.scm (file-system-type->utilities) (file-system-utilities): New procedures. (file-system-service-type): Extend 'profile-service-type' with 'file-system-utilities'. * gnu/system.scm (boot-file-system-service): New procedure. (operating-system-default-essential-services): Use it. (%base-packages): Remove 'e2fsprogs'. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Brice Waegeneire
2022-09-28services: samba: Remove unused variables and modules....* gnu/services/samba.scm (%smb-conf): Delete unused variable. Maxim Cournoyer