OSDN Git Service

redesigned backends.
[putex/putex.git] / src / texsourc / tex3.c
index 3943cca..51da359 100644 (file)
 /* sec 0440 */
 void scan_int (void)
 {
-  bool negative;
+  boolean negative;
   integer m;
   small_number d;
-  bool vacuous;
-  bool OKsofar;
+  boolean vacuous;
+  boolean OKsofar;
 
   radix = 0;
   OKsofar = true;
@@ -158,9 +158,9 @@ lab30:;
     cur_val = - (integer) cur_val;
 }
 /* sec 0448 */
-void scan_dimen_(bool mu, bool inf, bool shortcut)
+void scan_dimen_(boolean mu, boolean inf, boolean shortcut)
 {
-  bool negative;
+  boolean negative;
   integer f;
   integer num, denom;
   small_number k, kk;
@@ -398,50 +398,23 @@ lab45:
     goto lab88;
 
   if (scan_keyword("in"))
-  {
-    num = 7227;
-    denom = 100;
-  }
+    set_conversion(7227, 100);
   else if (scan_keyword("pc"))
-  {
-    num = 12;
-    denom = 1;
-  }
+    set_conversion(12, 1);
   else if (scan_keyword("cm"))
-  {
-    num = 7227;
-    denom = 254;
-  }
+    set_conversion(7227, 254);
   else if (scan_keyword("mm"))
-  {
-    num = 7227;
-    denom = 2540;
-  }
+    set_conversion(7227, 2540);
   else if (scan_keyword("bp"))
-  {
-    num = 7227;
-    denom = 7200;
-  }
+    set_conversion(7227, 7200);
   else if (scan_keyword("dd"))
-  {
-    num = 1238;
-    denom = 1157;
-  }
+    set_conversion(1238, 1157);
   else if (scan_keyword("cc"))
-  {
-    num = 14856;
-    denom = 1157;
-  }
+    set_conversion(14856, 1157);
   else if (scan_keyword("Q"))
-  {
-    num = 7227;
-    denom = 10160;
-  }
+    set_conversion(7227, 10160);
   else if (scan_keyword("H"))
-  {
-    num = 7227;
-    denom = 10160;
-  }
+    set_conversion(7227, 10160);
   else if (scan_keyword("sp"))
     goto lab30;
   else
@@ -492,9 +465,9 @@ lab89:
 /* sec 0461 */
 void scan_glue_(small_number level)
 {
-  bool negative;
+  boolean negative;
   halfword q;
-  bool mu;
+  boolean mu;
 
   mu = (level == mu_val);
   negative = false;
@@ -625,27 +598,11 @@ halfword str_toks_(pool_pointer b)
       t = space_token;
     else
       t = other_token + t;
-    {
-      {
-        q = avail;
 
-        if (q == 0)
-          q = get_avail();
-        else
-        {
-          avail = mem[q].hh.v.RH;
-          mem[q].hh.v.RH = 0;
-#ifdef STAT
-          incr(dyn_used); 
-#endif /* STAT */
-        }
-      } 
-      mem[p].hh.v.RH = q;
-      mem[q].hh.v.LH = t;
-      p = q;
-    }
+    fast_store_new_token(t);
     incr(k);
   }
+
   pool_ptr = b;
 
   return p;
@@ -663,42 +620,22 @@ halfword the_toks (void)
 
   if (cur_val_level >= ident_val)
   {
-    p = temp_head; 
+    p = temp_head;
     link(p) = 0;
 
     if (cur_val_level == ident_val)
-    {
-      q = get_avail();
-      mem[p].hh.v.RH = q;
-      mem[q].hh.v.LH = cs_token_flag + cur_val;
-      p = q;
-    }
+      store_new_token(cs_token_flag + cur_val);
     else if (cur_val != 0)
     {
       r = link(cur_val);
 
-      while (r != 0) { /*   while r<>null do l.9178 */
-        {
-          {
-            q = avail;
-            if (q == 0)
-              q = get_avail();
-            else
-            {
-              avail = mem[q].hh.v.RH;
-              mem[q].hh.v.RH = 0;
-#ifdef STAT
-              incr(dyn_used);
-#endif /* STAT */
-            }
-          }
-          mem[p].hh.v.RH = q;
-          mem[q].hh.v.LH = mem[r].hh.v.LH;
-          p = q;
-        }
+      while (r != 0)
+      {
+        fast_store_new_token(info(r));
         r = link(r);
       }
     }
+
     Result = p;
   }
   else
@@ -824,7 +761,7 @@ void conv_toks (void)
   begin_token_list(link(temp_head), 4);
 }
 /* sec 0473 */
-halfword scan_toks_(bool macrodef, bool xpand)
+halfword scan_toks_(boolean macrodef, boolean xpand)
 {
   register halfword Result;
   halfword t;
@@ -863,18 +800,8 @@ halfword scan_toks_(bool macrodef, bool xpand)
         if (cur_cmd == left_brace)
         {
           hashbrace = cur_tok;
-          {
-            q = get_avail();
-            mem[p].hh.v.RH = q;
-            mem[q].hh.v.LH = cur_tok;
-            p = q;
-          }
-          {
-            q = get_avail();
-            mem[p].hh.v.RH = q;
-            mem[q].hh.v.LH = end_match_token;
-            p = q;
-          }
+          store_new_token(cur_tok);
+          store_new_token(end_match_token);
           goto lab30;
         }
 
@@ -898,20 +825,12 @@ halfword scan_toks_(bool macrodef, bool xpand)
           cur_tok = s;
         }
       }
-      {
-        q = get_avail();
-        mem[p].hh.v.RH = q;
-        mem[q].hh.v.LH = cur_tok;
-        p = q;
-      }
+
+      store_new_token(cur_tok);
     }
+
 lab31:
-    {
-      q = get_avail();
-      mem[p].hh.v.RH = q;
-      mem[q].hh.v.LH = end_match_token;
-      p = q;
-    }
+    store_new_token(end_match_token);
 
     if (cur_cmd == right_brace)
     {
@@ -997,23 +916,15 @@ lab32:
           else
             cur_tok = out_param_token - '0' + cur_chr;
       }
-    {
-      q = get_avail();
-      mem[p].hh.v.RH = q;
-      mem[q].hh.v.LH = cur_tok;
-      p = q;
-    }
+
+    store_new_token(cur_tok);
   }
 lab40:
   scanner_status = 0;
 
   if (hashbrace != 0)
-  {
-    q = get_avail();
-    mem[p].hh.v.RH = q;
-    mem[q].hh.v.LH = hashbrace;
-    p = q;
-  }
+    store_new_token(hashbrace);
+
   Result = p;
   return Result;
 }
@@ -1032,13 +943,7 @@ void read_toks_(integer n, halfword r)
   def_ref = get_avail();
   token_ref_count(def_ref) = 0;
   p = def_ref;
-
-  {
-    q = get_avail();
-    mem[p].hh.v.RH = q;
-    mem[q].hh.v.LH = end_match_token;
-    p = q;
-  }
+  store_new_token(end_match_token);
 
   if ((n < 0) || (n > 15))
     m = 16;
@@ -1132,12 +1037,7 @@ void read_toks_(integer n, halfword r)
           goto lab30;
         }
 
-        {
-          q = get_avail();
-          mem[p].hh.v.RH = q;
-          mem[q].hh.v.LH = cur_tok;
-          p = q;
-        }
+        store_new_token(cur_tok);
       }
 lab30:
       end_file_reading();
@@ -1210,7 +1110,7 @@ void change_if_limit_(small_number l, halfword p)
 /* sec 0498 */
 void conditional (void)
 {
-  bool b;
+  boolean b;
   char r;
   integer m, n;
   halfword p, q;
@@ -1525,8 +1425,8 @@ lab50:
 /* sec 0515 */
 void begin_name (void)
 {
-  area_delimiter = 0; /* index between `file area' and `file name' */
-  ext_delimiter = 0;  /* index between `file name' and `file extension' */
+  area_delimiter = 0;
+  ext_delimiter = 0;
 }
 /* This gathers up a file name and makes a string of it */
 /* Also tries to break it into `file area' `file name' and `file extension' */
@@ -1534,7 +1434,7 @@ void begin_name (void)
 /* We assume tilde has been converted to pseudo_tilde and space to pseudo_space */
 /* returns false if it is given a space character - end of file name */
 /* sec 0516 */
-bool more_name_(ASCII_code c)
+boolean more_name_(ASCII_code c)
 {
   if (quoted_file_name == 0 && c == ' ')
     return false;
@@ -1544,26 +1444,18 @@ bool more_name_(ASCII_code c)
     return true;    /* accept ending quote, but throw away */
   }
   else
-  {
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-/*  convert pseudo tilde back to '~' 95/Sep/26 */ /* moved here 97/June/5 */
-/*  if (pseudo_tilde != 0 && c == pseudo_tilde) c = '~'; */
-/*  convert pseudo space back to ' ' 97/June/5 */ /* moved here 97/June/5 */
-/*  if (pseudo_space != 0 && c == pseudo_space) c = ' '; */
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */      
+  {   
     str_room(1);
     append_char(c);
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-//  if ((c == 47))   /* / */
-//  for DOS/Windows
-    if ((c == '/' || c == '\\' || c == ':')) /* 94/Mar/1 */
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+    //  for DOS/Windows
+    if ((c == '/' || c == '\\' || c == ':')) 
     {
       area_delimiter = cur_length;
       ext_delimiter = 0;
     } 
     else if (c == '.')
       ext_delimiter = cur_length;
+
     return true;
   }
 }
@@ -1583,8 +1475,6 @@ int find_string (int start, int end)
   int k, nlen = end - start;
   char *s;
 
-//  int trace_flag = 1;     // debugging only
-
   if (trace_flag)
   {
     sprintf(log_line, "\nLOOKING for string (str_ptr %d nlen %d) ", str_ptr, end - start);
@@ -1686,19 +1576,17 @@ void end_name (void)
 
   if (str_ptr + 3 > current_max_strings)
   {
-    overflow("number of strings", current_max_strings - init_str_ptr);  /* 97/Mar/7 */
+    overflow("number of strings", current_max_strings - init_str_ptr);
     return;     // abort_flag set
   }
 #else
   if (str_ptr + 3 > max_strings)
   {
-    overflow("number of strings", max_strings - init_str_ptr); /* number of strings */
+    overflow("number of strings", max_strings - init_str_ptr);
     return;     // abort_flag set
   }
 #endif
 
-//  if (notfirst++ == 0) show_all_strings();  // debugging only
-  
   if (area_delimiter == 0)   // no area delimiter ':' '/' or '\' found
     cur_area = 335;     // "" default area 
   else
@@ -1776,7 +1664,7 @@ void pack_file_name_(str_number n, str_number a, str_number e)
     c = str_pool[j];
     incr(k);
 
-    if (k <= PATHMAX)
+    if (k <= PATH_MAX)
       name_of_file[k] = xchr[c];
   }
 
@@ -1785,7 +1673,7 @@ void pack_file_name_(str_number n, str_number a, str_number e)
     c = str_pool[j];
     incr(k);
 
-    if (k <= PATHMAX)
+    if (k <= PATH_MAX)
       name_of_file[k] = xchr[c];
   }
 
@@ -1794,20 +1682,20 @@ void pack_file_name_(str_number n, str_number a, str_number e)
     c = str_pool[j];
     incr(k);
 
-    if (k <= PATHMAX)
+    if (k <= PATH_MAX)
       name_of_file[k] = xchr[c];
   }
 
-  if (k < PATHMAX)
+  if (k < PATH_MAX)
     name_length = k;
   else
-    name_length = PATHMAX - 1;
+    name_length = PATH_MAX - 1;
 
 /*  pad it out with spaces ... what for ? in case we modify and forget  ? */
-  for (k = name_length + 1; k <= PATHMAX; k++)
+  for (k = name_length + 1; k <= PATH_MAX; k++)
     name_of_file[k] = ' ';
 
-  name_of_file[PATHMAX] = '\0';    /* paranoia 94/Mar/24 */
+  name_of_file[PATH_MAX] = '\0';    /* paranoia 94/Mar/24 */
 
   {
     name_of_file [name_length+1] = '\0';
@@ -1831,8 +1719,8 @@ void pack_buffered_name_(small_number n, integer a, integer b)
   ASCII_code c;
   integer j;
 
-  if (n + b - a + 5 > PATHMAX)
-    b = a + PATHMAX - n - 5;
+  if (n + b - a + 5 > PATH_MAX)
+    b = a + PATH_MAX - n - 5;
 
   k = 0;
 
@@ -1842,7 +1730,7 @@ void pack_buffered_name_(small_number n, integer a, integer b)
     c = xord[TEX_format_default[j]];
     incr(k);
 
-    if (k <= PATHMAX)
+    if (k <= PATH_MAX)
       name_of_file[k] = xchr[c];
   }
 /*  This loop kicks in when we want a specififed format name */
@@ -1851,7 +1739,7 @@ void pack_buffered_name_(small_number n, integer a, integer b)
     c = buffer[j];
     incr(k);
 
-    if (k <= PATHMAX)
+    if (k <= PATH_MAX)
       name_of_file[k] = xchr[c];
   }
 
@@ -1861,20 +1749,20 @@ void pack_buffered_name_(small_number n, integer a, integer b)
     c = xord[TEX_format_default[j]];
     incr(k);
 
-    if (k <= PATHMAX)
+    if (k <= PATH_MAX)
       name_of_file[k] = xchr[c];
   }
 
-  if (k < PATHMAX)
+  if (k < PATH_MAX)
     name_length = k;
   else
-    name_length = PATHMAX - 1;
+    name_length = PATH_MAX - 1;
 
  /*  pad it out with spaces ... what for ? */
-  for (k = name_length + 1; k <= PATHMAX; k++)
+  for (k = name_length + 1; k <= PATH_MAX; k++)
     name_of_file[k]= ' ';
 
-  name_of_file[PATHMAX] = '\0';    /* paranoia 94/Mar/24 */
+  name_of_file[PATH_MAX] = '\0';    /* paranoia 94/Mar/24 */
 }
 /* sec 0525 */
 str_number make_name_string (void)
@@ -2272,7 +2160,7 @@ void job_name_append (void)
 /* sec 0537 */
 void start_input(void)
 {
-  bool added_extension = false;
+  boolean added_extension = false;
 
   scan_file_name();
   pack_file_name(cur_name, cur_area, cur_ext); 
@@ -2285,7 +2173,7 @@ void start_input(void)
     if ((cur_ext != 335) && a_open_in(input_file[cur_input.index_field], TEXINPUTPATH))
       goto lab30;
 
-    if ((cur_ext != 785) && (name_length + 5 < PATHMAX))
+    if ((cur_ext != 785) && (name_length + 5 < PATH_MAX))
     {
       name_of_file[name_length + 1] = '.';
       name_of_file[name_length + 2] = 't';
@@ -2408,137 +2296,66 @@ void show_tex_fonts (void)
 internal_font_number read_font_info_(halfword u, str_number nom, str_number aire, scaled s)
 {
   font_index k;
-  bool fileopened;
-/*  halfword lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np;  */
+  boolean file_opened;
   halfword lf, lh, nw, nh, nd, ni, nl, nk, ne, np;
-/*  halfword bc, ec; */
-  int bc, ec;             /* 95/Jan/7 */
+  int bc, ec;
   internal_font_number f;
   internal_font_number g;
   eight_bits a, b, c, d;
-  ffour_quarters qw;
+  four_quarters qw;
   scaled sw;
-  integer bchlabel;
+  integer bch_label;
   short bchar;
   scaled z;
   integer alpha;
   char beta;
 
   g = 0;
-  fileopened = false;
+  file_opened = false;
   pack_file_name(nom, aire, 805); /* .tfm */
 
-  if (!b_open_in(tfm_file)) /* new in C version d */
+  if (!b_open_in(tfm_file))
   {
     goto lab11;
   } 
-/*   was just: goto lab11; */
-  fileopened = true; 
+
+  file_opened = true; 
+
   {
-/*  tfm_temp = getc(tfm_file);  */ /* done already in open_input, but why? */
-    //tfm_temp = getc(tfm_file);
-    {
-      lf = tfm_temp;
-      if (lf > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      lf = lf * 256 + tfm_temp;
-    }
+    read_sixteen(lf);
     tfm_temp = getc(tfm_file);
-    {
-      lh = tfm_temp;
-      if (lh > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      lh = lh * 256 + tfm_temp;
-    }
+    read_sixteen(lh);
     tfm_temp = getc(tfm_file);
-    {
-      bc = tfm_temp;
-      if (bc > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      bc = bc * 256 + tfm_temp;
-    }
+    read_sixteen(bc);
     tfm_temp = getc(tfm_file);
-    {
-      ec = tfm_temp;
-      if (ec > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      ec = ec * 256 + tfm_temp;
-    }
-    if ((bc > ec + 1)||(ec > 255))
+    read_sixteen(ec);
+
+    if ((bc > ec + 1) || (ec > 255))
       goto lab11;
+
     if (bc > 255)
     {
       bc = 1;
       ec = 0;
     }
+
     tfm_temp = getc(tfm_file);
-    {
-      nw = tfm_temp;
-      if (nw > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      nw = nw * 256 + tfm_temp;
-    }
+    read_sixteen(nw);
     tfm_temp = getc(tfm_file);
-    {
-      nh = tfm_temp;
-      if (nh > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      nh = nh * 256 + tfm_temp;
-    }
+    read_sixteen(nh);
     tfm_temp = getc(tfm_file);
-    {
-      nd = tfm_temp;
-      if (nd > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      nd = nd * 256 + tfm_temp;
-    }
+    read_sixteen(nd);
     tfm_temp = getc(tfm_file);
-    {
-      ni = tfm_temp;
-      if (ni > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      ni = ni * 256 + tfm_temp;
-    }
+    read_sixteen(ni);
     tfm_temp = getc(tfm_file);
-    {
-      nl = tfm_temp;
-      if (nl > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      nl = nl * 256 + tfm_temp;
-    }
+    read_sixteen(nl);
     tfm_temp = getc(tfm_file);
-    {
-      nk = tfm_temp;
-      if (nk > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      nk = nk * 256 + tfm_temp;
-    }
+    read_sixteen(nk);
     tfm_temp = getc(tfm_file);
-    {
-      ne = tfm_temp;
-      if (ne > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      ne = ne * 256 + tfm_temp;
-    }
+    read_sixteen(ne);
     tfm_temp = getc(tfm_file);
-    {
-      np = tfm_temp;
-      if (np > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      np = np * 256 + tfm_temp;
-    }
+    read_sixteen(np);
+
     if (lf != 6 + lh + (ec - bc + 1) + nw + nh + nd + ni + nl + nk + ne + np)
       goto lab11;
 
@@ -2550,9 +2367,9 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
 
   if (np < 7)
     lf = lf + 7 - np;
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+
 #ifdef ALLOCATEFONT
-  if ((fmem_ptr + lf > current_font_mem_size))   /* 93/Nov/28 */
+  if ((fmem_ptr + lf > current_font_mem_size))
     font_info = realloc_font_info (increment_font_mem_size + lf);
 
   if ((font_ptr == font_max) || (fmem_ptr + lf > current_font_mem_size))
@@ -2563,7 +2380,7 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
     if (trace_flag)
     {
       sprintf(log_line, "font_ptr %d font_max %d fmem_ptr %d lf %d font_mem_size %d\n",
-          font_ptr, font_max, fmem_ptr, lf, font_mem_size); /* debugging */
+          font_ptr, font_max, fmem_ptr, lf, font_mem_size);
       show_line(log_line, 0);
     }
 
@@ -2607,32 +2424,10 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
   {
     if (lh < 2)
       goto lab11;
-/*  build the font checksum now */
-    {
-      tfm_temp = getc(tfm_file);
-      a = tfm_temp;
-      qw.b0 = a;
-      tfm_temp = getc(tfm_file);
-      b = tfm_temp;
-      qw.b1 = b;
-      tfm_temp = getc(tfm_file);
-      c = tfm_temp;
-      qw.b2 = c;
-      tfm_temp = getc(tfm_file);
-      d = tfm_temp;
-      qw.b3 = d;
-      font_check[f] = qw;
-    }
-
+    
+    store_four_quarters(font_check[f]);
     tfm_temp = getc(tfm_file);
-    {
-      z = tfm_temp;
-      if (z > 127)
-        goto lab11;
-      tfm_temp = getc(tfm_file);
-      z = z * 256 + tfm_temp;
-    }
-
+    read_sixteen(z);
     tfm_temp = getc(tfm_file);
     z = z * 256 + tfm_temp;
     tfm_temp = getc(tfm_file);
@@ -2663,52 +2458,38 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
 
   for (k = fmem_ptr; k <= width_base[f] - 1; k++)
   {
-    {
-      tfm_temp = getc(tfm_file);
-      a = tfm_temp;
-      qw.b0 = a;
-      tfm_temp = getc(tfm_file);
-      b = tfm_temp;
-      qw.b1 = b;
-      tfm_temp = getc(tfm_file);
-      c = tfm_temp;
-      qw.b2 = c;
-      tfm_temp = getc(tfm_file);
-      d = tfm_temp;
-      qw.b3 = d;
-      font_info[k].qqqq = qw;
-    }
+    store_four_quarters(font_info[k].qqqq);
 
     if ((a >= nw) || (b / 16 >= nh) || (b % 16 >= nd) || (c / 4 >= ni))
       goto lab11;
 
     switch (c % 4)
     {
-      case :
+      case lig_tag:
         if (d >= nl)
           goto lab11;
         break;
 
-      case :
+      case ext_tag:
         if (d >= ne)
           goto lab11;
         break;
 
-      case :
+      case list_tag:
         {
           {
-            if ((d < bc)||(d > ec))
+            if ((d < bc) || (d > ec))
               goto lab11;
           }
 
           while (d < k + bc - fmem_ptr)
           {
-            qw = font_info[char_base[f]+ d].qqqq;
+            qw = char_info(f, d);
  
-            if (((qw.b2)% 4)!= 2)
+            if (char_tag(qw) != list_tag)
               goto lab45;
 
-            d = qw.b3;
+            d = rem_byte(qw);
           }
 
           if (d == k + bc - fmem_ptr)
@@ -2721,6 +2502,7 @@ lab45:;
         break;
     }
   }
+
   {
     {
       alpha = 16;
@@ -2767,29 +2549,15 @@ lab45:;
     if (font_info[italic_base[f]].cint != 0)
       goto lab11;
   }
-/*  read ligature/kern program */
-  bchlabel = 32767;     /* '77777 */
+
+  bch_label = 32767;     /* '77777 */
   bchar = 256;
 
   if (nl > 0)
   {
     for (k = lig_kern_base[f]; k <= kern_base[f] + 256 * (128) - 1; k++)
     {
-      {
-        tfm_temp = getc(tfm_file);
-        a = tfm_temp;
-        qw.b0 = a;
-        tfm_temp = getc(tfm_file);
-        b = tfm_temp;
-        qw.b1 = b;
-        tfm_temp = getc(tfm_file);
-        c = tfm_temp;
-        qw.b2 = c;
-        tfm_temp = getc(tfm_file);
-        d = tfm_temp;
-        qw.b3 = d;
-        font_info[k].qqqq = qw; /* store_four_quarters(font_info[k].qqqq */
-      }
+      store_four_quarters(font_info[k].qqqq);
 
       if (a > 128)
       {
@@ -2829,6 +2597,7 @@ lab45:;
         }
         else if (256 * (c - 128) + d >= nk)
           goto lab11;           /* error in TFM, abort */
+
         if (a < 128)
           if (k - lig_kern_base[f] + a + 1 >= nl)
             goto lab11;         /* error in TFM, abort */
@@ -2836,7 +2605,7 @@ lab45:;
     }
 
     if (a == 255)
-      bchlabel = 256 * c + d;
+      bch_label = 256 * c + d;
   }
 
   for (k = kern_base[f] + 256 * (128); k <= exten_base[f] - 1; k++)
@@ -2857,26 +2626,11 @@ lab45:;
       font_info[k].cint = sw - alpha;
     else goto lab11;
   }
-/*  read extensible character recipes */
-/*  for k:=exten_base[f] to param_base[f]-1 do */
+
+  /*  read extensible character recipes */
   for (k = exten_base[f]; k <= param_base[f] - 1; k++)
   {
-    {
-      tfm_temp = getc(tfm_file);
-      a = tfm_temp;
-      qw.b0 = a;
-      tfm_temp = getc(tfm_file);
-      b = tfm_temp;
-      qw.b1 = b;
-      tfm_temp = getc(tfm_file);
-      c = tfm_temp;
-      qw.b2 = c;
-      tfm_temp = getc(tfm_file);
-      d = tfm_temp;
-      qw.b3 = d;
-/*    store_four_quarters(font_info[k].qqqq); */
-      font_info[k].qqqq = qw;
-    }
+    store_four_quarters(font_info[k].qqqq);
 
     if (a != 0)
     {
@@ -2916,6 +2670,7 @@ lab45:;
       if (!(qw.b0 > 0))
         goto lab11;
     }
+
     {
       {
         if ((d < bc) || (d > ec))
@@ -2928,6 +2683,7 @@ lab45:;
         goto lab11;
     }
   }
+
   {
     for (k = 1; k <= np; k++)
       if (k == 1)
@@ -2979,8 +2735,8 @@ lab45:;
   hyphen_char[f] = default_hyphen_char;
   skew_char[f] = default_skew_char;
 
-  if (bchlabel < nl)
-    bchar_label[f] = bchlabel + lig_kern_base[f];
+  if (bch_label < nl)
+    bchar_label[f] = bch_label + lig_kern_base[f];
   else
     bchar_label[f] = non_address;
 
@@ -3030,7 +2786,7 @@ lab11:
     print_int(- (integer) s);
   } 
 
-  if (fileopened)
+  if (file_opened)
     print_string(" not loadable: Bad metric (TFM) file");
   else
     print_string(" not loadable: Metric (TFM) file not found");
@@ -3049,7 +2805,7 @@ lab11:
   error();
 
 lab30:
-  if (fileopened)
+  if (file_opened)
     b_close(tfm_file);
 
   return g;