From 8b541992e2722ceeac33e9f122e8326c79454158 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 7 Oct 2016 16:48:56 +0100 Subject: Use more bitfields in HTML. Saves 12 bytes per fz_html, and we have a lot. --- source/html/html-layout.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/html/html-layout.c') diff --git a/source/html/html-layout.c b/source/html/html-layout.c index a7642981..8f257048 100644 --- a/source/html/html-layout.c +++ b/source/html/html-layout.c @@ -2182,8 +2182,8 @@ static void fragment_cb(const uint32_t *fragment, } } -static void -detect_flow_directionality(fz_context *ctx, fz_pool *pool, uni_buf *buffer, fz_bidi_direction *bidi_dir, fz_html_flow *flow) +static fz_bidi_direction +detect_flow_directionality(fz_context *ctx, fz_pool *pool, uni_buf *buffer, fz_bidi_direction bidi_dir, fz_html_flow *flow) { fz_html_flow *end = flow; bidi_data data; @@ -2249,8 +2249,9 @@ detect_flow_directionality(fz_context *ctx, fz_pool *pool, uni_buf *buffer, fz_b data.pool = pool; data.flow = flow; data.buffer = buffer; - fz_bidi_fragment_text(ctx, buffer->data, buffer->len, bidi_dir, &fragment_cb, &data, 0 /* Flags */); + fz_bidi_fragment_text(ctx, buffer->data, buffer->len, &bidi_dir, &fragment_cb, &data, 0 /* Flags */); } + return bidi_dir; } static void @@ -2259,7 +2260,7 @@ detect_box_directionality(fz_context *ctx, fz_pool *pool, uni_buf *buffer, fz_ht while (box) { if (box->flow_head) - detect_flow_directionality(ctx, pool, buffer, &box->markup_dir, box->flow_head); + box->markup_dir = detect_flow_directionality(ctx, pool, buffer, box->markup_dir, box->flow_head); detect_box_directionality(ctx, pool, buffer, box->down); box = box->next; } -- cgit v1.2.3