aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--builtin.c10
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ed8fde3b..2864eec3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-06-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (format_tree): In MPFR prints, cast values to
+ int for proper int vs. unsigned comparison. Fixes things
+ for HP-UX. Thanks to Daniel Richard G. for the report.
+
+2021-06-04 Arnold D. Robbins <arnold@skeeve.com>
+
2021-05-21 Arnold D. Robbins <arnold@skeeve.com>
* debug.c: For z/OS, use %#p to print pointers, %p everything else.
diff --git a/builtin.c b/builtin.c
index e28c35ef..454034f4 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1558,19 +1558,19 @@ mpf1:
case MP_INT_WITH_PREC:
sprintf(cp, "*.*Z%c", cs1);
while ((nc = mpfr_snprintf(obufout, ofre, cpbuf,
- (int) fw, (int) prec, zi)) >= ofre)
+ (int) fw, (int) prec, zi)) >= (int) ofre)
chksize(nc)
break;
case MP_INT_WITHOUT_PREC:
sprintf(cp, "*Z%c", cs1);
while ((nc = mpfr_snprintf(obufout, ofre, cpbuf,
- (int) fw, zi)) >= ofre)
+ (int) fw, zi)) >= (int) ofre)
chksize(nc)
break;
case MP_FLOAT:
sprintf(cp, "*.*R*%c", cs1);
while ((nc = mpfr_snprintf(obufout, ofre, cpbuf,
- (int) fw, (int) prec, ROUND_MODE, mf)) >= ofre)
+ (int) fw, (int) prec, ROUND_MODE, mf)) >= (int) ofre)
chksize(nc)
break;
#endif
@@ -1579,7 +1579,7 @@ mpf1:
sprintf(cp, "*.*%c", cs1);
while ((nc = snprintf(obufout, ofre, cpbuf,
(int) fw, (int) prec,
- (double) tmpval)) >= ofre)
+ (double) tmpval)) >= (int) ofre)
chksize(nc)
} else {
// For %a and %A, use the default precision if it
@@ -1587,7 +1587,7 @@ mpf1:
sprintf(cp, "*%c", cs1);
while ((nc = snprintf(obufout, ofre, cpbuf,
(int) fw,
- (double) tmpval)) >= ofre)
+ (double) tmpval)) >= (int) ofre)
chksize(nc)
}
}