#include "texd.h"
-/* rebox_ used to be in tex4.c */
/* sec 0715 */
halfword rebox_(halfword b, scaled w)
{
p = list_ptr(b);
- if (((p >= hi_mem_min)) && (link(p) == 0))
+ if ((is_char_node(p)) && (link(p) == 0))
{
f = font(p);
v = char_width(f, char_info(f, character(p)));
case sub_box:
{
q = info(p);
- goto lab40;
+ goto found;
}
break;
default:
{
q = new_null_box();
- goto lab40;
+ goto found;
}
break;
}
cur_mu = x_over_n(math_quad(cur_size), 18);
}
-lab40:
- if ((q >= hi_mem_min) || (q == 0))
+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))
x = q;
q = list_ptr(x);
- if ((q >= hi_mem_min))
+ if (is_char_node(q))
{
r = link(q);
if (r != 0)
if (link(r) == 0)
- if (!(r >= hi_mem_min))
+ if (!is_char_node(r))
if (type(r) == kern_node)
{
free_node(r, small_node_size);
if (type(v) != vlist_node)
{
confusion("vcenter");
- return; // abort_flag set
+ return;
}
+
delta = height(v) + depth(v);
height(v) = axis_height(cur_size) + half(delta);
depth(v) = delta - height(v);
integer a;
quarterword c;
internal_font_number f;
- ffour_quarters i;
+ four_quarters i;
scaled s;
scaled h;
scaled delta;
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);
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
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)
return;
math_type(nucleus(q)) = math_char;
- goto lab20;
+ goto restart;
}
if (skip_byte(cur_i) >= stop_flag)
void mlist_to_hlist (void)
{
halfword mlist;
- bool penalties;
+ boolean penalties;
small_number style;
small_number save_style;
halfword q;
while (q != 0)
{
-lab21:
+reswitch:
delta = 0;
switch (type(q))
case left_noad:
{
type(q) = ord_noad;
- goto lab21;
+ goto reswitch;
}
break;
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;
delta = make_op(q);
if (subtype(q) == limits)
- goto lab82;
+ goto check_dimensions;
}
break;
cur_mu = x_over_n(math_quad(cur_size), 18);
}
- goto lab81;
+ goto done_with_node;
}
break;
link(p) = z;
}
- goto lab81;
+ goto done_with_node;
}
break;
case whatsit_node:
case penalty_node:
case disc_node:
- goto lab81;
+ goto done_with_node;
break;
case rule_node:
if (depth(q) > max_d)
max_d = depth(q);
- goto lab81;
+ goto done_with_node;
}
break;
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;
default:
{
confusion("mlist1");
- return; // abort_flag set
+ return;
}
break;
}
default:
{
confusion("mlist2");
- return; // abort_flag set
+ return;
}
break;
}
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)
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);
}
cur_mu = x_over_n(math_quad(cur_size), 18);
}
- goto lab83;
+ goto delete_q;
}
break;
p = q;
q = link(q);
link(p) = 0;
- goto lab30;
+ goto done;
}
break;
default:
{
confusion("mlist3");
- return; // abort_flag set
+ return;
}
break;
}
default:
{
confusion("mlist4");
- return; // abort_flag set
+ return;
}
break;
}
}
r_type = t;
-lab83:
+delete_q:
r = q;
q = link(q);
free_node(r, s);
-lab30:;
+done:;
}
}
/* sec 0772 */
/* sec 0782 */
void get_preamble_token (void)
{
-lab20:
+restart:
get_token();
while ((cur_chr == span_code) && (cur_cmd == tab_mark))
if (cur_cmd == endv)
{
fatal_error("(interwoven alignment preambles are not allowed)");
- return; // abort_flag set
+ return;
}
if ((cur_cmd == assign_glue) && (cur_chr == glue_base + tab_skip_code))
else
eq_define(glue_base + tab_skip_code, glue_ref, cur_val);
- goto lab20;
+ goto restart;
}
}
/* sec 0774 */
cur_align = link(cur_align);
if (cur_cmd == car_ret)
- goto lab30;
+ goto done;
p = hold_head;
link(p) = 0;
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))
"\\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))
{
}
}
-lab31:
+done1:
link(cur_align) = new_null_box();
cur_align = link(cur_align);
info(cur_align) = end_span;
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)
{
"\\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();
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);
space_factor = 1000;
else
{
- cur_list.aux_field.cint = ignore_depth;
+ prev_depth = ignore_depth;
normal_paragraph();
}
if (mode == -hmode)
space_factor = 0;
else
- cur_list.aux_field.cint = 0;
+ prev_depth = 0;
tail_append(new_glue(glue_ptr(preamble)));
subtype(tail) = tab_skip_code + 1;
if (cur_group != align_group)
{
confusion("align1");
- return; // abort_flag set
+ return;
}
unsave();
if (cur_group != align_group)
{
confusion("align0");
- return; // abort_flag set
+ return;
}
unsave();
while (q != 0)
{
- if (!(q >= hi_mem_min))
+ if (!is_char_node(q))
if (type(q) == unset_node)
{
if (mode == -vmode)
r = link(link(r));
s = link(link(s));
}
- while(!(r == 0));
+ while (!(r == 0));
}
else if (type(q) == rule_node)
{
tail_append(new_penalty(post_display_penalty));
tail_append(new_param_glue(below_display_skip_code));
- cur_list.aux_field.cint = aux_save.cint;
+ prev_depth = aux_save.cint;
resume_after_display();
}
else
tail = q;
if (mode == vmode)
- {
build_page();
- }
}
}
-/* used to be align_peek, zfintieshrink, etc in old tex5.c */
-/************************************************************************/
-/* moved down here to avoid questions about pragma optimize */
-/* #pragma optimize("g", off) */
-/* for MC VS compiler */
-/* Moved down here 96/Oct/12 in response to problem with texerror.tex */
-/* pragma optimize("a", off) not strong enough - this may slow things */
/* sec 0791 */
-bool fin_col (void)
+boolean fin_col (void)
{
halfword p;
halfword q, r;
if (cur_align == 0)
{
confusion("endv");
- return 0; // abort_flag set
+ return 0;
}
q = link(cur_align);
if (q == 0)
{
confusion("endv");
- return 0; // abort_flag set
+ return 0;
}
if (align_state < 500000L)
{
fatal_error("(interwoven alignment preambles are not allowed)");
- return 0; // abort_flag set
+ return 0;
}
p = link(q);
if ((p == 0) && (extra_info(cur_align) < cr_code))
if (cur_loop != 0)
{
-/* potential problem here if new_null_box causes memory reallocation ??? */
-/* compiler optimization does not refresh `mem' loaded in registers ? */
link(q) = new_null_box();
p = link(q);
info(p) = end_span;
if (extra_info(cur_align) != span_code)
{
unsave();
-
new_save_level(align_group);
{
if (n > max_quarterword)
{
- confusion("256 spans"); /* 256 spans --- message wrong now, but ... */
- return 0; // abort_flag set
+ confusion("256 spans");
+ return 0;
}
q = cur_span;
scaled delta;
halfword p, v, x, y, z;
quarterword c;
- ffour_quarters i;
+ four_quarters i;
scaled shift_up, shift_down;
if ((subtype(q) == normal) && (cur_style < text_style))
p = new_hlist(q);
- if ((p >= hi_mem_min))
+ if (is_char_node(p))
{
shift_up = 0;
shift_down = 0;