OSDN Git Service

update_terminal().
authormaqiyuan <maqiyuan@users.sourceforge.jp>
Mon, 16 Jun 2014 12:08:37 +0000 (20:08 +0800)
committermaqiyuan <maqiyuan@users.sourceforge.jp>
Mon, 16 Jun 2014 12:08:37 +0000 (20:08 +0800)
check_full_save_stack().
vet_glue().
replaced lables.

17 files changed:
src/texsourc/coerce.h
src/texsourc/itex.c
src/texsourc/local.c
src/texsourc/tex0.c
src/texsourc/tex1.c
src/texsourc/tex2.c
src/texsourc/tex3.c
src/texsourc/tex4.c
src/texsourc/tex5.c
src/texsourc/tex6.c
src/texsourc/tex7.c
src/texsourc/tex8.c
src/texsourc/tex9.c
src/texsourc/texd.h
src/texsourc/texmf.h
src/texsourc/yandy_inlines.c
src/texsourc/yandy_macros.h

index 6c90e45..1194c61 100644 (file)
@@ -22,8 +22,8 @@ void print_char_(ASCII_code);
 #define print_char(s) print_char_((ASCII_code) (s))
 void print_(integer);
 #define print(s) print_((integer) (s))
-void print_string_(unsigned char * s);
-#define print_string(s) print_string_((unsigned char *) s)
+void print_string_(const char * s);
+#define print_string(s) print_string_((const char *) s)
 void slow_print_(integer);
 #define slow_print(s) slow_print_((integer) (s))
 void print_nl(const char *);
index d42c0ad..61e2eee 100644 (file)
@@ -529,7 +529,7 @@ void line_break_ (integer final_widow_penalty)
                   }
                   else if (type(s) == ligature_node)
                     if (lig_ptr(s) == 0)
-                      goto lab22;
+                      goto continu;
                     else
                     {
                       q = lig_ptr(s);
@@ -537,7 +537,7 @@ void line_break_ (integer final_widow_penalty)
                       hf = font(q);
                     }
                   else if ((type(s) == kern_node) && (subtype(s) == normal))
-                    goto lab22;
+                    goto continu;
                   else if (type(s) == whatsit_node)
                   {
                     if (subtype(s) == language_node)
@@ -546,33 +546,33 @@ void line_break_ (integer final_widow_penalty)
                       lhyf = what_lhm(s);
                       rhyf = what_rhm(s);
                     }
-                    goto lab22;
+                    goto continu;
                   }
                   else
-                    goto lab31;
+                    goto done1;
 
                   if (lc_code(c) != 0)
                     if ((lc_code(c) == (halfword) c) || (uc_hyph > 0)) /* fixed signed tyoe */
-                      goto lab32;
+                      goto done2;
                     else
-                      goto lab31;
-lab22:
+                      goto done1;
+continu:
                   prevs = s;
                   s = link(prevs);
                 }
-lab32:
+done2:
                 hyf_char = hyphen_char[hf];
 
                 if (hyf_char < 0)
-                  goto lab31; 
+                  goto done1; 
 
                 if (hyf_char > 255)
-                  goto lab31; /* ? */
+                  goto done1; /* ? */
 
                 ha = prevs;
 
                 if (lhyf + rhyf > 63)
-                  goto lab31;
+                  goto done1;
 
                 hn = 0;
 
@@ -581,17 +581,17 @@ lab32:
                   if (is_char_node(s))
                   {
                     if (font(s) != hf)
-                      goto lab33;
+                      goto done3;
 
                     hyfbchar = character(s);
 
                     c = hyfbchar;     /*  unsigned char c;  */
 
                     if (lc_code(c) == 0)
-                      goto lab33;
+                      goto done3;
 
                     if (hn == 63)
-                      goto lab33;
+                      goto done3;
 
                     hb = s;
                     incr(hn);
@@ -602,7 +602,7 @@ lab32:
                   else if (type(s) == ligature_node)
                   {
                     if (font(lig_char(s)) != hf)
-                      goto lab33;
+                      goto done3;
 
                     j = hn;
                     q = lig_ptr(s);
@@ -615,10 +615,10 @@ lab32:
                       c = character(q);
 
                       if (lc_code(c) == 0)
-                        goto lab33;
+                        goto done3;
 
                       if (j == 63)
-                        goto lab33;
+                        goto done3;
 
                       incr(j);
                       hu[j] = c;
@@ -640,13 +640,13 @@ lab32:
                     hyfbchar = font_bchar[hf];
                   }
                   else
-                    goto lab33;
+                    goto done3;
 
                   s = link(s);
                 }
-lab33:;
+done3:;
                 if (hn < lhyf + rhyf)
-                  goto lab31;
+                  goto done1;
 
                 while (true)
                 {
@@ -657,7 +657,7 @@ lab33:;
                         break;
                       case kern_node:
                         if (subtype(s) != normal)
-                          goto lab34;
+                          goto done4;
                         break;
                       case whatsit_node:
                       case glue_node:
@@ -665,18 +665,18 @@ lab33:;
                       case ins_node:
                       case adjust_node:
                       case mark_node:
-                        goto lab34;
+                        goto done4;
                         break;
                       default:
-                        goto lab31;
+                        goto done1;
                         break;
                     }
                   s = link(s);
                 }
-lab34:;
+done4:;
                 hyphenate();
               }
-lab31:;
+done1:;
             }
           }
           break;
@@ -777,7 +777,7 @@ lab31:;
 
             prev_p = cur_p;
             cur_p = s;
-            goto lab35;
+            goto done5;
           }
           break;
 
@@ -807,7 +807,7 @@ lab31:;
 
       prev_p = cur_p;
       cur_p = link(cur_p);
-lab35:;
+done5:;
     }
 
     if (cur_p == 0)
@@ -836,7 +836,7 @@ lab35:;
 
         if (looseness == 0)
         {
-          goto lab30;           /* normal exit */
+          goto done;           /* normal exit */
         }
 
         {
@@ -872,7 +872,7 @@ lab35:;
 
         if ((actual_looseness == looseness) || final_pass)
         {
-          goto lab30;
+          goto done;
         }
       }
     }
@@ -924,7 +924,7 @@ lab35:;
     }
   }
 
-lab30:
+done:
   if (best_line == 2)
     single_line++;
 
@@ -1197,7 +1197,7 @@ void prefixed_command (void)
               add_token_ref(q);
               define(p, call, q);
             }
-            goto lab30;
+            goto done;
           }
         }
 
@@ -1402,7 +1402,7 @@ void prefixed_command (void)
         if (is_initex)
         {
           new_patterns();
-          goto lab30;
+          goto done;
         }
 #endif
         print_err("Patterns can be loaded only by INITEX");
@@ -1420,7 +1420,7 @@ void prefixed_command (void)
       else
       {
         new_hyph_exceptions();
-        goto lab30;
+        goto done;
       }
       break;
 
@@ -1465,7 +1465,7 @@ void prefixed_command (void)
       break;
   }
 
-lab30:
+done:
   if (after_token != 0)
   {
     cur_tok = after_token;
@@ -1483,12 +1483,12 @@ boolean load_fmt_file (void)
   undump_int(x);
 
   if (x != BEGINFMTCHECKSUM)
-    goto lab_bad_fmt;
+    goto bad_fmt;
 
   undump_int(x); /* mem_bot */
 
   if (x != mem_bot)
-    goto lab_bad_fmt;
+    goto bad_fmt;
 
   undump_int(x); /* mem_top */
 
@@ -1506,17 +1506,17 @@ boolean load_fmt_file (void)
 #endif
 
   if (x != mem_top)
-    goto lab_bad_fmt;
+    goto bad_fmt;
 
   undump_int(x); /* eqtb_size */
 
   if (x != eqtb_size)
-    goto lab_bad_fmt;
+    goto bad_fmt;
 
   undump_int(x); /* hash_prime */
 
   if (x != hash_prime)
-    goto lab_bad_fmt;
+    goto bad_fmt;
 
   undump_int(x); /* hyphen_prime */
 
@@ -1527,13 +1527,13 @@ boolean load_fmt_file (void)
 #endif
 
   if (x != hyphen_prime)
-    goto lab_bad_fmt;
+    goto bad_fmt;
 
   {
     undump_int(x); /* pool_size */
 
     if (x < 0)
-      goto lab_bad_fmt; 
+      goto bad_fmt; 
 
 #ifdef ALLOCATESTRING
     if (x > current_pool_size)
@@ -1550,7 +1550,7 @@ boolean load_fmt_file (void)
 #endif
     {
       printf("%s%s\n",  "---! Must increase the ", "string pool size");
-      goto lab_bad_fmt;
+      goto bad_fmt;
     }
     else
       pool_ptr = x;
@@ -1560,7 +1560,7 @@ boolean load_fmt_file (void)
     undump_int(x);  /* max_strings */
 
     if (x < 0)
-      goto lab_bad_fmt;
+      goto bad_fmt;
 
 #ifdef ALLOCATESTRING
     if (x > current_max_strings)
@@ -1577,7 +1577,7 @@ boolean load_fmt_file (void)
 #endif
     {
       printf("%s%s\n",  "---! Must increase the ", "max strings");
-      goto lab_bad_fmt;
+      goto bad_fmt;
     }
     else
       str_ptr = x;
@@ -1604,7 +1604,7 @@ boolean load_fmt_file (void)
       p = q + node_size(q);
 
       if ((p > lo_mem_max) || ((q >= rlink(q)) && (rlink(q) != rover)))
-        goto lab_bad_fmt;
+        goto bad_fmt;
 
       q = rlink(q);
     }
@@ -1617,7 +1617,7 @@ boolean load_fmt_file (void)
   {
 /*  or call add_variable_space(mem_bot - (mem_min + 1)) */
     if (trace_flag)
-      puts("Splicing in mem_min space in undump!\n");
+      puts("Splicing in mem_min space in undump!");
 
     p = llink(rover);
     q = mem_min + 1;
@@ -1648,7 +1648,7 @@ boolean load_fmt_file (void)
       undump_int(x);
 
       if ((x < 1) || (k + x > (eqtb_size + 1)))
-        goto lab_bad_fmt;
+        goto bad_fmt;
 
       if (undumpthings(eqtb[k], x))
         return -1;
@@ -1657,7 +1657,7 @@ boolean load_fmt_file (void)
       undump_int(x);
 
       if ((x < 0) || (k + x > (eqtb_size + 1)))
-        goto lab_bad_fmt;
+        goto bad_fmt;
 
       for (j = k; j <= k + x - 1; j++)
         eqtb[j] = eqtb[k - 1];
@@ -1692,7 +1692,7 @@ boolean load_fmt_file (void)
     undump_int(x); /* font_mem_size */
 
     if (x < 7)
-      goto lab_bad_fmt;
+      goto bad_fmt;
 
 #ifdef ALLOCATEFONT
     if (trace_flag)
@@ -1711,8 +1711,8 @@ boolean load_fmt_file (void)
     if (x > font_mem_size)
 #endif
     {
-      puts("---! Must increase the font mem size\n");
-      goto lab_bad_fmt;
+      puts("---! Must increase the font mem size");
+      goto bad_fmt;
     }
     else
       fmem_ptr = x;
@@ -1726,12 +1726,12 @@ boolean load_fmt_file (void)
       undump_int(x); /* font_max */
 
       if (x < 0)
-        goto lab_bad_fmt;
+        goto bad_fmt;
 
       if (x > font_max)
       {
-        puts("---! Must increase the font max\n"); 
-        goto lab_bad_fmt;
+        puts("---! Must increase the font max"); 
+        goto bad_fmt;
       }
       else
         font_ptr = x;
@@ -1867,7 +1867,7 @@ boolean load_fmt_file (void)
     undump_int(x);
 
     if (x < 0)
-      goto lab_bad_fmt;
+      goto bad_fmt;
 
 #ifdef ALLOCATETRIES
     if (!is_initex)
@@ -1880,7 +1880,7 @@ boolean load_fmt_file (void)
     if (x > trie_size)
     {
       puts("---! Must increase the trie size\n");
-      goto lab_bad_fmt;
+      goto bad_fmt;
     }
     else
       j = x;
@@ -1904,12 +1904,12 @@ boolean load_fmt_file (void)
     undump_int(x);
 
     if (x < 0)
-      goto lab_bad_fmt;
+      goto bad_fmt;
 
     if (x > trie_op_size)
     {
       puts("---! Must increase the trie op size\n");
-      goto lab_bad_fmt;
+      goto bad_fmt;
     }
     else
       j = x;
@@ -1963,11 +1963,11 @@ boolean load_fmt_file (void)
   undump_int(x);
   
   if ((x != ENDFMTCHECKSUM) || feof(fmt_file))
-    goto lab_bad_fmt;
+    goto bad_fmt;
 
   return true;
 
-lab_bad_fmt:;
+bad_fmt:;
   puts("(Fatal format file error; I'm stymied)\n");
 
   return false;
@@ -2215,11 +2215,7 @@ lab1:
     slow_print(format_ident);
 
   print_ln();
-
-#ifndef _WINDOWS
-  fflush(stdout);
-#endif
-
+  update_terminal();
   job_name = 0;
   name_in_progress = false;
   log_opened = false;
@@ -2880,23 +2876,23 @@ void first_fit_ (trie_pointer p)
     }
 
     if (trie_taken[h])
-      goto lab45;
+      goto not_found;
 
     q = trie_r[p];
 
     while (q > 0)
     {
       if (trie_trl[h + trie_c[q]] == 0)
-        goto lab45;
+        goto not_found;
 
       q = trie_r[q];
     }
 
-    goto lab40;
-lab45:
+    goto found;
+not_found:
     z = trie_trl[z];
   }
-lab40:
+found:
   trie_taken[h] = true; /* h may be used without ... */
   trie_hash[p] = h;
   q = p;
@@ -3072,9 +3068,9 @@ void new_patterns (void)
                 if (l > 0)
                   decr(l);
                 else
-                  goto lab31;
+                  goto done1;
               }
-lab31:
+done1:
               q = 0;
               hc[0] = cur_lang;
 
@@ -3126,7 +3122,7 @@ lab31:
             }
 
             if (cur_cmd == right_brace)
-              goto lab30;
+              goto done;
 
             k = 0;
             hyf[0] = 0;
@@ -3143,7 +3139,7 @@ lab31:
           break;
       }
     }
-lab30:;
+done:;
   }
   else
   {
@@ -3393,13 +3389,13 @@ void store_fmt_file (void)
         if ((equiv(j) == equiv(j + 1)) &&
           (eq_type(j) == eq_type(j + 1)) &&
           (eq_level(j) == eq_level(j + 1)))
-          goto lab41;
+          goto found1;
         incr(j);
       }
 
       l = (int_base);
-      goto lab31;
-lab41:
+      goto done1;
+found1:
       incr(j);
       l = j;
       while (j < (int_base - 1))
@@ -3407,10 +3403,10 @@ lab41:
         if ((equiv(j) != equiv(j + 1)) ||
           (eq_type(j) != eq_type(j + 1)) ||
           (eq_level(j) != eq_level(j + 1)))
-          goto lab31;
+          goto done1;
         incr(j);
       }
-lab31:
+done1:
       dump_int(l - k);
 
       if (dumpthings(eqtb[k], l - k))
@@ -3428,23 +3424,23 @@ lab31:
       while (j < (eqtb_size))
       {
         if (eqtb[j].cint == eqtb[j + 1].cint)
-          goto lab42;
+          goto found2;
         incr(j);
       }
 
       l = (eqtb_size + 1);
-      goto lab32;
-lab42:
+      goto done2;
+found2:
       incr(j);
       l = j;
 
       while (j < (eqtb_size))
       {
         if (eqtb[j].cint != eqtb[j + 1].cint)
-          goto lab32;
+          goto done2;
         incr(j);
       }
-lab32:
+done2:
       dump_int(l - k);
 
       if (dumpthings(eqtb[k], l - k))
index f9d9ca3..b1e2cbd 100644 (file)
@@ -1834,13 +1834,14 @@ int free_memory (void)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Main Memory: variable node %d (%d - %d) one word %d (%d - %d)\n",
-      lo_mem_max - mem_min, mem_min, lo_mem_max, mem_end  - hi_mem_min, hi_mem_min, mem_end);
-    show_line(log_line, 0);
+    printf("Main Memory: variable node %d (%d - %d);\n"
+      "             one word %d (%d - %d)\n",
+      lo_mem_max - mem_min, mem_min, lo_mem_max,
+      mem_end - hi_mem_min, hi_mem_min, mem_end);
   }
 
   if (trace_flag)
-    puts("Freeing memory again\n");
+    puts("Freeing memory again");
 
 /*  only free memory if safe ... additional check */
 #ifdef ALLOCATEINI
index 2cbaf94..2e17801 100644 (file)
@@ -115,16 +115,10 @@ void print_char_ (ASCII_code s)
         str_pool = realloc_str_pool (increment_pool_size);
       
       if (pool_ptr < current_pool_size)
-      {
-        str_pool[pool_ptr] = s;
-        incr(pool_ptr);
-      }
+        append_char(s);
 #else
       if (pool_ptr < pool_size)
-      {
-        str_pool[pool_ptr] = s;
-        incr(pool_ptr);
-      }
+        append_char(s);
 #endif
       break;
 
@@ -218,7 +212,7 @@ void print_ (integer s)
   }
 }
 /* string version print. */
-void print_string_ (unsigned char *s)
+void print_string_ (const char *s)
 {
   while (*s > 0)
     print_char(*s++);
@@ -229,9 +223,7 @@ void slow_print_ (integer s)
   pool_pointer j;
 
   if ((s >= str_ptr) || (s < 256))
-  {
     print(s);
-  }
   else
   {
     j = str_start[s];
@@ -443,7 +435,7 @@ void error (void)
   if (interaction == error_stop_mode)
     while (true)
     {
-lab22:
+continu:
       clear_for_error_prompt();
       prompt_input("? ");
 
@@ -495,7 +487,7 @@ lab22:
             help2("I have just deleted some text, as you asked.",
                 "You can now delete more, or insert, or whatever.");
             show_context();
-            goto lab22;     /* loop again */
+            goto continu;
           }
           break;
 
@@ -503,7 +495,7 @@ lab22:
         case 'D':
           {
             debug_help();
-            goto lab22;       /* loop again */
+            goto continu;
           }
           break;
 #endif
@@ -543,7 +535,7 @@ lab22:
                 "Maybe you should try asking a human?",
                 "An error might have occurred before I noticed any problems.",
                 "``If all else fails, read the instructions.''");
-            goto lab22; /* loop again */
+            goto continu;
           }
           break;
 
@@ -595,9 +587,7 @@ lab22:
 
             print_string("...");
             print_ln();
-#ifndef _WINDOWS
-            fflush(stdout);
-#endif
+            update_terminal();
             return;
           }
           break;
@@ -737,7 +727,7 @@ boolean init_terminal (void)
   while (true)
   {
     fputs("**", stdout);
-    fflush(stdout);
+    update_terminal();
     flag = input_ln(stdin, true);
 
     if (!flag)
@@ -797,7 +787,7 @@ boolean str_eq_buf_ (str_number s, integer k)
     if (str_pool[j] != buffer[k])
     {
       result = false;
-      goto lab45;
+      goto not_found;
     }
 
     incr(j);
@@ -806,7 +796,7 @@ boolean str_eq_buf_ (str_number s, integer k)
 
   result = true;
 
-lab45:
+not_found:
   return result;
 }
 /* sec 0045 */
@@ -818,7 +808,7 @@ boolean str_eq_str_ (str_number s, str_number t)
   result = false;
 
   if (length(s) != length(t))
-    goto lab45;
+    goto not_found;
 
   j = str_start[s];
   k = str_start[t];
@@ -826,7 +816,7 @@ boolean str_eq_str_ (str_number s, str_number t)
   while (j < str_start[s + 1])
   {
     if (str_pool[j] != str_pool[k])
-      goto lab45;
+      goto not_found;
 
     incr(j);
     incr(k);
@@ -834,7 +824,7 @@ boolean str_eq_str_ (str_number s, str_number t)
 
   result = true;
 
-lab45:
+not_found:
   return result;
 }
 /* sec 0066 */
@@ -926,7 +916,7 @@ void term_input(void)
   if (!knuth_flag)
     show_line("\n", 0);
 
-  fflush(stdout);
+  update_terminal();
   flag = input_ln(stdin, true);
 
   if (!flag)
@@ -1423,7 +1413,7 @@ pointer get_node_(integer s)
   pointer q;
   integer r;
   integer t;
-lab20:
+restart:
 
   p = rover;
 
@@ -1449,7 +1439,7 @@ lab20:
       {
         node_size(p) = r - p;
         rover = p;
-        goto lab40;
+        goto found;
       }
 
       if (r == p)
@@ -1459,7 +1449,7 @@ lab20:
           t = llink(p);
           llink(rover) = t;
           rlink(t) = rover;
-          goto lab40;
+          goto found;
         }
 
       node_size(p) = q - p;
@@ -1502,7 +1492,7 @@ lab20:
       link(lo_mem_max) = 0;
       info(lo_mem_max) = 0;
       rover = q;
-      goto lab20;
+      goto restart;
     }
 
 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
@@ -1531,9 +1521,9 @@ lab20:
   }
 
   add_variable_space (block_size); /* now to be found in itex.c */
-  goto lab20;         /* go try get_node again */
+  goto restart;         /* go try get_node again */
 
-lab40:
+found:
   link(r) = 0;
 
 #ifdef STAT
@@ -1745,13 +1735,13 @@ void check_mem(boolean printlocs)
     {
       print_nl("AVAIL list clobbered at ");
       print_int(q);
-      goto lab31;
+      goto done1;
     }
     freearr[p] = true;
     q = p;
     p = link(q);
   }
-lab31:;
+done1:;
   p = rover;
   q = 0;
   clobbered = false;
@@ -1768,7 +1758,7 @@ lab31:;
       {
         print_nl("Double-AVAIL list clobbered at ");
         print_int(q);
-        goto lab32;
+        goto done2;
       }
 
       for (q = p; q <= p + node_size(p) - 1; q++)
@@ -1777,14 +1767,14 @@ lab31:;
         {
           print_nl("Doubly free location at ");
           print_int(q);
-          goto lab32;
+          goto done2;
         }
         freearr[q]= true;
       }
       q = p;
       p = rlink(p);
   } while (!(p == rover));
-lab32:;
+done2:;
   p = mem_min;
   while (p <= lo_mem_max) {
     if (is_empty(p))
index eb618ba..f06baa3 100644 (file)
@@ -79,13 +79,13 @@ void flush_node_list_(pointer p)
           {
             flush_node_list(list_ptr(p));
             free_node(p, box_node_size);
-            goto lab30;
+            goto done;
           }
           break;
         case rule_node:
           {
             free_node(p, rule_node_size);
-            goto lab30;
+            goto done;
           }
           break;
         case ins_node:
@@ -93,7 +93,7 @@ void flush_node_list_(pointer p)
             flush_node_list(ins_ptr(p));
             delete_glue_ref(split_top_ptr(p));
             free_node(p, ins_node_size);
-            goto lab30;
+            goto done;
           }
           break;
         case whatsit_node:
@@ -108,7 +108,7 @@ void flush_node_list_(pointer p)
                 {
                   delete_token_ref(write_tokens(p));
                   free_node(p, write_node_size);
-                  goto lab30;
+                  goto done;
                 }
                 break;
               case close_node:
@@ -122,7 +122,7 @@ void flush_node_list_(pointer p)
                 }
                 break;
             }
-            goto lab30;
+            goto done;
           }
           break;
         case glue_node:
@@ -156,7 +156,7 @@ void flush_node_list_(pointer p)
         case style_node:
           {
             free_node(p, style_node_size);
-            goto lab30;
+            goto done;
           }
           break;
         case choice_node:
@@ -166,7 +166,7 @@ void flush_node_list_(pointer p)
             flush_node_list(script_mlist(p));
             flush_node_list(script_script_mlist(p));
             free_node(p, style_node_size);
-            goto lab30;
+            goto done;
           }
           break;
         case ord_noad:
@@ -201,14 +201,14 @@ void flush_node_list_(pointer p)
               else
                 free_node(p, noad_size);
             }
-            goto lab30;
+            goto done;
           }
           break;
         case left_noad:
         case right_noad:
           {
             free_node(p, noad_size);
-            goto lab30;
+            goto done;
           }
           break;
         case fraction_noad:
@@ -216,7 +216,7 @@ void flush_node_list_(pointer p)
             flush_node_list(info(numerator(p)));
             flush_node_list(info(denominator(p)));
             free_node(p, fraction_noad_size);
-            goto lab30;
+            goto done;
           }
           break;
         default:
@@ -228,7 +228,7 @@ void flush_node_list_(pointer p)
       }
 
       free_node(p, small_node_size);
-lab30:;
+done:;
     }
 
     p = q;
@@ -2245,14 +2245,12 @@ halfword id_lookup_(integer j, integer l)
     if (text(p) > 0)
       if (length(text(p)) == l)
         if (str_eq_buf(text(p), j))
-          goto lab40;
+          goto found;
 
     if (next(p) == 0)
     {
       if (no_new_control_sequence)
-      {
         p = undefined_control_sequence;
-      }
       else
       {
         if (text(p) > 0)
@@ -2261,7 +2259,8 @@ halfword id_lookup_(integer j, integer l)
             {
               if (hash_is_full)
               {
-                overflow("hash size", hash_size + hash_extra); /* 96/Jan/10 */
+                overflow("hash size", hash_size + hash_extra);
+                /* not dynamic        ^~~~~~~~~~~~~~~~~~~~~~*/
                 return 0;
               }
 
@@ -2299,46 +2298,26 @@ halfword id_lookup_(integer j, integer l)
 #endif
       }
 
-      goto lab40
+      goto found
     }
+
     p = next(p);
   } 
 
-lab40:
+found:
   return p;
 }
 /* sec 0274 */
 void new_save_level_(group_code c)
-{ 
-   if (save_ptr > max_save_stack)
-   {
-     max_save_stack = save_ptr;
-
-#ifdef ALLOCATESAVESTACK
-     if (max_save_stack > current_save_size - 6)
-       save_stack = realloc_save_stack(increment_save_size);
-
-     if (max_save_stack > current_save_size - 6) /* check again after allocation */
-     {
-       overflow("save size", current_save_size);
-       return;
-     }
-#else
-     if (max_save_stack > save_size - 6) /* save size - not dynamic */
-     {
-       overflow("save size", save_size);
-       return;
-     }
-#endif
-  }
-
+{
+  check_full_save_stack();
   save_type(save_ptr) = level_boundary;
   save_level(save_ptr) = (quarterword) cur_group; 
   save_index(save_ptr) = cur_boundary;
 
   if (cur_level == max_quarterword)
   {
-    overflow("grouping levels", max_quarterword - min_quarterword); /* 96/Oct/12 ??? */
+    overflow("grouping levels", max_quarterword - min_quarterword);
     return;
   }
 
@@ -2383,27 +2362,7 @@ void eq_destroy_(memory_word w)
 /* sec 0276 */
 void eq_save_(halfword p, quarterword l)
 {
-  if (save_ptr > max_save_stack)
-  {
-    max_save_stack = save_ptr;
-
-#ifdef ALLOCATESAVESTACK
-    if (max_save_stack > current_save_size - 6)
-      save_stack = realloc_save_stack (increment_save_size);
-
-    if (max_save_stack > current_save_size - 6) /* check again after allocation */
-    {
-      overflow("save size", current_save_size);
-      return;
-    }
-#else
-    if (max_save_stack > save_size - 6) /* save size not dynamic */
-    {
-      overflow("save size", save_size);
-      return;
-    }
-#endif
-  }
+  check_full_save_stack();
 
   if (l == level_zero)
     save_type(save_ptr) = restore_zero;
@@ -2460,28 +2419,7 @@ void save_for_after_(halfword t)
 { 
   if (cur_level > 1)
   {
-    if (save_ptr > max_save_stack)
-    {
-      max_save_stack = save_ptr;
-
-#ifdef ALLOCATESAVESTACK
-      if (max_save_stack > current_save_size - 6)
-        save_stack = realloc_save_stack (increment_save_size);
-
-      if (max_save_stack > current_save_size - 6) /* check again after allocation */
-      {
-        overflow("save size", current_save_size);
-        return;
-      }
-#else
-      if (max_save_stack > save_size - 6) /* save satck - not dynamic */
-      {
-        overflow("save size", save_size);
-        return;
-      }
-#endif
-    }
-
+    check_full_save_stack();
     save_type(save_ptr) = insert_token;
     save_level(save_ptr) = level_zero;
     save_index(save_ptr) = t;
index da3c071..4868490 100644 (file)
@@ -49,7 +49,7 @@ void unsave (void)
       decr(save_ptr);
 
       if (save_type(save_ptr) == level_boundary)
-        goto lab30;
+        goto done;
 
       p = save_index(save_ptr);
 
@@ -106,7 +106,7 @@ void unsave (void)
         }
       }
     }
-lab30:
+done:
     cur_group = save_level(save_ptr);
     cur_boundary = save_index(save_ptr);
   }
@@ -407,12 +407,12 @@ void show_context (void)
     }
 
     if (bottom_line)
-      goto lab30;
+      goto done;
 
     decr(base_ptr);
   }
 
-lab30:
+done:
   cur_input = input_stack[input_ptr];
 }
 /* sec 0323 */
@@ -790,7 +790,7 @@ void macro_call (void)
           p = temp_head;
           m = 0;
         }
-lab22:
+continu:
         get_token();
 
         if (cur_tok == info(r))
@@ -802,10 +802,10 @@ lab22:
             if (cur_tok < left_brace_limit)
               decr(align_state);
 
-            goto lab40;
+            goto found;
           }
           else
-            goto lab22;
+            goto continu;
         }
 
         if (s != r)
@@ -819,7 +819,7 @@ lab22:
               "made up of letters only. The macro here has not been",
               "followed by the required stuff, so I'm ignoring it.");
             error();
-            goto lab10;
+            goto exit;
           }
           else
           {
@@ -835,20 +835,20 @@ lab22:
                 {
                   if (u == r)
                     if (cur_tok != info(v))
-                      goto lab30;
+                      goto done;
                     else
                     {
                       r = link(v);
-                      goto lab22;
+                      goto continu;
                     }
 
                     if (info(u) != info(v))
-                      goto lab30;
+                      goto done;
 
                     u = link(u);
                     v = link(v);
                 }
-lab30:
+done:
                 t = link(t);
               }
             while (!(t == r));
@@ -877,7 +877,7 @@ lab30:
             for (m = 0; m <= n; m++)
               flush_list(pstack[m]);
 
-            goto lab10;
+            goto exit;
           }
 
         if (cur_tok < right_brace_limit)
@@ -910,7 +910,7 @@ lab30:
 
                   for (m = 0; m <= n; m++)
                     flush_list(pstack[m]);
-                  goto lab10;
+                  goto exit;
                 }
 
               if (cur_tok < right_brace_limit)
@@ -921,10 +921,10 @@ lab30:
                   decr(unbalance);
 
                   if (unbalance == 0)
-                    goto lab31;
+                    goto done1;
                 }
             }
-lab31:
+done1:
             rbrace_ptr = p;
             store_new_token(cur_tok);
           }
@@ -944,14 +944,14 @@ lab31:
             long_state = call;
             cur_tok = par_token;
             ins_error();
-            goto lab22;
+            goto continu;
           }
         else
         {
           if (cur_tok == space_token)
             if (info(r) <= end_match_token)
               if (info(r) >= match_token)
-                goto lab22;
+                goto continu;
 
           store_new_token(cur_tok);
         }
@@ -959,11 +959,11 @@ lab31:
         incr(m);          /* m may be used without having been ... */
 
         if (info(r) > end_match_token)
-          goto lab22;
+          goto continu;
 
         if (info(r) < match_token)
-          goto lab22;
-lab40:
+          goto continu;
+found:
         if (s != 0)
         {
           if ((m == 1) && (info(p) < right_brace_limit) && (p != temp_head))
@@ -1031,7 +1031,7 @@ lab40:
 
     param_ptr = param_ptr + n;
   }
-lab10:
+exit:
   scanner_status = save_scanner_status;
   warning_index = save_warning_index;
 }
@@ -1259,11 +1259,11 @@ void expand (void)
 /* sec 0380 */
 void get_x_token (void)
 {
-lab20:
+restart:
   get_next();
 
   if (cur_cmd <= max_command)
-    goto lab30;
+    goto done;
 
   if (cur_cmd >= call)
     if (cur_cmd < end_template)
@@ -1272,14 +1272,14 @@ lab20:
     {
       cur_cs = frozen_endv;
       cur_cmd = endv;
-      goto lab30;
+      goto done;
     }
   else
     expand();
 
-  goto lab20;
+  goto restart;
 
-lab30:
+done:
   if (cur_cs == 0)
     cur_tok = (cur_cmd * 256) + cur_chr;
   else
@@ -1869,17 +1869,17 @@ void get_next (void)
   ASCII_code c, cc;
   char d;
 
-lab20:
+restart:
   cur_cs = 0;
 
   if (state != token_list)
   {
-lab25:
+lab_switch:
     if (loc <= limit)
     {
       cur_chr = buffer[loc];
       incr(loc);
-lab21:
+reswitch:
       cur_cmd = cat_code(cur_chr);
 
       switch (state + cur_cmd)
@@ -1887,7 +1887,7 @@ lab21:
         case any_state_plus(ignore):
         case skip_blanks + spacer:
         case new_line + spacer:
-          goto lab25;
+          goto lab_switch;
           break;
 
         case any_state_plus(escape):
@@ -1896,7 +1896,7 @@ lab21:
               cur_cs = null_cs;
             else
             {
-lab26:
+start_cs:
               k = loc;
               cur_chr = buffer[k];
               cat = cat_code(cur_chr);
@@ -1957,7 +1957,7 @@ lab26:
                             incr(k);
                           }
 
-                          goto lab26;
+                          goto start_cs;
                         }
                       }
                 }
@@ -1969,7 +1969,7 @@ lab26:
                 {
                   cur_cs = id_lookup(loc, k - loc);
                   loc = k;
-                  goto lab40;
+                  goto found;
                 }
               }
               else
@@ -2011,14 +2011,14 @@ lab26:
                           buffer[k] = buffer[k + d];
                           incr(k);
                         }
-                        goto lab26;
+                        goto start_cs;
                       }
                     }
               }
               cur_cs = single_base + buffer[loc];
               incr(loc);
             }
-lab40:
+found:
             cur_cmd = eq_type(cur_cs);
             cur_chr = equiv(cur_cs);
             
@@ -2059,7 +2059,7 @@ lab40:
                       {
                         incr(loc);
                         hex_to_cur_chr();
-                        goto lab21;
+                        goto reswitch;
                       }
                     }
 
@@ -2068,7 +2068,7 @@ lab40:
                   else
                     cur_chr = c - 64;
 
-                  goto lab21;
+                  goto reswitch;
                 }
               }
 
@@ -2084,7 +2084,7 @@ lab40:
             deletions_allowed = false;
             error();
             deletions_allowed = true;
-            goto lab20;
+            goto restart;
           }
           break;
 
@@ -2107,7 +2107,7 @@ lab40:
         case any_state_plus(comment):
           {
             loc = limit + 1;
-            goto lab25;
+            goto lab_switch;
           }
           break;
 
@@ -2177,13 +2177,11 @@ lab40:
         {
           print_char(')');
           decr(open_parens);
-#ifndef _WINDOWS
-          fflush(stdout);
-#endif
+          update_terminal();
           force_eof = false;
           end_file_reading();
           check_outer_validity();
-          goto lab20;
+          goto restart;
         }
 
         if (end_line_char_inactive())
@@ -2206,7 +2204,7 @@ lab40:
         if (input_ptr > 0)
         {
           end_file_reading();
-          goto lab20;
+          goto restart;
         }
 
         if (selector < log_only)
@@ -2241,7 +2239,7 @@ lab40:
       }
 
       check_interrupt();
-      goto lab25;
+      goto lab_switch;
     }
   }
   else if (loc != 0)
@@ -2292,7 +2290,7 @@ lab40:
         case out_param:
           {
             begin_token_list(param_stack[limit + cur_chr - 1], parameter);
-            goto lab20;
+            goto restart;
           }
           break;
 
@@ -2304,7 +2302,7 @@ lab40:
   else
   {
     end_token_list();
-    goto lab20;
+    goto restart;
   }
 
   if (cur_cmd <= car_ret)
@@ -2326,6 +2324,6 @@ lab40:
           begin_token_list(v_part(cur_align), v_template);
 
         align_state = 1000000L;
-        goto lab20;
+        goto restart;
       }
 }
\ No newline at end of file
index a299c10..1604054 100644 (file)
@@ -118,9 +118,9 @@ void scan_int (void)
         else if ((cur_tok <= other_A_token + 5) && (cur_tok >= other_A_token))
           d = cur_tok - other_A_token;
         else
-          goto lab30;
+          goto done;
       else
-        goto lab30;
+        goto done;
 
       vacuous = false;
 
@@ -140,7 +140,7 @@ void scan_int (void)
         cur_val = cur_val * radix + d;
       get_x_token();
     }
-lab30:;
+done:;
 
     if (vacuous)
     {
@@ -207,7 +207,7 @@ void scan_dimen_(boolean mu, boolean inf, boolean shortcut)
         }
 
         if (cur_val_level == mu_val)
-          goto lab89;
+          goto attach_sign;
 
         if (cur_val_level != int_val)
           mu_error();
@@ -217,7 +217,7 @@ void scan_dimen_(boolean mu, boolean inf, boolean shortcut)
         scan_something_internal(dimen_val, false);
 
         if (cur_val_level == dimen_val)
-          goto lab89;
+          goto attach_sign;
       }
     }
     else
@@ -251,7 +251,7 @@ void scan_dimen_(boolean mu, boolean inf, boolean shortcut)
           get_x_token();
 
           if ((cur_tok > zero_token + 9) || (cur_tok < zero_token))
-            goto lab31;
+            goto done1;
 
           if (k < 17)
           {
@@ -262,7 +262,7 @@ void scan_dimen_(boolean mu, boolean inf, boolean shortcut)
             incr(k);
           }
         }
-lab31:
+done1:
         for (kk = k; kk >= 1; kk--)
         {
           dig[kk - 1] = info(p);
@@ -303,7 +303,7 @@ lab31:
         else
           incr(cur_order);
       }
-      goto lab88;
+      goto attach_fraction;
     }
   }
 
@@ -341,18 +341,18 @@ lab31:
     }
 
     v = cur_val;
-    goto lab40;
+    goto found;
   }
 
   if (mu)
-    goto lab45;
+    goto not_found;
 
   if (scan_keyword("em"))
     v = quad(cur_font);
   else if (scan_keyword("ex"))
     v = x_height(cur_font);
   else
-    goto lab45;
+    goto not_found;
 
   {
     get_x_token();
@@ -361,15 +361,15 @@ lab31:
       back_input();
   }
 
-lab40:
+found:
   cur_val = mult_and_add(savecurval, v, xn_over_d(v, f, 65536L), 1073741823L);   /* 2^30 - 1 */
-  goto lab89;
+  goto attach_sign;
 
-lab45:
+not_found:
   if (mu)
   {
     if (scan_keyword("mu"))
-      goto lab88;
+      goto attach_fraction;
     else
     {
       print_err("Illegal unit of measure (");
@@ -379,7 +379,7 @@ lab45:
           "delete the erroneous units; e.g., type `2' to delete",
           "two letters. (See Chapter 27 of The TeXbook.)");
       error();
-      goto lab88;
+      goto attach_fraction;
     }
   }
 
@@ -397,7 +397,7 @@ lab45:
   }
 
   if (scan_keyword("pt"))
-    goto lab88;
+    goto attach_fraction;
 
   if (scan_keyword("in"))
     set_conversion(7227, 100);
@@ -418,7 +418,7 @@ lab45:
   else if (scan_keyword("H"))
     set_conversion(7227, 10160);
   else if (scan_keyword("sp"))
-    goto lab30;
+    goto done;
   else
   {
     print_err("Illegal unit of measure (");
@@ -430,27 +430,30 @@ lab45:
       "delete the erroneous units; e.g., type `2' to delete",
       "two letters. (See Chapter 27 of The TeXbook.)");
     error();
-    goto lab32;
+    goto done2;
   }
 
   cur_val = xn_over_d(cur_val, num, denom);
   f = (num * f + 65536L * tex_remainder) / denom;
   cur_val = cur_val +(f / 65536L);
   f = f % 65536L;
-lab32:;
-lab88:
+
+done2:
+attach_fraction:
   if (cur_val >= 16384)     /* 2^14 */
     arith_error = true;
   else
     cur_val = cur_val * unity + f;
-lab30:;
+
+done:
   {
     get_x_token();
 
     if (cur_cmd != spacer)
       back_input();
   }
-lab89:
+
+attach_sign:
   if (arith_error || (abs(cur_val) >= 1073741824L)) /* 2^30 */
   {
     print_err("Dimension too large");
@@ -554,27 +557,27 @@ halfword scan_rule_spec (void)
     depth(q) = 0;
   }
 
-lab21:
+reswitch:
 
   if (scan_keyword("width"))
   {
     scan_dimen(false, false, false);
     width(q) = cur_val;
-    goto lab21;
+    goto reswitch;
   }
 
   if (scan_keyword("height"))
   {
     scan_dimen(false, false, false);
     height(q) = cur_val;
-    goto lab21;
+    goto reswitch;
   }
 
   if (scan_keyword("depth"))
   {
     scan_dimen(false, false, false);
     depth(q) = cur_val;
-    goto lab21;
+    goto reswitch;
   }
 
   return q;
@@ -792,7 +795,7 @@ halfword scan_toks_(boolean macrodef, boolean xpand)
       get_token();
 
       if (cur_tok < right_brace_limit)
-        goto lab31;
+        goto done1;
 
       if (cur_cmd == mac_param)
       {
@@ -804,7 +807,7 @@ halfword scan_toks_(boolean macrodef, boolean xpand)
           hashbrace = cur_tok;
           store_new_token(cur_tok);
           store_new_token(end_match_token);
-          goto lab30;
+          goto done;
         }
 
         if (t == zero_token + 9)
@@ -831,7 +834,7 @@ halfword scan_toks_(boolean macrodef, boolean xpand)
       store_new_token(cur_tok);
     }
 
-lab31:
+done1:
     store_new_token(end_match_token);
 
     if (cur_cmd == right_brace)
@@ -841,9 +844,9 @@ lab31:
       help2("Where was the left brace? You said something like `\\def\\a}',",
           "which I'm going to interpret as `\\def\\a{}'.");
       error();
-      goto lab40;
+      goto found;
     }
-lab30:;
+done:;
   }
   else
   {
@@ -861,7 +864,7 @@ lab30:;
         get_next();
 
         if (cur_cmd <= max_command)
-          goto lab32;
+          goto done2;
 
         if (cur_cmd != the)
         {
@@ -878,7 +881,7 @@ lab30:;
           }
         }
       }
-lab32:
+done2:
       x_token();
     }
     else
@@ -892,7 +895,7 @@ lab32:
         decr(unbalance);
 
         if (unbalance == 0)
-          goto lab40;
+          goto found;
       }
     else if (cur_cmd == mac_param)
       if (macrodef)
@@ -921,7 +924,7 @@ lab32:
 
     store_new_token(cur_tok);
   }
-lab40:
+found:
   scanner_status = 0;
 
   if (hashbrace != 0)
@@ -1019,7 +1022,7 @@ void read_toks_(integer n, halfword r)
         get_token();
 
         if (cur_tok == 0)
-          goto lab30;
+          goto done;
 
         if (align_state < 1000000L)
         {
@@ -1030,12 +1033,12 @@ void read_toks_(integer n, halfword r)
           while (!(cur_tok == 0));
 
           align_state = 1000000L;
-          goto lab30;
+          goto done;
         }
 
         store_new_token(cur_tok);
       }
-lab30:
+done:
       end_file_reading();
     }
   while (!(align_state == 1000000L));
@@ -1062,7 +1065,7 @@ void pass_text (void)
     if (cur_cmd == fi_or_else)
     {
       if (l == 0)
-        goto lab30;
+        goto done;
 
       if (cur_chr == 2)
         decr(l);
@@ -1070,7 +1073,7 @@ void pass_text (void)
     else if (cur_cmd == if_test)
       incr(l);
   }
-lab30:
+done:
   scanner_status = save_scanner_status;
 }
 /* sec 0497 */
@@ -1344,7 +1347,7 @@ void conditional (void)
             if (cur_chr == or_code)
               decr(n);
             else 
-              goto lab50;
+              goto common_ending;
           else if (cur_chr == fi_code)
           {
             p = cond_ptr;
@@ -1387,7 +1390,7 @@ void conditional (void)
     if (cond_ptr == savecondptr)
     {
       if (cur_chr != or_code)
-        goto lab50;
+        goto common_ending;
 
       print_err("Extra ");
       print_esc("or");
@@ -1405,7 +1408,7 @@ void conditional (void)
     }
   }
 
-lab50:
+common_ending:
   if (cur_chr == fi_code)
   {
     p = cond_ptr;
@@ -1691,16 +1694,16 @@ void scan_file_name (void)
     if ((cur_cmd > other_char) || (cur_chr > 255)) 
     {
       back_input();
-      goto lab30
+      goto done
     } 
 
     if (!more_name(cur_chr))    /* up to next white space */
-      goto lab30;
+      goto done;
 
     get_x_token();
   }
 
-lab30:
+done:
   end_name();
   name_in_progress = false;
 }
@@ -1773,7 +1776,7 @@ void prompt_file_name_(char * s, str_number e)
     while (true)
     {
       if (k == last)
-        goto lab30;
+        goto done;
 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
 /*  convert tilde '~' to pseudo tilde */
       if (pseudo_tilde != 0 && buffer[k]== '~')
@@ -1783,11 +1786,11 @@ void prompt_file_name_(char * s, str_number e)
         buffer[k] = pseudo_space;
 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
       if (!more_name(buffer[k]))
-        goto lab30;
+        goto done;
 
       incr(k);
     }
-lab30:
+done:
     end_name();
   }
 
@@ -1966,13 +1969,13 @@ void start_input(void)
     begin_file_reading();
     
     if (a_open_in(cur_file, TEXINPUTPATH))
-      goto lab30;
+      goto done;
 
     end_file_reading();
     prompt_file_name("input file name", ".tex");
   }
 
-lab30
+done
   cur_input.name_field = a_make_name_string(cur_file);
 
   if (job_name == 0)
@@ -1993,11 +1996,7 @@ lab30:
     max_open_parens = open_parens;
 
   slow_print(cur_input.name_field);
-
-#ifndef _WINDOWS
-  fflush(stdout);
-#endif
-
+  update_terminal();
   state = new_line;
 
   {
@@ -2040,7 +2039,7 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
 
   if (!b_open_in(tfm_file))
   {
-    goto lab11;
+    goto bad_tfm;
   } 
 
   file_opened = true; 
@@ -2055,7 +2054,7 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
     read_sixteen(ec);
 
     if ((bc > ec + 1) || (ec > 255))
-      goto lab11;
+      goto bad_tfm;
 
     if (bc > 255)
     {
@@ -2081,10 +2080,10 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
     read_sixteen(np);
 
     if (lf != 6 + lh + (ec - bc + 1) + nw + nh + nd + ni + nl + nk + ne + np)
-      goto lab11;
+      goto bad_tfm;
 
     if ((nw == 0) || (nh == 0) || (nd == 0) || (ni == 0))
-      goto lab11;
+      goto bad_tfm;
   }
 
   lf = lf - 6 - lh;
@@ -2131,7 +2130,7 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
         "If you're really stuck, ask a wizard to enlarge me.",
         "Or maybe try `I\\font<same font id>=<name of loaded font>'.");
     error();
-    goto lab30;
+    goto done;
   }
 
   f = font_ptr + 1;
@@ -2147,7 +2146,7 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
 
   {
     if (lh < 2)
-      goto lab11;
+      goto bad_tfm;
     
     store_four_quarters(font_check[f]);
     tfm_temp = getc(tfm_file);
@@ -2158,7 +2157,7 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
     z =(z * 16) + (tfm_temp / 16);
 
     if (z < unity)
-      goto lab11
+      goto bad_tfm
 
     while (lh > 2)
     {
@@ -2185,25 +2184,25 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
     store_four_quarters(font_info[k].qqqq);
 
     if ((a >= nw) || (b / 16 >= nh) || (b % 16 >= nd) || (c / 4 >= ni))
-      goto lab11;
+      goto bad_tfm;
 
     switch (c % 4)
     {
       case lig_tag:
         if (d >= nl)
-          goto lab11;
+          goto bad_tfm;
         break;
 
       case ext_tag:
         if (d >= ne)
-          goto lab11;
+          goto bad_tfm;
         break;
 
       case list_tag:
         {
           {
             if ((d < bc) || (d > ec))
-              goto lab11;
+              goto bad_tfm;
           }
 
           while (d < k + bc - fmem_ptr)
@@ -2211,14 +2210,14 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
             qw = char_info(f, d);
  
             if (char_tag(qw) != list_tag)
-              goto lab45;
+              goto not_found;
 
             d = rem_byte(qw);
           }
 
           if (d == k + bc - fmem_ptr)
-            goto lab11;
-lab45:; 
+            goto bad_tfm;
+not_found:; 
         }
         break;
 
@@ -2258,20 +2257,20 @@ lab45:;
       else if (a == 255)
         font_info[k].cint = sw - alpha;
       else
-        goto lab11;
+        goto bad_tfm;
     }
 
     if (font_info[width_base[f]].cint != 0)
-      goto lab11;
+      goto bad_tfm;
 
     if (font_info[height_base[f]].cint != 0)
-      goto lab11;
+      goto bad_tfm;
 
     if (font_info[depth_base[f]].cint != 0)
-      goto lab11;
+      goto bad_tfm;
 
     if (font_info[italic_base[f]].cint != 0)
-      goto lab11;
+      goto bad_tfm;
   }
 
   bch_label = 32767;     /* '77777 */
@@ -2286,7 +2285,7 @@ lab45:;
       if (a > 128)
       {
         if (256 * c + d >= nl)
-          goto lab11;       /* error in TFM, abort */
+          goto bad_tfm;
 
         if (a == 255)
           if (k == lig_kern_base[f])
@@ -2298,33 +2297,33 @@ lab45:;
         {
           {
             if ((b < bc) || (b > ec))  /* check-existence(b) */
-              goto lab11;         /* error in TFM, abort */
+              goto bad_tfm;
           }
 
           qw = font_info[char_base[f] + b].qqqq;
 
           if (!(qw.b0 > 0))
-            goto lab11;         /* error in TFM, abort */
+            goto bad_tfm;
         }
 
         if (c < 128)
         {
           {
             if ((d < bc) || (d > ec))  /* check-existence(d) */
-              goto lab11;         /* error in TFM, abort */
+              goto bad_tfm;
           }
 
           qw = font_info[char_base[f] + d].qqqq;
 
           if (!(qw.b0 > 0))
-            goto lab11;         /* error in TFM, abort */
+            goto bad_tfm;
         }
         else if (256 * (c - 128) + d >= nk)
-          goto lab11;           /* error in TFM, abort */
+          goto bad_tfm;
 
         if (a < 128)
           if (k - lig_kern_base[f] + a + 1 >= nl)
-            goto lab11;         /* error in TFM, abort */
+            goto bad_tfm;
       }
     }
 
@@ -2348,10 +2347,10 @@ lab45:;
       font_info[k].cint = sw;
     else if (a == 255)
       font_info[k].cint = sw - alpha;
-    else goto lab11;
+    else
+      goto bad_tfm;
   }
 
-  /*  read extensible character recipes */
   for (k = exten_base[f]; k <= param_base[f] - 1; k++)
   {
     store_four_quarters(font_info[k].qqqq);
@@ -2360,51 +2359,51 @@ lab45:;
     {
       {
         if ((a < bc) || (a > ec))
-          goto lab11;
+          goto bad_tfm;
       }
 
       qw = font_info[char_base[f] + a].qqqq;
 
       if (!(qw.b0 > 0))
-        goto lab11;
+        goto bad_tfm;
     }
 
     if (b != 0)
     {
       {
         if ((b < bc) || (b > ec))
-          goto lab11;
+          goto bad_tfm;
       }
 
       qw = font_info[char_base[f] + b].qqqq;
 
       if (!(qw.b0 > 0))
-        goto lab11;
+        goto bad_tfm;
     }
 
     if (c != 0)
     {
       {
         if ((c < bc) || (c > ec))
-          goto lab11;
+          goto bad_tfm;
       }
 
       qw = font_info[char_base[f] + c].qqqq;
 
       if (!(qw.b0 > 0))
-        goto lab11;
+        goto bad_tfm;
     }
 
     {
       {
         if ((d < bc) || (d > ec))
-          goto lab11;
+          goto bad_tfm;
       }
 
       qw = font_info[char_base[f] + d].qqqq;
 
       if (!(qw.b0 > 0))
-        goto lab11;
+        goto bad_tfm;
     }
   }
 
@@ -2441,11 +2440,11 @@ lab45:;
           font_info[param_base[f] + k - 1].cint = sw;
         else if (a == 255)
           font_info[param_base[f] + k - 1].cint = sw - alpha;
-        else goto lab11;
+        else goto bad_tfm;
       }
 
     if (feof(tfm_file))
-      goto lab11;
+      goto bad_tfm;
 
     for (k = np + 1; k <= 7; k++)
       font_info[param_base[f] + k - 1].cint = 0;
@@ -2490,9 +2489,9 @@ lab45:;
   fmem_ptr = fmem_ptr + lf;
   font_ptr = f;
   g = f;
-  goto lab30;
+  goto done;
 
-lab11:
+bad_tfm:
   print_err("Font ");
   sprint_cs(u); 
   print_char('=');
@@ -2522,7 +2521,7 @@ lab11:
       "e.g., type `I\\font<same font id>=<substitute font name>'.");
   error();
 
-lab30:
+done:
   if (file_opened)
     b_close(tfm_file);
 
index 297e242..8d475ce 100644 (file)
@@ -44,38 +44,34 @@ void char_warning_(internal_font_number f, eight_bits c)
 
       if (c / 100 > 0)
       {
-        print_char(48 + c / 100);
-/*      c = c % 100; */
-        c = c - (c / 100) * 100;      /* ? */
-        print_char(48 + c / 10);
+        print_char('0' + c / 100);
+        c = c - (c / 100) * 100;
+        print_char('0' + c / 10);
       }
       else
       {
-/*      c = c % 100; */
-        c = c - (c / 100) * 100;      /* ? */
-        if (c / 10 > 0) print_char(48 + c / 10);
+        c = c - (c / 100) * 100;
+        if (c / 10 > 0)
+          print_char('0' + c / 10);
       }
-      print_char(48 + c % 10);
+      print_char('0' + c % 10);
       print_char(')');
-/*    print_char(32); */
     }
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+
     print_string(" in font ");
     slow_print(font_name[f]);
     print_char('!');
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-/*  if (show_missing) show_context(); */    /* in tex2.c 94/June/10 */
+
     if (show_missing)
     {
       if (f != 0)
         show_context();     /* not if its the nullfont */
     }
 
-    if (show_missing == 0)            /* show on screen 94/June/10 */
+    if (show_missing == 0)
       end_diagnostic(false);
 
     missing_characters++;           /* bkph 93/Dec/16 */
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
   }
 }
 /* sec 0582 */
@@ -102,7 +98,7 @@ void dvi_swap (void)
   if (trace_flag)
   {
     show_char('\n');
-    sprintf(log_line, "dvi_swap %d", dvi_gone);
+    sprintf(log_line, "dvi_swap() %d", dvi_gone);
     show_line(log_line, 0);
   }
 
@@ -219,7 +215,7 @@ void zmovement(scaled w, eight_bits o)
         case z_seen + yz_OK:
         case z_seen + y_OK:
           if (location(p) < dvi_gone)
-            goto lab45;
+            goto not_found;
           else
           {
             k = location(p) - dvi_offset;
@@ -229,7 +225,7 @@ void zmovement(scaled w, eight_bits o)
 
             dvi_buf[k] = dvi_buf[k] + y1 - down1;
             info(p) = y_here;
-            goto lab40;
+            goto found;
           }
           break;
 
@@ -237,7 +233,7 @@ void zmovement(scaled w, eight_bits o)
         case y_seen + yz_OK:
         case y_seen + z_OK:
           if (location(p) < dvi_gone)
-            goto lab45;
+            goto not_found;
           else
           {
             k = location(p) - dvi_offset;
@@ -247,7 +243,7 @@ void zmovement(scaled w, eight_bits o)
 
             dvi_buf[k] = dvi_buf[k] + z1 - down1;
             info(p) = z_here;
-            goto lab40;
+            goto found;
           }
           break;
 
@@ -255,33 +251,35 @@ void zmovement(scaled w, eight_bits o)
         case none_seen + z_here:
         case y_seen + z_here:
         case z_seen + y_here:
-          goto lab40;
+          goto found;
           break;
 
         default:
           break;
       }
-    else switch (mstate + info(p))
-    {
-      case none_seen + y_here:
-        mstate = y_seen;
-        break;
+    else
+      switch (mstate + info(p))
+      {
+        case none_seen + y_here:
+          mstate = y_seen;
+          break;
 
-      case none_seen + z_here:
-        mstate = z_seen;
-        break;
+        case none_seen + z_here:
+          mstate = z_seen;
+          break;
 
-      case y_seen + z_here:
-      case z_seen + y_here:
-        goto lab45;
-        break;
+        case y_seen + z_here:
+        case z_seen + y_here:
+          goto not_found;
+          break;
+
+        default:
+          break;
+      }
 
-      default:
-        break;
-    }
     p = link(p);
   }
-lab45:
+not_found:
 
   info(q) = yz_OK;
 
@@ -321,14 +319,15 @@ lab45:
     w = w + 256;
 
   goto lab1;
+
 lab2:
-  //dvi_out(w / 256);
-  dvi_out((w >> 8));
+  dvi_out(w / 256);
+
 lab1:
-  //dvi_out(w % 256);
-  dvi_out(w & 255);
+  dvi_out(w % 256);
   return;
-lab40:
+
+found:
   info(q) = info(p);
 
   if (info(q) == y_here)
@@ -386,14 +385,14 @@ void prune_movements_(integer l)
   while (down_ptr != 0)
   {
     if (location(down_ptr) < l)
-      goto lab30;
+      goto done;
 
     p = down_ptr;
     down_ptr = link(p);
     free_node(p, movement_node_size);
   }
 
-lab30:
+done:
   while (right_ptr != 0)
   {
     if (location(right_ptr) < l)
@@ -525,10 +524,10 @@ void out_what_(pointer p)
         else
         {
           if (write_open[j])
-            (void) a_close(write_file[j]); 
+            a_close(write_file[j]); 
 
           if (subtype(p) == close_node)
-            write_open[j]= false; 
+            write_open[j]= false;
           else if (j < 16)
           {
             cur_name = open_name(p);
@@ -540,10 +539,8 @@ void out_what_(pointer p)
 
             pack_file_name(cur_name, cur_area, cur_ext);
 
-            while (! a_open_out(write_file[j]))
-            {
+            while (!a_open_out(write_file[j]))
               prompt_file_name("output file name", ".tex");
-            }
 
             write_open[j] = true;
           }
@@ -575,9 +572,9 @@ void hlist_out (void)
   scaled save_h, save_v;
   halfword this_box;
 /*  glue_ord g_order;  */
-  int g_order;           /* 95/Jan/7 */
+  int g_order;
 /*  char g_sign;  */
-  int g_sign;            /* 95/Jan/7 */
+  int g_sign;
   halfword p;
   integer save_loc;
   halfword leader_box;
@@ -608,7 +605,7 @@ void hlist_out (void)
   left_edge = cur_h;
 
   while (p != 0)
-lab21:
+reswitch:
     if (is_char_node(p))
     {
       synch_h();
@@ -700,7 +697,7 @@ lab21:
           rule_ht = height(p);
           rule_dp = depth(p);
           rule_wd = width(p);
-          goto lab14;
+          goto fin_rule;
         }
         break;
 
@@ -720,26 +717,14 @@ lab21:
               if (stretch_order(g) == g_order)
               {
                 cur_glue = cur_glue + stretch(g);
-                glue_temp = glue_set(this_box) * cur_glue;
-
-                if (glue_temp > 1000000000.0)
-                  glue_temp = 1000000000.0;
-                else if (glue_temp < -1000000000.0)
-                  glue_temp = -1000000000.0;
-
+                vet_glue(glue_set(this_box) * cur_glue);
                 cur_g = round(glue_temp);
               }
             }
             else if (shrink_order(g) == g_order)
             {
               cur_glue = cur_glue - shrink(g);
-              glue_temp = glue_set(this_box) * cur_glue;
-
-              if (glue_temp > 1000000000.0)
-                glue_temp = 1000000000.0;
-              else if (glue_temp < -1000000000.0)
-                glue_temp = -1000000000.0;
-
+              vet_glue(glue_set(this_box) * cur_glue);
               cur_g = round(glue_temp);
             }
           }
@@ -754,7 +739,7 @@ lab21:
             {
               rule_ht = height(leader_box);
               rule_dp = depth(leader_box);
-              goto lab14;
+              goto fin_rule;
             }
 
             leader_wd = width(leader_box);
@@ -811,11 +796,11 @@ lab21:
               }
 
               cur_h = edge - 10;
-              goto lab15;
+              goto next_p;
             }
           }
 
-          goto lab13;
+          goto move_past;
         }
         break;
 
@@ -829,7 +814,7 @@ lab21:
           mem[lig_trick] = mem[lig_char(p)];
           link(lig_trick) = link(p);
           p = lig_trick;
-          goto lab21;
+          goto reswitch;
         }
         break;
 
@@ -837,12 +822,13 @@ lab21:
         break;
     }
 
-    goto lab15;
-lab14:
-    if ((rule_ht == -1073741824L))  /* - 2^30 */
+    goto next_p;
+
+fin_rule:
+    if (is_running(rule_ht))
       rule_ht = height(this_box);
 
-    if ((rule_dp == -1073741824L))     /* - 2^30 */
+    if (is_running(rule_dp))
       rule_dp = depth(this_box);
 
     rule_ht = rule_ht + rule_dp;
@@ -858,9 +844,11 @@ lab14:
       cur_v = base_line;
       dvi_h = dvi_h + rule_wd;
     }
-lab13:
+
+move_past:
     cur_h = cur_h + rule_wd;
-lab15:
+
+next_p:
     p = link(p);
   }
 
@@ -953,7 +941,7 @@ void vlist_out (void)
             rule_ht = height(p);
             rule_dp = depth(p);
             rule_wd = width(p);
-            goto lab14;
+            goto fin_rule;
           }
           break;
 
@@ -973,26 +961,14 @@ void vlist_out (void)
                 if (stretch_order(g) == g_order)
                 {
                   cur_glue = cur_glue + stretch(g);
-                  glue_temp = glue_set(this_box) * cur_glue;
-
-                  if (glue_temp > 1000000000.0)
-                    glue_temp = 1000000000.0;
-                  else if (glue_temp < -1000000000.0)
-                    glue_temp = -1000000000.0;
-
+                  vet_glue(glue_set(this_box) * cur_glue);
                   cur_g = round(glue_temp);
                 }
               }
               else if (shrink_order(g) == g_order)   /* BUG FIX !!! */
               {
                 cur_glue = cur_glue - shrink(g);
-                glue_temp = glue_set(this_box) * cur_glue;
-
-                if (glue_temp > 1000000000.0)
-                  glue_temp = 1000000000.0;
-                else if (glue_temp < -1000000000.0)
-                  glue_temp = -1000000000.0;
-
+                vet_glue(glue_set(this_box) * cur_glue);
                 cur_g = round(glue_temp);
               }
             }
@@ -1007,7 +983,7 @@ void vlist_out (void)
               {
                 rule_wd = width(leader_box);
                 rule_dp = 0;
-                goto lab14;
+                goto fin_rule;
               }
 
               leader_ht = height(leader_box) + depth(leader_box);
@@ -1065,11 +1041,11 @@ void vlist_out (void)
                 }
 
                 cur_v = edge - 10;
-                goto lab15;
+                goto next_p;
               }
             }
 
-            goto lab13;
+            goto move_past;
           }
           break;
 
@@ -1080,9 +1056,11 @@ void vlist_out (void)
         default:
           break;
       }
-      goto lab15;
-lab14:
-      if ((rule_wd == -1073741824L))    /* -2^30 */
+
+      goto next_p;
+
+fin_rule:
+      if (is_running(rule_wd))
         rule_wd = width(this_box);
 
       rule_ht = rule_ht + rule_dp;
@@ -1097,11 +1075,13 @@ lab14:
         dvi_four(rule_wd);
       }
 
-      goto lab15;
-lab13:
+      goto next_p;
+
+move_past:
       cur_v = cur_v + rule_ht;
     }
-lab15:
+
+next_p:
     p = link(p);
   }
 
@@ -1145,10 +1125,8 @@ void dvi_ship_out_(halfword p)
     if (k < j)
       print_char('.');
   }
-
-#ifndef _WINDOWS
-  fflush(stdout);
-#endif
+  
+  update_terminal();
 
   if (tracing_output > 0)
   {
@@ -1175,7 +1153,7 @@ void dvi_ship_out_(halfword p)
       end_diagnostic(true);
     }
 
-    goto lab30;
+    goto done;
   }
 
   if (height(p) + depth(p) + v_offset > max_v)
@@ -1194,8 +1172,8 @@ void dvi_ship_out_(halfword p)
   {
     dvi_out(pre);
     dvi_out(id_byte);
-    dvi_four(25400000L);  /* magic DVI scale factor */
-    dvi_four(473628672L); /* 7227 * 65536 */
+    dvi_four(25400000L);
+    dvi_four(473628672L);
     prepare_mag();
     dvi_four(mag);
     old_setting = selector;
@@ -1238,15 +1216,12 @@ void dvi_ship_out_(halfword p)
   incr(total_pages);
   cur_s = -1;
 
-lab30:;
+done:;
   if (tracing_output <= 0)
     print_char(']');
 
   dead_cycles = 0;
-
-#ifndef _WINDOWS
-  fflush(stdout);
-#endif
+  update_terminal();
 
 #ifdef STAT
   if (tracing_stats > 1)
@@ -1301,12 +1276,12 @@ void scan_spec_(group_code c, boolean three_codes)
   {
     spec_code = additional;
     cur_val = 0;
-    goto lab40;
+    goto found;
   }
 
   scan_dimen(false, false, false);
 
-lab40:
+found:
   if (three_codes)
   {
     saved(0) = s;
@@ -1354,7 +1329,7 @@ halfword hpack_(halfword p, scaled w, small_number m)
 
   while (p != 0)
   {
-lab21:
+reswitch:
     while (is_char_node(p))
     {
       f = font(p);
@@ -1430,6 +1405,7 @@ lab21:
 
         case whatsit_node:
           break;
+
         case glue_node:
           {
             g = glue_ptr(p);
@@ -1462,7 +1438,7 @@ lab21:
             mem[lig_trick] = mem[lig_char(p)];
             link(lig_trick) = link(p);
             p = lig_trick;
-            goto lab21;
+            goto reswitch;
           }
           break;
 
@@ -1490,7 +1466,7 @@ lab21:
     glue_sign(r) = normal;
     glue_order(r) = normal;
     glue_set(r) = 0.0;
-    goto lab10;
+    goto exit;
   }
   else if (x > 0)
   {
@@ -1532,12 +1508,12 @@ lab21:
           print_int(last_badness);
 
           if (last_badness > 100) /* Y&Y TeX */
-            underfull_hbox++;   /* 1996/Feb/9 */
+            underfull_hbox++;
 
-          goto lab50;
+          goto common_ending;
         }
       }
-      goto lab10;
+      goto exit;
   }
   else
   {
@@ -1554,7 +1530,7 @@ lab21:
     glue_sign(r) = shrinking;
 
     if (total_shrink[o] != 0)
-      glue_set(r) =(- (integer) x) / ((double) total_shrink[o]);
+      glue_set(r) = ((- (integer) x) / ((double) total_shrink[o]));
     else
     {
       glue_sign(r) = normal;
@@ -1584,7 +1560,7 @@ lab21:
 
           overfull_hbox++;
 
-          goto lab50;
+          goto common_ending;
       }
     }
     else if (o == normal)
@@ -1597,13 +1573,13 @@ lab21:
           print_ln();
           print_nl("Tight \\hbox (badness ");
           print_int(last_badness);
-          goto lab50;
+          goto common_ending;
         }
       }
-      goto lab10;
+      goto exit;
   }
 
-lab50:
+common_ending:
   if (output_active)
     print_string(") has occurred while \\output is active");
   else
@@ -1632,7 +1608,7 @@ lab50:
   show_box(r);
   end_diagnostic(true);
 
-lab10:
+exit:
   return r;
 }
 /* sec 0668 */
@@ -1748,7 +1724,7 @@ halfword vpackage_(halfword p, scaled h, small_number m, scaled l)
     glue_sign(r) = normal;
     glue_order(r) = normal;
     glue_set(r) = 0.0;
-    goto lab10;
+    goto exit;
   }
   else if (x > 0)
   {
@@ -1792,10 +1768,10 @@ halfword vpackage_(halfword p, scaled h, small_number m, scaled l)
           if (last_badness > 100)
             underfull_vbox++; /* 1996/Feb/9 */
 
-          goto lab50;
+          goto common_ending;
         }
       }
-      goto lab10;
+      goto exit;
   }
   else
   {
@@ -1833,7 +1809,7 @@ halfword vpackage_(halfword p, scaled h, small_number m, scaled l)
 
         overfull_vbox++;    /* 1996/Feb/9 */
 
-        goto lab50;
+        goto common_ending;
       }
     }
     else if (o == 0)
@@ -1845,13 +1821,13 @@ halfword vpackage_(halfword p, scaled h, small_number m, scaled l)
           print_ln();
           print_nl("Tight \\vbox (badness ");
           print_int(last_badness);
-          goto lab50;
+          goto common_ending;
         }
       }
-    goto lab10;
+    goto exit;
   }
 
-lab50:
+common_ending:
   if (output_active)
     print_string(") has occurred while \\output is active");
   else
@@ -1873,7 +1849,7 @@ lab50:
   show_box(r);
   end_diagnostic(true);
 
-lab10:
+exit:
   return r;
 }
 /* sec 0679 */
@@ -1893,6 +1869,7 @@ void append_to_vlist_(halfword b)
       p = new_skip_param(baseline_skip_code);
       width(temp_ptr) = d;
     }
+
     link(tail) = p;
     tail = p;
   }
@@ -2052,7 +2029,7 @@ halfword var_delimiter_(halfword d, small_number s, scaled v)
 
             if ((y >= font_bc[g]) && (y <= font_ec[g]))
             {
-lab22:
+continu:
               q = char_info(g, y);
               
               if ((q.b0 > 0))
@@ -2061,7 +2038,7 @@ lab22:
                 {
                   f = g;
                   c = y;
-                  goto lab40;
+                  goto found;
                 }
 
                 hd = height_depth(q);
@@ -2074,13 +2051,13 @@ lab22:
                   w = u;
 
                   if (u >= v)
-                    goto lab40;
+                    goto found;
                 }
 
                 if (char_tag(q) == list_tag)
                 {
                   y = rem_byte(q);
-                  goto lab22;
+                  goto continu;
                 }
               }
             }
@@ -2090,13 +2067,14 @@ lab22:
     }
 
     if (large_attempt)
-      goto lab40;
+      goto found;
 
     large_attempt = true;
     z = large_fam(d);
     x = large_char(d);
   }
-lab40:
+
+found:
   if (f != null_font)
     if (char_tag(q) == ext_tag)
     {
index 8559a4b..b464432 100644 (file)
@@ -143,7 +143,7 @@ halfword clean_box_(halfword p, small_number s)
     case sub_box:
       {
         q = info(p);
-        goto lab40;
+        goto found;
       }
       break;
 
@@ -154,7 +154,7 @@ halfword clean_box_(halfword p, small_number s)
     default:
       {
         q = new_null_box();
-        goto lab40;
+        goto found;
       }
     break;
   }
@@ -174,7 +174,7 @@ halfword clean_box_(halfword p, small_number s)
 
     cur_mu = x_over_n(math_quad(cur_size), 18);
   }
-lab40:
+found:
   if (is_char_node(q) || (q == 0))
     x = hpack(q, 0, 1);
   else if ((link(q) == 0) && (type(q) <= vlist_node) && (shift_amount(q) == 0))
@@ -350,18 +350,18 @@ void make_math_accent_(halfword q)
             if (op_byte(cur_i) >= kern_flag)
               if (skip_byte(cur_i) <= stop_flag)
                 s = char_kern(cur_f, cur_i);
-            goto lab31;
+            goto done1;
           }
 
           if (skip_byte(cur_i) >= stop_flag)
-            goto lab31;
+            goto done1;
 
           a = a + skip_byte(cur_i) + 1;
           cur_i = font_info[a].qqqq;
         }
       }
     }
-lab31:;
+done1:;
     x = clean_box(nucleus(q), cramped_style(cur_style));
     w = width(x);
     h = height(x);
@@ -369,20 +369,20 @@ lab31:;
     while (true)
     {
       if (char_tag(i) != list_tag)
-        goto lab30;
+        goto done;
 
       y = rem_byte(i);
       i = char_info(f, y);
 
       if (!(i.b0 > 0))
-        goto lab30;
+        goto done;
 
       if (char_width(f, i) > w)
-        goto lab30;
+        goto done;
 
       c = y;
     }
-lab30:;
+done:;
     if (h < x_height(f))
       delta = h;
     else
@@ -535,7 +535,7 @@ void make_ord_(halfword q)
   integer a;
   halfword p, r;
 
-lab20:
+restart:
   if (math_type(subscr(q)) == 0)
     if (math_type(supscr(q)) == 0)
       if (math_type(nucleus(q)) == math_char)
@@ -624,7 +624,7 @@ lab20:
                             return;
 
                           math_type(nucleus(q)) = math_char;
-                          goto lab20;
+                          goto restart;
                         }
 
                     if (skip_byte(cur_i) >= stop_flag)
@@ -704,7 +704,7 @@ void mlist_to_hlist (void)
 
   while (q != 0)
   {
-lab21:
+reswitch:
     delta = 0;
 
     switch (type(q))
@@ -720,7 +720,7 @@ lab21:
           case left_noad:
             {
               type(q) = ord_noad;
-              goto lab21;
+              goto reswitch;
             }
             break;
 
@@ -739,18 +739,18 @@ lab21:
             type(r) = ord_noad;
 
           if (type(q) == right_noad)
-            goto lab80;
+            goto done_with_noad;
         }
         break;
 
       case left_noad:
-        goto lab80;
+        goto done_with_noad;
         break;
 
       case fraction_noad:
         {
           make_fraction(q);
-          goto lab82;
+          goto check_dimensions;
         }
         break;
 
@@ -759,7 +759,7 @@ lab21:
           delta = make_op(q);
 
           if (subtype(q) == limits)
-            goto lab82;
+            goto check_dimensions;
         }
         break;
 
@@ -805,7 +805,7 @@ lab21:
             cur_mu = x_over_n(math_quad(cur_size), 18);
           }
 
-          goto lab81;
+          goto done_with_node;
         }
         break;
 
@@ -861,7 +861,7 @@ lab21:
 
             link(p) = z;
           }
-          goto lab81;
+          goto done_with_node;
         }
         break;
 
@@ -871,7 +871,7 @@ lab21:
       case whatsit_node:
       case penalty_node:
       case disc_node:
-        goto lab81;
+        goto done_with_node;
         break;
 
       case rule_node:
@@ -882,7 +882,7 @@ lab21:
           if (depth(q) > max_d)
             max_d = depth(q);
 
-          goto lab81;
+          goto done_with_node;
         }
         break;
 
@@ -908,14 +908,14 @@ lab21:
                 flush_node_list(p);
               }
           }
-          goto lab81;
+          goto done_with_node;
         }
         break;
 
       case kern_node:
         {
           math_kern(q, cur_mu);
-          goto lab81;
+          goto done_with_node;
         }
         break;
 
@@ -993,10 +993,10 @@ lab21:
     new_hlist(q) = p;
 
     if ((math_type(subscr(q)) == 0) && (math_type(supscr(q)) == 0))
-      goto lab82;
+      goto check_dimensions;
 
     make_scripts(q, delta);
-lab82:
+check_dimensions:
     z = hpack(new_hlist(q), 0, 1);
 
     if (height(z) > max_h)
@@ -1006,10 +1006,10 @@ lab82:
       max_d = depth(z);
 
     free_node(z, box_node_size);
-lab80:
+done_with_noad:
     r = q;
     r_type = type(r);
-lab81:
+done_with_node:
     q = link(q);
   }
 
@@ -1102,7 +1102,7 @@ lab81:
             cur_mu = x_over_n(math_quad(cur_size), 18);
           }
 
-          goto lab83;
+          goto delete_q;
         }
         break;
 
@@ -1120,7 +1120,7 @@ lab81:
           p = q;
           q = link(q);
           link(p) = 0;
-          goto lab30;
+          goto done;
         }
         break;
 
@@ -1211,11 +1211,11 @@ lab81:
         }
 
     r_type = t;
-lab83:
+delete_q:
     r = q;
     q = link(q);
     free_node(r, s);
-lab30:;
+done:;
   }
 }
 /* sec 0772 */
@@ -1255,7 +1255,7 @@ void pop_alignment (void)
 /* sec 0782 */
 void get_preamble_token (void)
 {
-lab20:
+restart:
   get_token();
 
   while ((cur_chr == span_code) && (cur_cmd == tab_mark))
@@ -1285,7 +1285,7 @@ lab20:
     else
       eq_define(glue_base + tab_skip_code, glue_ref, cur_val);
 
-    goto lab20;
+    goto restart;
   }
 }
 /* sec 0774 */
@@ -1334,7 +1334,7 @@ void init_align (void)
     cur_align = link(cur_align);
 
     if (cur_cmd == car_ret)
-      goto lab30;
+      goto done;
 
     p = hold_head;
     link(p) = 0;
@@ -1344,7 +1344,7 @@ void init_align (void)
       get_preamble_token();
 
       if (cur_cmd == mac_param)
-        goto lab31;
+        goto done1;
 
       if ((cur_cmd <= car_ret) && (cur_cmd >= tab_mark) && (align_state == -1000000L))
         if ((p == hold_head) && (cur_loop == 0) && (cur_cmd == tab_mark))
@@ -1356,7 +1356,7 @@ void init_align (void)
               "\\halign or \\valign is being set up. In this case you had",
               "none, so I've put one in; maybe that will work.");
           back_error();
-          goto lab31;
+          goto done1;
         }
       else if ((cur_cmd != spacer) || (p != hold_head))
       {
@@ -1366,7 +1366,7 @@ void init_align (void)
       }
     }
 
-lab31:
+done1:
     link(cur_align) = new_null_box();
     cur_align = link(cur_align);
     info(cur_align) = end_span;
@@ -1377,11 +1377,11 @@ lab31:
 
     while (true)
     {
-lab22:
+continu:
       get_preamble_token();
 
       if ((cur_cmd <= car_ret) && (cur_cmd >= tab_mark) && (align_state == -1000000L))
-        goto lab32;
+        goto done2;
 
       if (cur_cmd == mac_param)
       {
@@ -1390,7 +1390,7 @@ lab22:
             "\\halign or \\valign is being set up. In this case you had",
             "more than one, so I'm ignoring all but the first.");
         error();
-        goto lab22;
+        goto continu;
       }
 
       link(p) = get_avail();
@@ -1398,14 +1398,14 @@ lab22:
       info(p) = cur_tok;
     }
 
-lab32:
+done2:
     link(p) = get_avail();
     p = link(p);
     info(p) = end_template_token;
     v_part(cur_align) = link(hold_head);
   }
 
-lab30:
+done:
   scanner_status = 0;
   new_save_level(align_group);
 
index 1c41f83..ba8cbe2 100644 (file)
@@ -22,7 +22,7 @@
 /* sec 0785 */
 void align_peek (void)
 {
-lab20:
+restart:
   align_state = 1000000L;
 
   do
@@ -45,7 +45,7 @@ lab20:
     fin_align();
   }
   else if ((cur_cmd == car_ret) && (cur_chr == cr_cr_code))
-    goto lab20;
+    goto restart;
   else
   {
     init_row();
@@ -100,7 +100,7 @@ void try_break_ (integer pi, small_number break_type)
 
   if (abs(pi)>= inf_penalty)
     if (pi > 0)
-      goto lab10;
+      goto exit;
     else
       pi = eject_penalty;
 
@@ -111,7 +111,7 @@ void try_break_ (integer pi, small_number break_type)
 
   while (true)
   {
-lab22:
+continu:
     r = link(prev_r);
 
     if (type(r) == delta_node)
@@ -119,7 +119,7 @@ lab22:
       do_all_six(update_width);
       prev_prev_r = prev_r;
       prev_r = r;
-      goto lab22;
+      goto continu;
     }
 
     {
@@ -220,7 +220,7 @@ lab22:
               while (s != 0)
               {
                 if (is_char_node(s))
-                  goto lab30;
+                  goto done;
 
                 switch (type(s))
                 {
@@ -243,19 +243,19 @@ lab22:
 
                   case kern_node:
                     if (subtype(s) != explicit)
-                      goto lab30;
+                      goto done;
                     else
                       break_width[1] = break_width[1] - width(s);
                     break;
 
                   default:
-                    goto lab30;
+                    goto done;
                     break;
                 }
 
                 s = link(s);
               }
-lab30:;
+done:;
           }
 
           if (type(prev_r) == delta_node)
@@ -349,7 +349,7 @@ lab30:;
         }
 
         if (r == active)
-          goto lab10;
+          goto exit;
 
         if (l > easyline)
         {
@@ -387,7 +387,7 @@ lab30:;
             {
               b = 10000;
               fit_class = very_loose_fit;
-              goto lab31;
+              goto done1;
             }
 
           b = badness(shortfall, cur_active_width[2]);
@@ -399,7 +399,7 @@ lab30:;
               fit_class = loose_fit;
           else
             fit_class = decent_fit;
-lab31:;
+done1:;
         }
       else
       {
@@ -419,7 +419,7 @@ lab31:;
         if (final_pass && (minimum_demerits == awful_bad) && (link(r) == active) && (prev_r == active))
           artificial_demerits = true;
         else if (b > threshold)
-          goto lab60;
+          goto deactivate;
 
         node_r_stays_active = false;
       }
@@ -428,7 +428,7 @@ lab31:;
         prev_r = r;
 
         if (b > threshold)
-          goto lab22;
+          goto continu;
 
         node_r_stays_active = true;
       }
@@ -535,8 +535,8 @@ lab31:;
       }
 
       if (node_r_stays_active)
-        goto lab22;
-lab60:
+        goto continu;
+deactivate:
       link(prev_r) = link(r);
       free_node(r, active_node_size);
 
@@ -573,7 +573,7 @@ lab60:
       }
     }
   }
-lab10:
+exit:
   ;
 #ifdef STAT
   if (cur_p == printed_node)
@@ -630,7 +630,7 @@ void post_line_break_(integer final_widow_penalty)
           glue_ptr(q) = right_skip;
           subtype(q) = right_skip_code + 1;
           add_glue_ref(right_skip);
-          goto lab30;
+          goto done;
         }
         else
         {
@@ -700,7 +700,7 @@ void post_line_break_(integer final_widow_penalty)
       link(r) = link(q);
       link(q) = r;
       q = r;
-lab30:
+done:
       r = link(q);
       link(q) = 0;
       q = link(temp_head);
@@ -776,21 +776,21 @@ lab30:
             q = link(r);
 
             if (q == cur_break(cur_p))
-              goto lab31;
+              goto done1;
 
             if (is_char_node(q))
-              goto lab31;
+              goto done1;
 
             if (non_discardable(q))
-              goto lab31;
+              goto done1;
 
             if (type(q) == kern_node)
               if (subtype(q) != 1)
-                goto lab31;
+                goto done1;
 
             r = q;
           }
-lab31:
+done1:
           if (r != temp_head)
           {
             link(r) = 0;
@@ -849,13 +849,13 @@ small_number reconstitute_(small_number j, small_number n, halfword bchar, halfw
   lig_stack = 0;
   set_cur_r();
 
-lab22:
+continu:
   if (cur_l == non_char)
   {
     k = bchar_label[hf];
 
     if (k == non_address)
-      goto lab30;
+      goto done;
     else
       q = font_info[k].qqqq;
   }
@@ -864,7 +864,7 @@ lab22:
     q = char_info(hf, cur_l);
 
     if (char_tag(q) != lig_tag)
-      goto lab30;
+      goto done;
 
     k = lig_kern_start(hf, q);
     q = font_info[k].qqqq;
@@ -890,7 +890,7 @@ lab22:
           hyphen_passed = j;
           hchar = non_char;
           cur_rh = non_char;
-          goto lab22;     /* goto continue; */
+          goto continu;
         }
         else
         {
@@ -1012,7 +1012,7 @@ lab22:
                       cur_r = character(lig_stack);
                   }
                   else if (j == n)
-                    goto lab30;
+                    goto done;
                   else
                   {
                     append_charnode_to_t(cur_r);
@@ -1025,28 +1025,28 @@ lab22:
 
             if (op_byte(q) > 4)
               if (op_byte(q) != 7)
-                goto lab30;
+                goto done;
 
-            goto lab22;
+            goto continu;
           }
 
           w = char_kern(hf, q);
-          goto lab30;
+          goto done;
         }
 
     if (q.b0 >= stop_flag)
       if (cur_rh == non_char)
-        goto lab30;
+        goto done;
       else
       {
         cur_rh = non_char;
-        goto lab22;
+        goto continu;
       }
       
     k = k + skip_byte(q) + 1;
     q = font_info[k].qqqq;
   }
-lab30:
+done:
   wrap_lig(rt_hit);
 
   if (w != 0)
@@ -1062,7 +1062,7 @@ lab30:
     cur_l = character(lig_stack);
     ligature_present = true;
     pop_lig_stack();
-    goto lab22;
+    goto continu;
   }
 
   return j;
@@ -1103,10 +1103,10 @@ void hyphenate (void)
     k = hyph_word[h];
 
     if (k == 0)
-      goto lab45;
+      goto not_found;
 
     if (length(k) < hn)
-      goto lab45;
+      goto not_found;
 
     if (length(k) == hn)
     {
@@ -1116,10 +1116,10 @@ void hyphenate (void)
       do
         {
           if (str_pool[u] < hc[j])
-            goto lab45;
+            goto not_found;
 
           if (str_pool[u] > hc[j])
-            goto lab30;
+            goto done;
 
           incr(j);
           incr(u);
@@ -1135,16 +1135,16 @@ void hyphenate (void)
       }
 
       decr(hn);
-      goto lab40;
+      goto found;
     }
 
-lab30:;
+done:;
     if (h > 0)
       decr(h);
     else
       h = hyphen_prime;
   }
-lab45:
+not_found:
   decr(hn);
 
   if (trie_trc[cur_lang + 1] != cur_lang)
@@ -1183,7 +1183,7 @@ lab45:
     }
   }
 
-lab40:
+found:
   for (j = 0; j <= lhyf - 1; j++)
     hyf[j] = 0;
 
@@ -1192,11 +1192,11 @@ lab40:
 
   for (j = lhyf; j <= hn - rhyf; j++)
     if (odd(hyf[j]))
-      goto lab41;
+      goto found1;
 
   return;
 
-lab41:;
+found1:;
   q = link(hb);
   link(hb) = 0;
   r = link(ha);
@@ -1205,7 +1205,7 @@ lab41:;
 
   if (is_char_node(ha))
     if (font(ha) != hf)
-      goto lab42;
+      goto found2;
     else
     {
       init_list = ha;
@@ -1214,7 +1214,7 @@ lab41:;
     }
   else if (type(ha) == ligature_node)
     if (font(lig_char(ha)) != hf)
-      goto lab42;
+      goto found2;
     else
     {
       init_list = lig_ptr(ha);
@@ -1236,12 +1236,12 @@ lab41:;
     if (!is_char_node(r))
       if (type(r) == ligature_node)
         if (subtype(r) > 1)
-          goto lab42;
+          goto found2;
 
     j = 1;
     s = ha;
     init_list = 0;
-    goto lab50;
+    goto common_ending;
   }
 
   s = cur_p;
@@ -1250,14 +1250,14 @@ lab41:;
     s = link(s);
 
   j = 0;
-  goto lab50;
-lab42:
+  goto common_ending;
+found2:
   s = ha;
   j = 0;
   hu[0] = 256;
   init_lig = false;
   init_list = 0;
-lab50:
+common_ending:
   flush_node_list(r);
 
   do
@@ -1354,7 +1354,7 @@ lab50:
 
                   if (c_loc > 0)
                   {
-                    hu[c_loc] = c;    /* c may be used ... */
+                    hu[c_loc] = c;
                     c_loc = 0;
                   }
 
@@ -1431,7 +1431,7 @@ void new_hyph_exceptions (void)
   while (true)
   {
     get_x_token();
-lab21:
+reswitch:
     switch (cur_cmd)
     {
       case letter:
@@ -1469,7 +1469,7 @@ lab21:
           scan_char_num();
           cur_chr = cur_val;
           cur_cmd = char_given;
-          goto lab21;
+          goto reswitch;
         }
         break;
 
@@ -1504,10 +1504,10 @@ lab21:
               k = hyph_word[h];
 
               if (length(k) < length(s))
-                goto lab40;
+                goto found;
 
               if (length(k) > length(s))
-                goto lab45;
+                goto not_found;
 
               u = str_start[k];
               v = str_start[s];
@@ -1515,23 +1515,23 @@ lab21:
               do
                 {
                   if (str_pool[u] < str_pool[v])
-                    goto lab40;
+                    goto found;
 
                   if (str_pool[u] > str_pool[v])
-                    goto lab45;
+                    goto not_found;
 
                   incr(u);
                   incr(v);
                 }
               while (!(u == str_start[k + 1]));
-lab40:
+found:
               q = hyph_list[h];
               hyph_list[h] = p;
               p = q;
               t = hyph_word[h];
               hyph_word[h] = s;
               s = t;
-lab45:;
+not_found:;
               if (h > 0)
                 decr(h);
               else
@@ -1653,19 +1653,19 @@ halfword vert_break_(halfword p, scaled h, scaled d)
         {
           cur_height = cur_height + prev_dp + height(p);
           prev_dp = depth(p);
-          goto lab45;
+          goto not_found;
         }
         break;
 
       case whatsit_node:
-        goto lab45;
+        goto not_found;
         break;
 
       case glue_node:
         if (precedes_break(prev_p))
           pi = 0;
         else
-          goto lab90;
+          goto update_heights;
         break;
 
       case kern_node:
@@ -1678,7 +1678,7 @@ halfword vert_break_(halfword p, scaled h, scaled d)
           if (t == glue_node)
             pi = 0;
           else
-            goto lab90;
+            goto update_heights;
         }
         break;
 
@@ -1688,7 +1688,7 @@ halfword vert_break_(halfword p, scaled h, scaled d)
 
       case mark_node:
       case ins_node:
-        goto lab45;
+        goto not_found;
         break;
 
       default:
@@ -1729,12 +1729,13 @@ halfword vert_break_(halfword p, scaled h, scaled d)
       }
 
       if ((b == awful_bad) || (pi <= eject_penalty))
-        goto lab30;
+        goto done;
     }
 
     if ((type(p) < glue_node) || (type(p) > kern_node))
-      goto lab45;
-lab90:
+      goto not_found;
+
+update_heights:
     if (type(p) == kern_node)
       q = p;
     else
@@ -1761,7 +1762,7 @@ lab90:
 
     cur_height = cur_height + prev_dp + width(q);
     prev_dp = 0;
-lab45:
+not_found:
     if (prev_dp > d)
     {
       cur_height = cur_height + prev_dp - d;
@@ -1772,7 +1773,7 @@ lab45:
     p = link(prev_p);
   }
 
-lab30:
+done:
   return best_place;
 }
 /* sec 0977 */
@@ -1833,11 +1834,11 @@ halfword vsplit_(eight_bits n, scaled h)
     if (link(p) == q)
     {
       link(p) = 0;
-      goto lab30;
+      goto done;
     }
     p = link(p);
   }
-lab30:;
+done:;
   q = prune_page_top(q);
   p = list_ptr(v);
   free_node(v, box_node_size);
index 8a06862..ffda83f 100644 (file)
@@ -35,7 +35,7 @@ void build_page (void)
 
   do
     {
-lab22:
+continu:
       p = link(contrib_head);
 
       if (last_glue != max_halfword)
@@ -80,49 +80,49 @@ lab22:
 
             link(q) = p;
             link(contrib_head) = q;
-            goto lab22;
+            goto continu;
           }
           else
           {
             page_total = page_total + page_depth + height(p);
             page_depth = depth(p);
-            goto lab80;
+            goto contribute;
           }
           break;
 
         case whatsit_node:
-          goto lab80;
+          goto contribute;
           break;
 
         case glue_node:
           if (page_contents < box_there)
-            goto lab31;
+            goto done1;
           else if (precedes_break(page_tail))
             pi = 0;
           else
-            goto lab90;
+            goto update_heights;
           break;
 
         case kern_node:
           if (page_contents < box_there)
-            goto lab31;
+            goto done1;
           else if (link(p) == 0)
             return;
           else if (type(link(p)) == glue_node)
             pi = 0;
           else
-            goto lab90;
+            goto update_heights;
           break;
 
         case penalty_node:
           if (page_contents < box_there)
-            goto lab31;
+            goto done1;
           else
             pi = penalty(p);
           break;
 
         case mark_node:
-          goto lab80;
+          goto contribute;
           break;
 
         case ins_node:
@@ -248,7 +248,7 @@ lab22:
                   insert_penalties = insert_penalties + penalty(q);
               }
             }
-            goto lab80;
+            goto contribute;
           }
           break;
 
@@ -338,13 +338,14 @@ lab22:
           if (output_active)
             return;
 
-          goto lab30;
+          goto done;
         }
       }
 
       if ((type(p) < glue_node) || (type(p) > kern_node))
-        goto lab80; 
-lab90:
+        goto contribute;
+
+update_heights:
       if (type(p) == kern_node)
         q = p;
       else
@@ -371,7 +372,7 @@ lab90:
 
       page_total = page_total + page_depth + width(q);
       page_depth = 0;
-lab80:
+contribute:
       if (page_depth > page_max_depth)
       {
         page_total = page_total + page_depth - page_max_depth;
@@ -382,12 +383,12 @@ lab80:
       page_tail = p;
       link(contrib_head) = link(p);
       link(p) = 0;
-      goto lab30;
-lab31:
+      goto done;
+done1:
       link(contrib_head) = link(p);
       link(p) = 0;
       flush_node_list(p);
-lab30:;
+done:;
     }
   while (!(link(contrib_head) == 0));
 
@@ -795,7 +796,7 @@ void begin_box_(integer box_context)
                         p = link(p);
 
                       if (p == tail)
-                        goto lab30;
+                        goto done;
                     }
 
                   q = link(p);
@@ -806,7 +807,7 @@ void begin_box_(integer box_context)
               shift_amount(cur_box) = 0;
               tail = p;
               link(p) = 0;
-lab30:
+done:
               ;
             }
         }
@@ -1220,7 +1221,7 @@ void build_discretionary (void)
             end_diagnostic(true);
             flush_node_list(p);
             link(q) = 0;
-            goto lab30;
+            goto done;
           }
 
     q = p;
@@ -1228,7 +1229,7 @@ void build_discretionary (void)
     incr(n);
   }
 
-lab30:
+done:
   p = link(head);
   pop_nest();
 
@@ -1486,12 +1487,12 @@ void init_math (void)
 
       while (p != 0)
       {
-lab21:
+reswitch:
         if (is_char_node(p))
         {
           f = font(p);
           d = char_width(f, char_info(f, character(p)));
-          goto lab40;
+          goto found;
         }
 
         switch (type(p))
@@ -1501,7 +1502,7 @@ lab21:
           case rule_node:
             {
               d = width(p);
-              goto lab40;
+              goto found;
             }
             break;
 
@@ -1510,7 +1511,7 @@ lab21:
               mem[lig_trick] = mem[lig_char(p)];
               link(lig_trick) = link(p);
               p = lig_trick;
-              goto lab21;
+              goto reswitch;
             }
             break;
 
@@ -1536,7 +1537,7 @@ lab21:
               }
 
               if (subtype(p) >= a_leaders)
-                goto lab40;
+                goto found;
             }
             break;
 
@@ -1552,8 +1553,8 @@ lab21:
         if (v < max_dimen) /* - (2^30 - 1) */
           v = v + d;
 
-        goto lab45;
-lab40:
+        goto not_found;
+found:
         if (v < max_dimen) /* - (2^30 - 1) */
         {
           v = v + d;
@@ -1562,12 +1563,12 @@ lab40:
         else
         {
           w = max_dimen;  /* - (2^30 - 1) */
-          goto lab30;
+          goto done;
         }
-lab45:
+not_found:
         p = link(p);
       }
-lab30:;
+done:;
     }
 
     if (par_shape_ptr == 0)
@@ -1646,14 +1647,14 @@ void scan_math_(pointer p)
 {
   integer c;
 
-lab20:
+restart:
   do
     {
       get_x_token();
     }
   while (!((cur_cmd != spacer) && (cur_cmd != relax)));
 
-lab21:
+reswitch:
   switch (cur_cmd)
   {
     case letter:
@@ -1672,7 +1673,7 @@ lab21:
             back_input();
           }
 
-          goto lab20;
+          goto restart;
         }
       }
       break;
@@ -1682,7 +1683,7 @@ lab21:
         scan_char_num();
         cur_chr = cur_val;
         cur_cmd = char_given;
-        goto lab21;
+        goto reswitch;
       }
       break;
 
index 466eca5..0a07a6c 100644 (file)
@@ -420,7 +420,7 @@ void resume_after_display (void)
 /* sec 1215 */
 void get_r_token (void)
 {
-lab20:
+restart:
   do
     {
       get_token();
@@ -441,7 +441,7 @@ lab20:
 
     cur_tok = cs_token_flag + frozen_protection;
     ins_error();
-    goto lab20;
+    goto restart;
   }
 }
 /* sec 1229 */
@@ -471,7 +471,7 @@ void do_register_command_ (small_number a)
       {
         l = cur_chr;
         p = cur_cmd - assign_int;
-        goto lab40;
+        goto found;
       }
 
       if (cur_cmd != tex_register)
@@ -509,7 +509,7 @@ void do_register_command_ (small_number a)
     }
   }
 
-lab40:
+found:
   if (q == tex_register)
     scan_optional_equals();
   else
@@ -838,7 +838,7 @@ void new_font_(small_number a)
               sprintf(log_line, "SKIPPING %ld ", s);
               show_line(log_line, 0);
             }
-            goto lab50;
+            goto common_ending;
           }
         }
       }
@@ -851,7 +851,7 @@ void new_font_(small_number a)
             sprintf(log_line, "SKIPPING %ld ", s);
             show_line(log_line, 0);
           }
-          goto lab50;
+          goto common_ending;
         }
       }
     }
@@ -862,7 +862,7 @@ void new_font_(small_number a)
 
   f = read_font_info(u, cur_name, cur_area, s); 
 
-lab50:
+common_ending:
   if (trace_flag)
   {
     sprintf(log_line, "NEW FONT %d ", f);
@@ -981,10 +981,7 @@ void issue_message (void)
       print_char(' ');
 
     slow_print(s);
-
-#ifndef _WINDOWS
-    fflush(stdout);
-#endif
+    update_terminal();
   }
   else
   {
@@ -1087,7 +1084,7 @@ void show_whatever (void)
         }
 
         print_meaning();
-        goto lab50;
+        goto common_ending;
       }
       break;
 
@@ -1101,7 +1098,7 @@ void show_whatever (void)
         print_nl("> ");
         token_show(temp_head);
         flush_list(link(temp_head));
-        goto lab50;
+        goto common_ending;
       }
       break;
   }
@@ -1117,7 +1114,7 @@ void show_whatever (void)
       selector = term_and_log;
     }
 
-lab50:
+common_ending:
 
   if (interaction < error_stop_mode)
   {
index 2515c02..a6f9abe 100644 (file)
@@ -44,7 +44,7 @@ boolean open_fmt_file (void)
     pack_buffered_name(0, loc, j - 1);
 
     if (w_open_in(fmt_file))
-      goto lab40;
+      goto found;
   
     if (knuth_flag)
     {
@@ -67,9 +67,7 @@ boolean open_fmt_file (void)
       show_line(log_line, 1);
     }
 
-#ifndef _WINDOWS
-    fflush(stdout);
-#endif
+    update_terminal();
   }
 
   pack_buffered_name(format_default_length - 4, 1, 0);
@@ -97,7 +95,7 @@ boolean open_fmt_file (void)
     return false;
   }
 
-lab40:
+found:
   loc = j;
 
   return true;
index 6e7229e..a906e45 100644 (file)
@@ -847,6 +847,8 @@ char *unixify (char *);
 #include "coerce.h"
 
 /* sec 79 */
+extern inline void update_terminal(void);
+extern inline void check_full_save_stack(void);
 extern inline void push_input(void);
 extern inline void pop_input(void);
 extern inline void print_err (const char * s);
index b6648ad..b4c8954 100644 (file)
@@ -54,13 +54,6 @@ extern void fix_date_and_time(void);
   #define dumpcore abort
 #endif
 
-//#define write_dvi(a, b)                                           \
-//  if ((size_t) fwrite ((char *) &dvi_buf[a], sizeof (dvi_buf[a]), \
-//         (size_t) ((size_t)(b) - (size_t)(a) + 1), dvi_file)      \
-//         != (size_t) ((size_t)(b) - (size_t)(a) + 1))             \
-//     FATAL_PERROR ("\n! dvi file")
-
-
 #ifdef COMPACTFORMAT
 extern int do_dump   (char *, int, int, gzFile);
 extern int do_undump (char *, int, int, gzFile);
index 322f6ae..6601220 100644 (file)
 
 #include "texd.h"
 
-inline void push_input(void)
+inline void update_terminal(void)
 {
-  if (input_ptr > max_in_stack)
+#ifndef _WINDOWS
+  fflush(stdout);
+#endif
+}
+
+inline void check_full_save_stack(void)
+{
+  if (save_ptr > max_save_stack)
   {
-    max_in_stack = input_ptr;
+    max_save_stack = save_ptr;
 
-#ifdef ALLOCATEINPUTSTACK
-    if (input_ptr == current_stack_size)
-      input_stack = realloc_input_stack(increment_stack_size);
+#ifdef ALLOCATESAVESTACK
+    if (max_save_stack > current_save_size - 6)
+      save_stack = realloc_save_stack(increment_save_size);
     
-    if (input_ptr == current_stack_size)
+    if (max_save_stack > current_save_size - 6)
     {
-      overflow("input stack size", current_stack_size);
+      overflow("save size", current_save_size);
       return;
     }
 #else
-    if (input_ptr == stack_size)
+    if (max_save_stack > save_size - 6)
     {
-      overflow("input stack size", stack_size);
+      overflow("save size", save_size);
       return;
     }
 #endif
   }
-  
-  input_stack[input_ptr] = cur_input;
-  incr(input_ptr);
-}
-inline void pop_input(void)
-{
-  decr(input_ptr);
-  cur_input = input_stack[input_ptr];
-}
-inline void ensure_dvi_open(void)
-{
-  if (output_file_name == 0)
-  {
-    if (job_name == 0)
-      open_log_file();
-
-    pack_job_name(".dvi");
-
-    while (!b_open_out(dvi_file))
-    {
-      prompt_file_name("file name for output", ".dvi");
-    }
-
-    output_file_name = b_make_name_string(dvi_file);
-  }
 }
-
 inline void write_dvi(size_t a, size_t b)
 {
   if (fwrite((char *) &dvi_buf[a], sizeof(dvi_buf[a]),
@@ -80,22 +61,6 @@ inline void prompt_input(const char * s)
   print_string(s);
   term_input();
 }
-inline void synch_h(void)
-{
-  if (cur_h != dvi_h)
-  {
-    movement(cur_h - dvi_h, right1);
-    dvi_h = cur_h;
-  }
-}
-inline void synch_v(void)
-{
-  if (cur_v != dvi_v)
-  {
-    movement(cur_v - dvi_v, down1);
-    dvi_v = cur_v;
-  }
-}
 inline void set_cur_lang(void)
 {
   if (language <= 0)
@@ -113,42 +78,33 @@ inline void free_avail_(halfword p)
   decr(dyn_used);
 #endif
 }
-inline void dvi_out_(ASCII_code op)
+/* sec 0042 */
+inline void append_char (ASCII_code c)
 {
-  dvi_buf[dvi_ptr] = op;
-  incr(dvi_ptr);
-
-  if (dvi_ptr == dvi_limit)
-    dvi_swap();
+  str_pool[pool_ptr] = c;
+  incr(pool_ptr);
 }
-inline void succumb (void)
+/* sec 0042 */
+inline void str_room(int val)
 {
-  if (interaction == error_stop_mode)
-    interaction = scroll_mode;
-
-  if (log_opened)
-  {
-    error();
-  }
+#ifdef ALLOCATESTRING
+  if (pool_ptr + val > current_pool_size)
+    str_pool = realloc_str_pool(increment_pool_size);
 
-#ifdef DEBUG
-  if (interaction > 0)
-    debug_help();
+  if (pool_ptr + val > current_pool_size)
+    overflow("pool size", current_pool_size - init_pool_ptr);
+#else
+  if (pool_ptr + val > pool_size)
+    overflow("pool size", pool_size - init_pool_ptr);
 #endif
-
-  history = error_stop_mode;
-  jump_out();
 }
+/* sec 0044 */
 inline void flush_string (void)
 {
   decr(str_ptr);
   pool_ptr = str_start[str_ptr];
 }
-inline void append_char (ASCII_code c)
-{
-  str_pool[pool_ptr] = c;
-  incr(pool_ptr);
-}
+/* sec 0048 */
 inline void append_lc_hex (ASCII_code c)
 {
   if (c < 10)
@@ -156,6 +112,7 @@ inline void append_lc_hex (ASCII_code c)
   else
     append_char(c - 10 + 'a');
 }
+/* sec 0073 */
 inline void print_err (const char * s)
 {
   if (interaction == error_stop_mode);
@@ -163,6 +120,7 @@ inline void print_err (const char * s)
 
   print_string(s);
 }
+/* sec 0079 */
 inline void tex_help (unsigned int n, ...)
 {
   int i;
@@ -179,21 +137,107 @@ inline void tex_help (unsigned int n, ...)
 
   va_end(help_arg);
 }
-inline void str_room(int val)
+/* sec 0093 */
+inline void succumb (void)
 {
-#ifdef ALLOCATESTRING
-  if (pool_ptr + val > current_pool_size)
-    str_pool = realloc_str_pool(increment_pool_size);
+  if (interaction == error_stop_mode)
+    interaction = scroll_mode;
 
-  if (pool_ptr + val > current_pool_size)
-    overflow("pool size", current_pool_size - init_pool_ptr);
-#else
-  if (pool_ptr + val > pool_size)
-    overflow("pool size", pool_size - init_pool_ptr);
+  if (log_opened)
+  {
+    error();
+  }
+
+#ifdef DEBUG
+  if (interaction > 0)
+    debug_help();
 #endif
+
+  history = error_stop_mode;
+  jump_out();
 }
+/* sec 0214 */
 inline void tail_append_ (pointer val)
 {
   link(tail) = val;
   tail = link(tail);
+}
+/* sec 0321 */
+inline void push_input(void)
+{
+  if (input_ptr > max_in_stack)
+  {
+    max_in_stack = input_ptr;
+
+#ifdef ALLOCATEINPUTSTACK
+    if (input_ptr == current_stack_size)
+      input_stack = realloc_input_stack(increment_stack_size);
+    
+    if (input_ptr == current_stack_size)
+    {
+      overflow("input stack size", current_stack_size);
+      return;
+    }
+#else
+    if (input_ptr == stack_size)
+    {
+      overflow("input stack size", stack_size);
+      return;
+    }
+#endif
+  }
+  
+  input_stack[input_ptr] = cur_input;
+  incr(input_ptr);
+}
+/* sec 0322 */
+inline void pop_input(void)
+{
+  decr(input_ptr);
+  cur_input = input_stack[input_ptr];
+}
+/* sec 0532 */
+inline void ensure_dvi_open(void)
+{
+  if (output_file_name == 0)
+  {
+    if (job_name == 0)
+      open_log_file();
+
+    pack_job_name(".dvi");
+
+    while (!b_open_out(dvi_file))
+    {
+      prompt_file_name("file name for output", ".dvi");
+    }
+
+    output_file_name = b_make_name_string(dvi_file);
+  }
+}
+/* sec 0598 */
+inline void dvi_out_(ASCII_code op)
+{
+  dvi_buf[dvi_ptr] = op;
+  incr(dvi_ptr);
+
+  if (dvi_ptr == dvi_limit)
+    dvi_swap();
+}
+/* sec 0616 */
+inline void synch_h(void)
+{
+  if (cur_h != dvi_h)
+  {
+    movement(cur_h - dvi_h, right1);
+    dvi_h = cur_h;
+  }
+}
+/* sec 0616 */
+inline void synch_v(void)
+{
+  if (cur_v != dvi_v)
+  {
+    movement(cur_v - dvi_v, down1);
+    dvi_v = cur_v;
+  }
 }
\ No newline at end of file
index 2ed8723..914abe4 100644 (file)
@@ -152,7 +152,7 @@ while (0)
 #define rule_node      2
 #define rule_node_size 4
 #define null_flag      -010000000000L
-#define is_running(a)  (a = null_flag)
+#define is_running(a)  (a == null_flag)
 /* sec 0140 */
 #define ins_node         3
 #define ins_node_size    5
@@ -991,14 +991,17 @@ while (0)
 #define extra_space(f)   param(extra_space_code, f)
 /* sec 0564 */
 #define read_sixteen(a)         \
+do                              \
   {                             \
     a = tfm_temp;               \
     if (a > 127)                \
-      goto lab11;               \
+      goto bad_tfm;             \
     tfm_temp = getc(tfm_file);  \
     a = a * 256 + tfm_temp;     \
-  }
+  }                             \
+while (0)
 #define store_four_quarters(val)  \
+do                                \
   {                               \
     tfm_temp = getc(tfm_file);    \
     a = tfm_temp;                 \
@@ -1013,7 +1016,8 @@ while (0)
     d = tfm_temp;                 \
     qw.b3 = d;                    \
     val = qw;                     \
-  }
+  }                               \
+while (0)
 /* sec 0571 */
 /* sec 0585 */
 #define set1      128 // c[1]
@@ -1091,6 +1095,18 @@ while (0)
 #define none_seen 0
 #define y_seen    6
 #define z_seen    12
+/* sec 0625 */
+#define billion 1000000000.0
+#define vet_glue(a)             \
+do                              \
+{                               \
+  glue_temp = a;                \
+  if (glue_temp > billion)      \
+    glue_temp = billion;        \
+  else if (glue_temp < -billion)\
+    glue_temp = -billion;       \
+}                               \
+while (0)
 /* sec 0644 */
 #define exactly    0
 #define additional 1
@@ -1278,13 +1294,16 @@ while (0)
 #define next_break prev_break
 /* sec 0908 */
 #define append_charnode_to_t(a) \
+do                              \
   {                             \
     link(t) = get_avail();      \
     t = link(t);                \
     font(t) = hf;               \
     character(t) = (a);         \
-  }
+  }                             \
+while (0)
 #define set_cur_r()      \
+do                       \
   {                      \
     if (j < n)           \
       cur_r = hu[j + 1]; \
@@ -1295,9 +1314,12 @@ while (0)
       cur_rh = hchar;    \
     else                 \
       cur_rh = non_char; \
-  }
+  }                      \
+while (0)
 /* sec 0910 */
 #define wrap_lig(a)                           \
+do                                            \
+{                                             \
   if (ligature_present)                       \
   {                                           \
     p = new_ligature(hf, cur_l, link(cur_q)); \
@@ -1318,8 +1340,11 @@ while (0)
     link(cur_q) = p;                          \
     t = p;                                    \
     ligature_present = false;                 \
-  }
+  }                                           \
+}                                             \
+while (0)
 #define pop_lig_stack()                       \
+do                                            \
   {                                           \
     if (lig_ptr(lig_stack) != 0)              \
     {                                         \
@@ -1338,13 +1363,16 @@ while (0)
     }                                         \
     else                                      \
       cur_r = character(lig_stack);           \
-  }
+  }                                           \
+while (0)
 /* sec 0914 */
 #define advance_major_tail()       \
+do                                 \
   {                                \
     major_tail = link(major_tail); \
     incr(r_count);                 \
-  }
+  }                                \
+while (0)
 /* sec 0970 */
 #define active_height      active_width
 #define cur_height         active_height[1]
@@ -1371,6 +1399,7 @@ while (0)
 #define set_page_so_far_zero(a) page_so_far[(a)] = 0
 /* sec 1034 */
 #define adjust_space_factor()   \
+do                              \
 {                               \
   main_s = sf_code(cur_chr);    \
   if (main_s == 1000)           \
@@ -1384,10 +1413,12 @@ while (0)
     space_factor = 1000;        \
   else                          \
     space_factor = main_s;      \
-}
+}                               \
+while (0)
 /* sec 1035 */
 /* -> false */
 #define wrapup(a)                                         \
+do                                                        \
 {                                                         \
   if (cur_l < non_char)                                   \
   {                                                       \
@@ -1427,7 +1458,8 @@ while (0)
       }                                                   \
     }                                                     \
   }                                                       \
-}
+}                                                         \
+while (0)
 /* sec 1045 */
 #define any_mode(a) vmode + a: case hmode + a: case mmode + a
 /* sec 1046 */
@@ -1492,7 +1524,7 @@ do                                \
     undump_int(x);                \
                                   \
     if ((x < (va)) || (x > (vb))) \
-      goto lab_bad_fmt;           \
+      goto bad_fmt;               \
     else                          \
       vc = x;                     \
   }                               \