From 9df81b370fcfd21bb4525ef1999966aad15b77d6 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 2 Nov 2014 17:12:08 -0800 Subject: [PATCH] Add assertions for beginning of file. --- dump.c | 18 ++++++++++++++++-- notes | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dump.c b/dump.c index 9c53933897..4b27480855 100644 --- a/dump.c +++ b/dump.c @@ -1727,7 +1727,21 @@ main(int argc, char *argv[]) } else if (!strcmp(argv[1], "dimensions") || !strcmp(argv[1], "all")) { - pos = 0x27; + pos = 0; + match_byte_assert(1); + match_byte_assert(0); + match_u32_assert(3); + match_byte_assert(1); + if (!match_byte(0)) + match_byte_assert(1); + match_byte_assert(0); + match_byte_assert(0); + if (!match_byte(0)) + match_byte_assert(1); + pos++; + match_byte_assert(0); + match_byte_assert(0); + match_byte_assert(0); dump_title (); dump_fonts(); dump_dims (); @@ -1735,7 +1749,7 @@ main(int argc, char *argv[]) dump_data (); if (pos == n - 1) match_byte_assert (1); - if (pos > n) + if (pos != n) { fprintf (stderr, "%x / %x\n", pos, n); exit(1); diff --git a/notes b/notes index 3699abdbc8..e6288401dd 100644 --- a/notes +++ b/notes @@ -73,6 +73,9 @@ germano has a similar pattern across the three separate output files: Sorting on bytes 33-35 then on 31-32 we get a sorted list of tables: +Byte 33 is always x0, for any digit x, across the corpus. + + blp@sigabrt:~/pspp/spv(0)$ for d in `find -name \*.bin |grep -v chart`; do { hd -s 0x1f -n 6 $d | head -1; printf "%-60s" "$d"; } | sed 'N; s/\n//;' ; echo; done|sort -k 4,4 -k 5,5 -k 2,2|cut -b 1-128 0000001f 01 00 20 73 bf 46 |.. s.F|./smekens/default/00000000011_lightNotesData.bin 0000001f 01 00 20 73 bf 46 |.. s.F|./smekens/modified/00000000011_lightNotesData.bin -- 2.30.2