source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Pushed normalisation of scaling units into term_hspan().
Date: Wed, 30 Jun 2010 08:30:36 -0400 (EDT)	[thread overview]
Message-ID: <201006301230.o5UCUaIh007099@krisdoz.my.domain> (raw)

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

                 reply	other threads:[~2010-06-30 12:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201006301230.o5UCUaIh007099@krisdoz.my.domain \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).