From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30449 invoked from network); 11 Sep 2022 09:14:24 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 11 Sep 2022 09:14:24 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id da3f97b2 for ; Sun, 11 Sep 2022 04:14:19 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id d27cf855 for ; Sun, 11 Sep 2022 04:14:18 -0500 (EST) Date: Sun, 11 Sep 2022 04:14:18 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: Finally expand and delete the macro SCALE_VS_INIT(). X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <336b328aacb992ae@mandoc.bsd.lv> Log Message: ----------- Finally expand and delete the macro SCALE_VS_INIT(). It's nothing but obfuscation and only used at three places in a single file. Removing it also makes the code three lines shorter. The ugliness was already pointed out six years ago by mmcc@. Modified Files: -------------- mandoc: out.h mdoc_term.c Revision Data ------------- Index: mdoc_term.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/mdoc_term.c,v retrieving revision 1.381 retrieving revision 1.382 diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.381 -r1.382 --- mdoc_term.c +++ mdoc_term.c @@ -569,8 +569,8 @@ a2width(const struct termp *p, const cha end = a2roffsu(v, &su, SCALE_MAX); if (end == NULL || *end != '\0') { - SCALE_HS_INIT(&su, term_strlen(p, v)); - su.scale /= term_strlen(p, "0"); + su.unit = SCALE_EN; + su.scale = term_strlen(p, v) / term_strlen(p, "0"); } return term_hen(p, &su); } @@ -706,9 +706,9 @@ termp_it_pre(DECL_ARGS) for (i = 0, nn = n->prev; nn->prev && i < (int)ncols; nn = nn->prev, i++) { - SCALE_HS_INIT(&su, - term_strlen(p, bl->norm->Bl.cols[i])); - su.scale /= term_strlen(p, "0"); + su.unit = SCALE_EN; + su.scale = term_strlen(p, bl->norm->Bl.cols[i]) / + term_strlen(p, "0"); offset += term_hen(p, &su) + dcol; } @@ -725,8 +725,9 @@ termp_it_pre(DECL_ARGS) * Use the declared column widths, extended as explained * in the preceding paragraph. */ - SCALE_HS_INIT(&su, term_strlen(p, bl->norm->Bl.cols[i])); - su.scale /= term_strlen(p, "0"); + su.unit = SCALE_EN; + su.scale = term_strlen(p, bl->norm->Bl.cols[i]) / + term_strlen(p, "0"); width = term_hen(p, &su) + dcol; break; default: Index: out.h =================================================================== RCS file: /home/cvs/mandoc/mandoc/out.h,v retrieving revision 1.34 retrieving revision 1.35 diff -Lout.h -Lout.h -u -p -r1.34 -r1.35 --- out.h +++ out.h @@ -57,11 +57,6 @@ struct rofftbl { void *arg; /* passed to sulen, slen, and len */ }; -#define SCALE_HS_INIT(p, v) \ - do { (p)->unit = SCALE_EN; \ - (p)->scale = (v); } \ - while (/* CONSTCOND */ 0) - struct tbl_span; -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv