From 311b21eb1ee6b34b2a260f30dee014ce7e83548d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 6 Nov 2014 19:15:08 -0800 Subject: [PATCH] Generalize even more special cases in dump_title_value(). --- dump.c | 62 ++++++++++------------------------------------------------ 1 file changed, 10 insertions(+), 52 deletions(-) diff --git a/dump.c b/dump.c index cb80dd9295..052e777848 100644 --- a/dump.c +++ b/dump.c @@ -1012,7 +1012,14 @@ dump_title_value_31(int level) { if (match_byte (0x31)) { - if (match_u32 (1)) + if (match_u32 (0)) + { + match_u32_assert (0); + int subn = get_u32 (); + printf ("nested %d bytes", subn); + pos += subn; + } + else if (match_u32 (1)) { printf("(footnote %d) ", get_u32()); match_byte_assert (0); @@ -1136,20 +1143,7 @@ dump_title_value(int level) unsigned int format; double value; - if (match_byte (0x31)) - { - if (match_u32 (1)) - { - printf("(footnote %d) ", get_u32()); - match_byte_assert (0); - match_byte_assert (0); - int subn = get_u32 (); - printf ("nested %d bytes", subn); - pos += subn; - } - } - else - match_byte_assert (0x58); + dump_title_value_31(level); format = get_u32 (); value = get_double (); printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff); @@ -1161,43 +1155,7 @@ dump_title_value(int level) } else { - if (match_byte (0x31)) - { - if (match_u32 (1)) - { - printf("(footnote %d) ", get_u32()); - match_byte_assert (0); - match_byte_assert (0); - int subn = get_u32 (); - printf ("nested %d bytes", subn); - pos += subn; - } - else if (match_u32 (0)) - { - match_u32_assert (0); - int subn = get_u32 (); - printf ("nested %d bytes", subn); - pos += subn; - } - else - { - match_u32_assert(3); - printf("(special 3)"); - match_byte_assert(0); - match_byte_assert(0); - match_byte_assert(1); - match_byte_assert(0); - int subn = get_u32 (); - printf ("nested %d bytes, ", subn); - pos += subn; - subn = get_u32 (); - printf ("nested %d bytes, ", subn); - pos += subn; - } - - } - else - match_byte_assert (0x58); + dump_title_value_31(level); char *base = get_string(); int x = get_u32(); -- 2.30.2