source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: For release, fix a regression test that failed on i386 in the
@ 2025-04-08 14:05 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2025-04-08 14:05 UTC (permalink / raw)
  To: source

Log Message:
-----------
For release, fix a regression test that failed on i386
in the simplest possible and least intrusive way.
The existing code miscalculated the scaled length 100M as 23u instead 
of the correct result 24u, but only when compiled with -O2 on i386.
The problem was reported by bluhm@.

When showing this patch on tech@, i got some feedback, but no objection
and nothing conclusive as to which solution would be best.

Modified Files:
--------------
    mandoc:
        roff.c

Revision Data
-------------
Index: roff.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff.c,v
diff -Lroff.c -Lroff.c -u -p -r1.404 -r1.405
--- roff.c
+++ roff.c
@@ -2470,7 +2470,8 @@ roff_getnum(const char *v, int *pos, int
 		myres *= 240.0;
 		break;
 	case 'c':
-		myres *= 240.0 / 2.54;
+		myres *= 24000.0;
+		myres /= 254.0;
 		break;
 	case 'v':
 	case 'P':
@@ -2481,12 +2482,14 @@ roff_getnum(const char *v, int *pos, int
 		myres *= 24.0;
 		break;
 	case 'p':
-		myres *= 40.0 / 12.0;
+		myres *= 40.0;
+		myres /= 12.0;
 		break;
 	case 'u':
 		break;
 	case 'M':
-		myres *= 24.0 / 100.0;
+		myres *= 24.0;
+		myres /= 100.0;
 		break;
 	default:
 		break;
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-08 14:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-08 14:05 mandoc: For release, fix a regression test that failed on i386 in the schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).