From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o5UCUa3a006889 for ; Wed, 30 Jun 2010 08:30:36 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id o5UCUaIh007099; Wed, 30 Jun 2010 08:30:36 -0400 (EDT) Date: Wed, 30 Jun 2010 08:30:36 -0400 (EDT) Message-Id: <201006301230.o5UCUaIh007099@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Pushed normalisation of scaling units into term_hspan(). X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Pushed normalisation of scaling units into term_hspan(). Modified Files: -------------- mdocml: term.c term.h term_ascii.c term_ps.c Revision Data ------------- Index: term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.c,v retrieving revision 1.155 retrieving revision 1.156 diff -Lterm.c -Lterm.c -u -p -r1.155 -r1.156 --- term.c +++ term.c @@ -692,6 +692,11 @@ term_vspan(const struct termp *p, const size_t term_hspan(const struct termp *p, const struct roffsu *su) { + double v; - return((*p->hspan)(p, su)); + v = ((*p->hspan)(p, su)); + if (v < 0.0) + v = 0.0; + return((size_t) /* LINTED */ + v); } Index: term.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.h,v retrieving revision 1.70 retrieving revision 1.71 diff -Lterm.h -Lterm.h -u -p -r1.70 -r1.71 --- term.h +++ term.h @@ -103,7 +103,7 @@ struct termp { void (*endline)(struct termp *); void (*advance)(struct termp *, size_t); size_t (*width)(const struct termp *, char); - size_t (*hspan)(const struct termp *, + double (*hspan)(const struct termp *, const struct roffsu *); const void *argf; /* arg for headf/footf */ union { Index: term_ascii.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term_ascii.c,v retrieving revision 1.7 retrieving revision 1.8 diff -Lterm_ascii.c -Lterm_ascii.c -u -p -r1.7 -r1.8 --- term_ascii.c +++ term_ascii.c @@ -30,7 +30,7 @@ #include "term.h" #include "main.h" -static size_t ascii_hspan(const struct termp *, +static double ascii_hspan(const struct termp *, const struct roffsu *); static size_t ascii_width(const struct termp *, char); static void ascii_advance(struct termp *, size_t); @@ -146,7 +146,7 @@ ascii_advance(struct termp *p, size_t le /* ARGSUSED */ -static size_t +static double ascii_hspan(const struct termp *p, const struct roffsu *su) { double r; @@ -180,12 +180,6 @@ ascii_hspan(const struct termp *p, const break; } - /* Explicitly disallow negative values. */ - - if (r < 0.0) - r = 0.0; - - return((size_t)/* LINTED */ - r); + return(r); } Index: term_ps.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term_ps.c,v retrieving revision 1.19 retrieving revision 1.20 diff -Lterm_ps.c -Lterm_ps.c -u -p -r1.19 -r1.20 --- term_ps.c +++ term_ps.c @@ -359,7 +359,7 @@ static const struct font fonts[TERMFONT_ } while (/* CONSTCOND */ 0) -static size_t ps_hspan(const struct termp *, +static double ps_hspan(const struct termp *, const struct roffsu *); static size_t ps_width(const struct termp *, char); static void ps_advance(struct termp *, size_t); @@ -828,7 +828,7 @@ ps_width(const struct termp *p, char c) } -static size_t +static double ps_hspan(const struct termp *p, const struct roffsu *su) { double r; @@ -871,12 +871,6 @@ ps_hspan(const struct termp *p, const st break; } - /* Explicitly disallow negative values. */ - - if (r < 0.0) - r = 0.0; - - return((size_t)/* LINTED */ - r); + return(r); } -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv