X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=dump.c;h=62e9307d7c8a3a70e5b8261212e65c77248019b2;hb=05813c9943ff069b70f7251669292d65d70b544a;hp=8a820d7b86c12ad2ca78b1be232b9993a643cc0a;hpb=d885d459f0b5d66dfbc15b528b73b92e0e0f55a3;p=pspp diff --git a/dump.c b/dump.c index 8a820d7b86..62e9307d7c 100644 --- a/dump.c +++ b/dump.c @@ -650,15 +650,9 @@ dump_category(FILE *stream, int level, int **indexes, int *allocated_indexes, printf ("\n"); dump_value (stream, level + 1); - int merge = data[pos]; - if (!match_byte(0)) - match_byte_assert (1); - + bool merge = get_bool(); match_byte_assert (0); - - int unindexed = data[pos]; - if (!match_byte(0)) - match_byte_assert (1); + int unindexed = get_bool(); int x = get_u32 (); pos -= 4; @@ -675,24 +669,14 @@ dump_category(FILE *stream, int level, int **indexes, int *allocated_indexes, fprintf (stream, " "); fprintf (stream, "\n"); } + assert (unindexed); } else { - if (merge) - { - fprintf(stderr, "index not -1 but merged\n"); - exit(1); - } - if (x != 2) - { - fprintf(stderr, "index not -1 but x != 2\n"); - exit(1); - } - if (n_categories != 0) - { - fprintf(stderr, "index not -1 but subcategories\n"); - exit(1); - } + assert (!merge); + assert (!unindexed); + assert (x == 2); + assert (n_categories == 0); if (*n_indexes >= *allocated_indexes) { *allocated_indexes = *allocated_indexes ? 2 * *allocated_indexes : 16; @@ -701,14 +685,6 @@ dump_category(FILE *stream, int level, int **indexes, int *allocated_indexes, (*indexes)[(*n_indexes)++] = indx; } - int expected_unindexed = indx == -1; - if (unindexed != expected_unindexed) - { - fprintf(stderr, "unindexed (%d) mismatch with indx (%d)\n", - unindexed, indx); - exit(1); - } - if (n_categories == 0) { for (int i = 0; i <= level + 1; i++) @@ -730,20 +706,29 @@ dump_dim(int indx) printf ("\n", indx); dump_value (stdout, 0); - /* This byte is usually 0 but many other values have been spotted. */ + /* This byte is usually 0 but many other values have been spotted. + No visible effect. */ pos++; + /* This byte can cause data to be oddly replicated. */ if (!match_byte(0) && !match_byte(1)) match_byte_assert(2); + if (!match_u32(0)) match_u32_assert(2); - if (!match_byte(0)) - match_byte_assert(1); - if (!match_byte(0)) - match_byte_assert(1); + + bool show_dim_label = get_bool(); + if (show_dim_label) + printf(" \n"); + + bool hide_all_labels = get_bool(); + if (hide_all_labels) + printf(" \n"); + match_byte_assert(1); if (!match_u32(UINT32_MAX)) match_u32_assert(indx); + n_categories = get_u32(); int *indexes = NULL;