summaryrefslogtreecommitdiff
path: root/source/html
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2017-05-29 00:10:28 +0800
committerSebastian Rasmussen <sebras@gmail.com>2017-05-31 20:29:30 +0800
commit2d68de96c62c1e6d6a2b615336d99b671fc672b7 (patch)
treec309b8fdf623a0fd56aebc38c863b596e23c379f /source/html
parent73d7b296bd549a7e985ea9df9f13e6ad3701ef89 (diff)
downloadmupdf-2d68de96c62c1e6d6a2b615336d99b671fc672b7.tar.xz
Avoid double literals causing casts to float.
Diffstat (limited to 'source/html')
-rw-r--r--source/html/css-apply.c4
-rw-r--r--source/html/html-layout.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/source/html/css-apply.c b/source/html/css-apply.c
index 58b7772a..de554908 100644
--- a/source/html/css-apply.c
+++ b/source/html/css-apply.c
@@ -980,7 +980,7 @@ fz_from_css_number(fz_css_number number, float em, float percent_value, float au
case N_NUMBER: return number.value;
case N_LENGTH: return number.value;
case N_SCALE: return number.value * em;
- case N_PERCENT: return number.value * 0.01 * percent_value;
+ case N_PERCENT: return number.value * 0.01f * percent_value;
case N_AUTO: return auto_value;
}
}
@@ -993,7 +993,7 @@ fz_from_css_number_scale(fz_css_number number, float scale)
case N_NUMBER: return number.value * scale;
case N_LENGTH: return number.value;
case N_SCALE: return number.value * scale;
- case N_PERCENT: return number.value * 0.01 * scale;
+ case N_PERCENT: return number.value * 0.01f * scale;
case N_AUTO: return scale;
}
}
diff --git a/source/html/html-layout.c b/source/html/html-layout.c
index fcb8eb8e..6c3600ca 100644
--- a/source/html/html-layout.c
+++ b/source/html/html-layout.c
@@ -1044,8 +1044,8 @@ static float measure_line(fz_html_flow *node, fz_html_flow *end, float *baseline
}
else
{
- float a = node->box->em * 0.8;
- float d = node->box->em * 0.2;
+ float a = node->box->em * 0.8f;
+ float d = node->box->em * 0.2f;
if (a > max_a) max_a = a;
if (d > max_d) max_d = d;
}
@@ -1171,11 +1171,11 @@ static void layout_line(fz_context *ctx, float indent, float page_w, float line_
break;
case VA_TOP:
case VA_TEXT_TOP:
- va = -baseline + node->box->em * 0.8;
+ va = -baseline + node->box->em * 0.8f;
break;
case VA_BOTTOM:
case VA_TEXT_BOTTOM:
- va = -baseline + line_h - node->box->em * 0.2;
+ va = -baseline + line_h - node->box->em * 0.2f;
break;
}
@@ -1781,8 +1781,8 @@ static void draw_list_mark(fz_context *ctx, fz_html_box *box, float page_top, fl
else
{
float h = fz_from_css_number_scale(box->style.line_height, box->em);
- float a = box->em * 0.8;
- float d = box->em * 0.2;
+ float a = box->em * 0.8f;
+ float d = box->em * 0.2f;
if (a + d > h)
h = a + d;
y = box->y + a + (h - a - d) / 2;
@@ -1981,8 +1981,8 @@ static fz_link *load_link_flow(fz_context *ctx, fz_html_flow *flow, fz_link *hea
if (flow->type != FLOW_IMAGE)
{
/* flow->y is the baseline, adjust bbox appropriately */
- bbox.y0 -= 0.8 * flow->h;
- bbox.y1 -= 0.8 * flow->h;
+ bbox.y0 -= 0.8f * flow->h;
+ bbox.y1 -= 0.8f * flow->h;
}
if (is_internal_uri(href))