halfword r;
halfword prev_r;
halfword old_l;
- bool no_break_yet;
+ boolean no_break_yet;
halfword prev_prev_r;
halfword s;
halfword q;
integer t;
internal_font_number f;
halfword l;
- bool node_r_stays_active;
+ boolean node_r_stays_active;
scaled line_width;
char fit_class;
- halfword b; /* current badness */
+ halfword b;
integer d;
- bool artificial_demerits;
+ boolean artificial_demerits;
halfword save_link;
scaled shortfall;
prev_r = active;
old_l = 0;
do_all_six(copy_to_cur_active);
-/*
- cur_active_width[1] = active_width[1];
- cur_active_width[2] = active_width[2];
- cur_active_width[3] = active_width[3];
- cur_active_width[4] = active_width[4];
- cur_active_width[5] = active_width[5];
- cur_active_width[6] = active_width[6];
-*/
+
while (true)
{
lab22:
if (type(r) == delta_node)
{
do_all_six(update_width);
-/*
- cur_active_width[1] = cur_active_width[1] + mem[r + 1].cint;
- cur_active_width[2] = cur_active_width[2] + mem[r + 2].cint;
- cur_active_width[3] = cur_active_width[3] + mem[r + 3].cint;
- cur_active_width[4] = cur_active_width[4] + mem[r + 4].cint;
- cur_active_width[5] = cur_active_width[5] + mem[r + 5].cint;
- cur_active_width[6] = cur_active_width[6] + mem[r + 6].cint;
-*/
prev_prev_r = prev_r;
prev_r = r;
goto lab22;
{
no_break_yet = false;
do_all_six(set_break_width_to_background);
-/*
- break_width[1] = background[1];
- break_width[2] = background[2];
- break_width[3] = background[3];
- break_width[4] = background[4];
- break_width[5] = background[5];
- break_width[6] = background[6];
-*/
s = cur_p;
if (break_type > unhyphenated)
decr(t);
v = link(v);
- if ((v >= hi_mem_min))
+ if (is_char_node(v))
{
f = font(v);
break_width[1] = break_width[1] - char_width(f, char_info(f, character(v)));
default:
{
confusion("disc1");
- return; // abort_flag set
+ return;
}
break;
}
while (s != 0)
{
- if ((s >= hi_mem_min))
+ if (is_char_node(s))
{
f = font(s);
break_width[1] = break_width[1] + char_width(f, char_info(f, character(s)));
while (s != 0)
{
- if ((s >= hi_mem_min))
+ if (is_char_node(s))
goto lab30;
switch (type(s))
if (type(prev_r) == delta_node)
{
do_all_six(convert_to_break_width);
-/*
- mem[prev_r + 1].cint = mem[prev_r + 1].cint - cur_active_width[1] + break_width[1];
- mem[prev_r + 2].cint = mem[prev_r + 2].cint - cur_active_width[2] + break_width[2];
- mem[prev_r + 3].cint = mem[prev_r + 3].cint - cur_active_width[3] + break_width[3];
- mem[prev_r + 4].cint = mem[prev_r + 4].cint - cur_active_width[4] + break_width[4];
- mem[prev_r + 5].cint = mem[prev_r + 5].cint - cur_active_width[5] + break_width[5];
- mem[prev_r + 6].cint = mem[prev_r + 6].cint - cur_active_width[6] + break_width[6];
-*/
}
else if (prev_r == active)
{
do_all_six(store_break_width);
-/*
- active_width[1] = break_width[1];
- active_width[2] = break_width[2];
- active_width[3] = break_width[3];
- active_width[4] = break_width[4];
- active_width[5] = break_width[5];
- active_width[6] = break_width[6];
-*/
}
else
{
type(q) = delta_node;
subtype(q) = 0;
do_all_six(new_delta_to_break_width);
-/*
- mem[q + 1].cint = break_width[1]- cur_active_width[1];
- mem[q + 2].cint = break_width[2]- cur_active_width[2];
- mem[q + 3].cint = break_width[3]- cur_active_width[3];
- mem[q + 4].cint = break_width[4]- cur_active_width[4];
- mem[q + 5].cint = break_width[5]- cur_active_width[5];
- mem[q + 6].cint = break_width[6]- cur_active_width[6];
-*/
link(prev_r) = q;
prev_prev_r = prev_r;
prev_r = q;
#ifdef STAT
incr(pass_number);
serial(q) = pass_number;
-#endif /* STAT */
+#endif
prev_break(q) = best_place[fit_class];
q = get_node(active_node_size);
break_node(q) = passive;
type(q) = delta_node;
subtype(q) = 0;
do_all_six(new_delta_from_break_width);
-/*
- mem[q + 1].cint = cur_active_width[1] - break_width[1];
- mem[q + 2].cint = cur_active_width[2] - break_width[2];
- mem[q + 3].cint = cur_active_width[3] - break_width[3];
- mem[q + 4].cint = cur_active_width[4] - break_width[4];
- mem[q + 5].cint = cur_active_width[5] - break_width[5];
- mem[q + 6].cint = cur_active_width[6] - break_width[6];
-*/
link(prev_r) = q;
prev_prev_r = prev_r;
prev_r = q;
{
do_all_six(update_active);
do_all_six(copy_to_cur_active);
-/*
- active_width[1] = active_width[1] + mem[r + 1].cint;
- active_width[2] = active_width[2] + mem[r + 2].cint;
- active_width[3] = active_width[3] + mem[r + 3].cint;
- active_width[4] = active_width[4] + mem[r + 4].cint;
- active_width[5] = active_width[5] + mem[r + 5].cint;
- active_width[6] = active_width[6] + mem[r + 6].cint;
- cur_active_width[1] = active_width[1];
- cur_active_width[2] = active_width[2];
- cur_active_width[3] = active_width[3];
- cur_active_width[4] = active_width[4];
- cur_active_width[5] = active_width[5];
- cur_active_width[6] = active_width[6];
-*/
link(active) = link(r);
free_node(r, delta_node_size);
}
if (r == active)
{
do_all_six(downdate_width);
-/*
- cur_active_width[1] = cur_active_width[1] - mem[prev_r + 1].cint;
- cur_active_width[2] = cur_active_width[2] - mem[prev_r + 2].cint;
- cur_active_width[3] = cur_active_width[3] - mem[prev_r + 3].cint;
- cur_active_width[4] = cur_active_width[4] - mem[prev_r + 4].cint;
- cur_active_width[5] = cur_active_width[5] - mem[prev_r + 5].cint;
- cur_active_width[6] = cur_active_width[6] - mem[prev_r + 6].cint;
-*/
link(prev_prev_r) = active;
free_node(prev_r, delta_node_size);
prev_r = prev_prev_r;
{
do_all_six(update_width);
do_all_six(combine_two_deltas);
-/*
- cur_active_width[1] = cur_active_width[1] + mem[r + 1].cint;
- cur_active_width[2] = cur_active_width[2] + mem[r + 2].cint;
- cur_active_width[3] = cur_active_width[3] + mem[r + 3].cint;
- cur_active_width[4] = cur_active_width[4] + mem[r + 4].cint;
- cur_active_width[5] = cur_active_width[5] + mem[r + 5].cint;
- cur_active_width[6] = cur_active_width[6] + mem[r + 6].cint;
- mem[prev_r + 1].cint = mem[prev_r + 1].cint + mem[r + 1].cint;
- mem[prev_r + 2].cint = mem[prev_r + 2].cint + mem[r + 2].cint;
- mem[prev_r + 3].cint = mem[prev_r + 3].cint + mem[r + 3].cint;
- mem[prev_r + 4].cint = mem[prev_r + 4].cint + mem[r + 4].cint;
- mem[prev_r + 5].cint = mem[prev_r + 5].cint + mem[r + 5].cint;
- mem[prev_r + 6].cint = mem[prev_r + 6].cint + mem[r + 6].cint;
-*/
link(prev_r) = link(r);
free_node(r, delta_node_size);
}
}
}
#endif /* STAT */
-/* must exit here, there are no internal return - except for confusion */
-/* savedbadness = b; */ /* 96/Feb/9 - for test in itex.c */
}
/* end of the old tex5.c here */
/* sec 0877 */
void post_line_break_(integer final_widow_penalty)
{
halfword q, r, s;
- bool disc_break;
- bool post_disc_break;
+ boolean disc_break;
+ boolean post_disc_break;
scaled cur_width;
scaled cur_indent;
quarterword t;
if (q == cur_break(cur_p))
goto lab31;
- if ((q >= hi_mem_min))
+ if (is_char_node(q))
goto lab31;
if (non_discardable(q))
{
halfword p;
halfword t;
- ffourquarters q;
+ four_quarters q;
halfword cur_rh;
halfword test_char;
scaled w;
if (ligature_present)
lft_hit = init_lft;
- while(p != 0) /* 94/Mar/22 BUG FIX */
+ while (p != 0) /* 94/Mar/22 BUG FIX */
{
append_charnode_to_t(character(p));
p = link(p);
{
k = bchar_label[hf];
- if (k == non_address) /* i.e. 0 --- 96/Jan/15 */
+ if (k == non_address)
goto lab30;
else
q = font_info[k].qqqq;
q = font_info[k].qqqq;
}
}
+
if (cur_rh < non_char)
test_char = cur_rh;
else
if (lig_stack == 0)
rt_hit = true;
- {
- if (interrupt != 0)
- {
- pause_for_instructions();
- }
- }
+ check_interrupt();
switch (op_byte(q))
{
{
if (ligature_present)
{
- p = new_ligature(hf, cur_l, mem[cur_q].hh.v.RH);
+ p = new_ligature(hf, cur_l, mem[cur_q].hh.rh);
if (lft_hit)
{
mem[p].hh.b1 = 2;
lft_hit = false;
}
-/* if (false)
- if (lig_stack == 0){
- incr(mem[p].hh.b1);
- rt_hit = false;
- } */ /* removed 99/Jan/6 */
- mem[cur_q].hh.v.RH = p;
+
+ mem[cur_q].hh.rh = p;
t = p;
ligature_present = false;
}
if (lig_stack != 0) /* BUG FIX */
{
- if (mem[lig_stack + 1].hh.v.RH != 0) /* l.17828 ? */
+ if (mem[lig_stack + 1].hh.rh != 0) /* l.17828 ? */
{
- mem[t].hh.v.RH = mem[lig_stack + 1].hh.v.RH;
- t = mem[t].hh.v.RH;
+ mem[t].hh.rh = mem[lig_stack + 1].hh.rh;
+ t = mem[t].hh.rh;
incr(j);
}
p = lig_stack;
- lig_stack = mem[p].hh.v.RH;
+ lig_stack = mem[p].hh.rh;
free_node(p, 2);
if (lig_stack == 0) /* if lig_stack=null ? */
{
incr(j);
incr(u);
}
- while(!(j > hn));
+ while (!(j > hn));
s = hyph_list[h];
while (s != 0)
{
- hyf[mem[s].hh.v.LH] = 1;
- s = mem[s].hh.v.RH;
+ hyf[info(s)] = 1;
+ s = link(s);
}
decr(hn);
goto lab40;
}
+
lab30:;
if (h > 0)
decr(h);
v = hyf_next[v];
}
- while(!(v == min_trie_op));
+ while (!(v == min_trie_op));
}
incr(l);
link(ha) = 0;
bchar = hyfbchar;
- if ((ha >= hi_mem_min))
+ if (is_char_node(ha))
if (font(ha) != hf)
goto lab42;
else
init_lig = false;
}
- free_node(ha, small_node_size);
+ free_node(ha, small_node_size);
}
else
{
- if (!(r >= hi_mem_min))
+ if (!is_char_node(r))
if (type(r) == ligature_node)
if (subtype(r) > 1)
goto lab42;
major_tail = r;
r_count = 0;
- while (mem[major_tail].hh.v.RH != 0)
+ while (mem[major_tail].hh.rh != 0)
{
major_tail = link(major_tail);
incr(r_count);
j = reconstitute(j, hn, bchar, non_char) + 1;
link(major_tail) = link(hold_head);
- while (mem[major_tail].hh.v.RH != 0)
+ while (mem[major_tail].hh.rh != 0)
{
major_tail = link(major_tail);
incr(r_count);
hyphen_passed = j - 1;
link(hold_head) = 0;
}
- while(!(! odd(hyf[j - 1])));
+ while (!(! odd(hyf[j - 1])));
}
- while(!(j > hn));
+ while (!(j > hn));
link(s) = q;
flush_list(init_list);
if (hyph_count == hyphen_prime)
{
overflow("exception dictionary", hyphen_prime); /* exception dictionary - NOT DYNAMIC */
- /* not dynamic ---- but can be set -e=... from command line in ini-TeX */
- return; // abort_flag set
+ return;
}
incr(hyph_count);
incr(u);
incr(v);
}
- while(!(u == str_start[k + 1]));
+ while (!(u == str_start[k + 1]));
lab40:
q = hyph_list[h];
hyph_list[h] = p;
prev_p = temp_head;
link(temp_head) = p;
- while(p != 0)
+ while (p != 0)
switch(type(p))
{
case hlist_node:
least_cost = awful_bad;
do_all_six(set_height_zero);
-/*
- active_width[1] = 0;
- active_width[2] = 0;
- active_width[3] = 0;
- active_width[4] = 0;
- active_width[5] = 0;
- active_width[6] = 0;
-*/
prev_dp = 0;
while (true)
b = 0;
else
b = badness(h - cur_height, active_width[2]);
- else if (active_width[1] - h > active_width[6])
- b = awful_bad;
else
- b = badness(cur_height - h, active_width[6]);
+ if (act_width - h > active_width[6])
+ b = awful_bad;
+ else
+ b = badness(cur_height - h, active_width[6]);
if (b < awful_bad)
if (pi <= eject_penalty)
b = pi;
- else if (b < inf_bad)
- b = b + pi;
else
- b = deplorable;
+ if (b < inf_bad)
+ b = b + pi;
+ else
+ b = deplorable;
if (b <= least_cost)
{
prev_p = p;
p = link(prev_p);
}
+
lab30:
return best_place;
}
page_max_depth = max_depth;
page_depth = 0;
do_all_six(set_page_so_far_zero);
-/*
- page_so_far[1] = 0;
- page_so_far[2] = 0;
- page_so_far[3] = 0;
- page_so_far[4] = 0;
- page_so_far[5] = 0;
- page_so_far[6] = 0;
-*/
least_page_cost = awful_bad;
+
#ifdef STAT
if (tracing_pages > 0)
{
print_scaled(page_max_depth);
end_diagnostic(false);
}
-#endif /* STAT */
+#endif
}
/* sec 0992 */
void box_error_(eight_bits n)
/* sec 1012 */
void fire_up_(halfword c)
{
- halfword p, q, r, s;
- halfword prev_p;
+ pointer p, q, r, s;
+ pointer prev_p;
/* unsigned char n; */
unsigned int n; /* 95/Jan/7 */
- bool wait;
+ boolean wait;
integer save_vbadness;
scaled save_vfuzz;
- halfword save_split_top_skip;
+ pointer save_split_top_skip;
if (type(best_page_break) == penalty_node)
{