Browse code

hwp3.x: increase accuracy of variable and debug messages

Kevin Lin authored on 2016/01/27 03:03:00
Showing 1 changed files
... ...
@@ -649,7 +649,7 @@ static inline int parsehwp3_paragraph(cli_ctx *ctx, fmap_t *map, int p, int leve
649 649
 {
650 650
     off_t offset = *roffset;
651 651
     uint16_t nchars, nlines, content;
652
-    uint8_t ppfs, ifsc, csb;
652
+    uint8_t ppfs, ifsc, cfsb;
653 653
     int i, c, l, sp = 0, term = 0, ret = CL_SUCCESS;
654 654
 #if HWP3_VERIFY
655 655
     uint16_t match;
... ...
@@ -766,14 +766,14 @@ static inline int parsehwp3_paragraph(cli_ctx *ctx, fmap_t *map, int p, int leve
766 766
     if (ifsc) {
767 767
         for (i = 0, c = 0; i < nchars; i++) {
768 768
             /* examine byte for cs data type */
769
-            if (fmap_readn(map, &csb, offset, sizeof(csb)) != sizeof(csb))
769
+            if (fmap_readn(map, &cfsb, offset, sizeof(cfsb)) != sizeof(cfsb))
770 770
                 return CL_EREAD;
771 771
 
772
-            offset += sizeof(csb);
772
+            offset += sizeof(cfsb);
773 773
 
774
-            switch(csb) {
774
+            switch(cfsb) {
775 775
             case 0: /* character shape block */
776
-                hwp3_debug("HWP3.x: Paragraph[%d, %d]: character shape data @ offset %llu\n", level, p, (long long unsigned)offset);
776
+                hwp3_debug("HWP3.x: Paragraph[%d, %d]: character font style data @ offset %llu\n", level, p, (long long unsigned)offset);
777 777
 
778 778
 #if HWP3_DEBUG
779 779
                 if (fmap_readn(map, &pcsd_size, offset+PCSD_SIZE, sizeof(pcsd_size)) != sizeof(pcsd_size))
... ...
@@ -784,8 +784,8 @@ static inline int parsehwp3_paragraph(cli_ctx *ctx, fmap_t *map, int p, int leve
784 784
 
785 785
                 pcsd_size = le16_to_host(pcsd_size);
786 786
 
787
-                hwp3_debug("HWP3.x: Paragraph[%d, %d]: CS %u: pcsd_size %u\n", level, p, 0, pcsd_size);
788
-                hwp3_debug("HWP3.x: Paragraph[%d, %d]: CS %u: pcsd_prop %x\n", level, p, 0, pcsd_prop);
787
+                hwp3_debug("HWP3.x: Paragraph[%d, %d]: CFS %u: pcsd_size %u\n", level, p, 0, pcsd_size);
788
+                hwp3_debug("HWP3.x: Paragraph[%d, %d]: CFS %u: pcsd_prop %x\n", level, p, 0, pcsd_prop);
789 789
 #endif
790 790
 
791 791
                 c++;
... ...
@@ -794,16 +794,16 @@ static inline int parsehwp3_paragraph(cli_ctx *ctx, fmap_t *map, int p, int leve
794 794
             case 1: /* normal character - as representation of another character for previous cs block */
795 795
                 break;
796 796
             default:
797
-                cli_errmsg("HWP3.x: Paragraph[%d, %d]: unknown CS type 0x%x @ offset %llu\n", level, p, csb,
797
+                cli_errmsg("HWP3.x: Paragraph[%d, %d]: unknown CFS type 0x%x @ offset %llu\n", level, p, cfsb,
798 798
                            (long long unsigned)offset);
799 799
                 cli_errmsg("HWP3.x: Paragraph parsing detected %d of %u characters\n", i, nchars);
800 800
                 return CL_EPARSE;
801 801
             }
802 802
         }
803 803
 
804
-        hwp3_debug("HWP3.x: Paragraph[%d, %d]: detected %d CS block(s) and %d characters\n", level, p, c, i);
804
+        hwp3_debug("HWP3.x: Paragraph[%d, %d]: detected %d CFS block(s) and %d characters\n", level, p, c, i);
805 805
     } else {
806
-        hwp3_debug("HWP3.x: Paragraph[%d, %d]: no separate character shape data detected\n", level, p);
806
+        hwp3_debug("HWP3.x: Paragraph[%d, %d]: separate character font style segment not stored\n", level, p);
807 807
     }
808 808
 
809 809
     if (!term)