source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Pushed normalisation of scaling units into term_hspan().
@ 2010-06-30 12:30 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-06-30 12:30 UTC (permalink / raw)
  To: source

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

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

only message in thread, other threads:[~2010-06-30 12:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-30 12:30 mdocml: Pushed normalisation of scaling units into term_hspan() kristaps

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).