aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-08-01 19:25:52 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-08-01 19:25:52 +0000
commit7f0ffae23166177e2bf9143942da3b5d722ab016 (patch)
treee58565ff4c3122d57c3feda421dd653b3cd486f6 /term.c
parentf0a1f96fe7ebbe75d5432cd491f6ea60095c5304 (diff)
downloadmandoc-7f0ffae23166177e2bf9143942da3b5d722ab016.tar.gz
mandoc-7f0ffae23166177e2bf9143942da3b5d722ab016.tar.zst
mandoc-7f0ffae23166177e2bf9143942da3b5d722ab016.zip
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.
Diffstat (limited to 'term.c')
-rw-r--r--term.c14
1 files changed, 7 insertions, 7 deletions
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 <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);