logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0008-Avoid-use-of-long-double-function.patch (1207B)


  1. From 36c4199b3392557bffc375444696bdc6ec36ebae Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 21 Jan 2023 17:30:39 -0800
  4. Subject: [PATCH] Avoid use of long double function
  5. ---
  6. lib/libzutil/zutil_nicenum.c | 4 ++--
  7. 1 file changed, 2 insertions(+), 2 deletions(-)
  8. diff --git a/lib/libzutil/zutil_nicenum.c b/lib/libzutil/zutil_nicenum.c
  9. index 4dcac1f85..5bde425f4 100644
  10. --- a/lib/libzutil/zutil_nicenum.c
  11. +++ b/lib/libzutil/zutil_nicenum.c
  12. @@ -102,7 +102,7 @@ zfs_nicenum_format(uint64_t num, char *buf, size_t buflen,
  13. if ((format == ZFS_NICENUM_TIME) && (num == 0)) {
  14. (void) snprintf(buf, buflen, "-");
  15. } else if ((index == 0) || ((num %
  16. - (uint64_t)powl(k_unit[format], index)) == 0)) {
  17. + (uint64_t)pow(k_unit[format], index)) == 0)) {
  18. /*
  19. * If this is an even multiple of the base, always display
  20. * without any decimal precision.
  21. @@ -122,7 +122,7 @@ zfs_nicenum_format(uint64_t num, char *buf, size_t buflen,
  22. int i;
  23. for (i = 2; i >= 0; i--) {
  24. val = (double)num /
  25. - (uint64_t)powl(k_unit[format], index);
  26. + (uint64_t)pow(k_unit[format], index);
  27. /*
  28. * Don't print floating point values for time. Note,
  29. --
  30. 2.37.3