From 7f0ffae23166177e2bf9143942da3b5d722ab016 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 1 Aug 2014 19:25:52 +0000 Subject: Clarity with respect to floating point handling: Write double constants as double rather than integer literals. Remove useless explicit (double) cast done at one place and nowhere else. No functional change. --- term.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'term.c') diff --git a/term.c b/term.c index 2eaae01a..3a8fddda 100644 --- a/term.c +++ b/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.224 2014/07/06 18:51:13 schwarze Exp $ */ +/* $Id: term.c,v 1.225 2014/08/01 19:25:52 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -769,25 +769,25 @@ term_vspan(const struct termp *p, const struct roffsu *su) switch (su->unit) { case SCALE_CM: - r = su->scale * 2; + r = su->scale * 2.0; break; case SCALE_IN: - r = su->scale * 6; + r = su->scale * 6.0; break; case SCALE_PC: r = su->scale; break; case SCALE_PT: - r = su->scale / 8; + r = su->scale / 8.0; break; case SCALE_MM: - r = su->scale / 1000; + r = su->scale / 1000.0; break; case SCALE_VS: r = su->scale; break; default: - r = su->scale - 1; + r = su->scale - 1.0; break; } @@ -801,7 +801,7 @@ term_hspan(const struct termp *p, const struct roffsu *su) { double v; - v = ((*p->hspan)(p, su)); + v = (*p->hspan)(p, su); if (v < 0.0) v = 0.0; return((size_t)v); -- cgit v1.2.3