X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=dump.c;h=1cdb749f81fc714f09876a9701391cb48416e2bb;hb=2aed65a53e0d5ae8d7abc77f6cbd7cf055b37ceb;hp=e9a068699e005fba3778c5597181c93d0f8a6d4a;hpb=368df5e381894c9fa6bb2b51596a1a58b0d869a8;p=pspp diff --git a/dump.c b/dump.c index e9a068699e..1cdb749f81 100644 --- a/dump.c +++ b/dump.c @@ -579,10 +579,15 @@ dump_category(FILE *stream, int level, int *indexes, int *n_indexes, int max_ind int merge = data[pos]; if (!match_byte(0)) match_byte_assert (1); + match_byte_assert (0); + int unindexed = data[pos]; if (!match_byte(0)) match_byte_assert (1); + + int x = get_u32 (); + pos -= 4; if (!match_u32 (0)) match_u32_assert (2); @@ -604,6 +609,11 @@ dump_category(FILE *stream, int level, int *indexes, int *n_indexes, int max_ind 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"); @@ -684,14 +694,21 @@ static void dump_data(void) { /* The first three numbers add to the number of dimensions. */ - int t = get_u32(); - t += get_u32(); - match_u32_assert(n_dims - t); + int l = get_u32(); + int r = get_u32(); + int c = n_dims - l - r; + match_u32_assert(c); /* The next n_dims numbers are a permutation of the dimension numbers. */ int a[n_dims]; for (int i = 0; i < n_dims; i++) - a[i] = get_u32(); + { + int dim = get_u32(); + a[i] = dim; + + const char *name = i < l ? "layer" : i < l + r ? "row" : "column"; + printf ("<%s dimension=\"%d\"/>\n", name, dim); + } check_permutation(a, n_dims, "dimensions"); int x = get_u32();