From: Ben Pfaff Date: Fri, 7 Nov 2014 06:51:24 +0000 (-0800) Subject: Finally make dump_value__() recursive case slightly more sane. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af94cf7c3e3105b1cc90fa34f9566aa3fd27e1ff;p=pspp Finally make dump_value__() recursive case slightly more sane. --- diff --git a/dump.c b/dump.c index 44a1158af4..fceaabb24a 100644 --- a/dump.c +++ b/dump.c @@ -204,7 +204,7 @@ dump_value_31(void) match_byte_assert (0x58); } -static void dump_value(int level); +static void dump_value(int level, bool match1); static void dump_value__(int level, bool match1) @@ -286,7 +286,7 @@ dump_value__(int level, bool match1) { for (int i = 0; i < x; i++) { - dump_value (level+1); + dump_value (level+1, match1); putchar('\n'); } } @@ -301,24 +301,7 @@ dump_value__(int level, bool match1) printf("variable %d has %d values:\n", i, y); for (int j = 0; j < y; j++) { - match_byte(0); - if (match_byte(3)) - { - char *a = get_string(); - match_byte_assert(0x58); - char *b = get_string(); - char *c = get_string(); - for (int k = 0; k <= level + 1; k++) - printf (" "); - printf ("\"%s\", \"%s\", \"%s\"", a, b, c); - } - else - dump_value (level+1); - - match_byte(0); - match_byte(0); - match_byte(0); - match_byte(0); + dump_value (level+1, false); putchar('\n'); } } @@ -327,7 +310,7 @@ dump_value__(int level, bool match1) } static void -dump_value(int level) +dump_value(int level, bool match1) { for (int i = 0; i <= level; i++) printf (" "); @@ -336,7 +319,7 @@ dump_value(int level) match_byte (0); match_byte (0); match_byte (0); - dump_value__(level, true); + dump_value__(level, match1); match_byte(0); match_byte(0); match_byte(0); @@ -351,13 +334,13 @@ dump_dim_value(int level) if (data[pos] == 3 || data[pos] == 5) dump_value__(level, true); else - dump_value(level); + dump_value(level, true); } static void dump_category(int level) { - dump_value (level); + dump_value (level, true); if (match_u32 (1)) match_byte (0); @@ -464,7 +447,7 @@ dump_data_value(int level) if (data[pos] == 1 || data[pos] == 2 || data[pos] == 3 || data[pos] == 4) dump_value__(0, false); else if (data[pos] == 5) - dump_value (0); + dump_value (0, true); else dump_substs (dump_data_value, level + 1); } @@ -508,7 +491,7 @@ dump_title_value(int level) match_byte (0); match_byte (0); if (data[pos] == 1 || data[pos] == 2 || data[pos] == 3 || data[pos] == 4) - dump_value(level); + dump_value(level, true); else if (data[pos] == 5) dump_value__(level, true); else @@ -526,7 +509,7 @@ dump_footnote_value(int level) match_byte (0); match_byte (0); if (data[pos] == 2 || data[pos] == 4) - dump_value(level); + dump_value(level, true); else if (data[pos] == 1 || data[pos] == 3 || data[pos] == 5) dump_value__(level, false); else