summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/omegaware/odvicopy.ch
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/omegaware/odvicopy.ch')
-rw-r--r--Build/source/texk/web2c/omegaware/odvicopy.ch89
1 files changed, 62 insertions, 27 deletions
diff --git a/Build/source/texk/web2c/omegaware/odvicopy.ch b/Build/source/texk/web2c/omegaware/odvicopy.ch
index c502aa52483..7215b186642 100644
--- a/Build/source/texk/web2c/omegaware/odvicopy.ch
+++ b/Build/source/texk/web2c/omegaware/odvicopy.ch
@@ -32,7 +32,7 @@ procedure initialize; {this procedure gets things started properly}
@<Define |parse_arguments|@>
procedure initialize; {this procedure gets things started properly}
var @<Local variables for initialization@>@/
- begin
+ begin
kpse_set_progname (argv[0]);
parse_arguments;
print (banner); print_ln (version_string);
@@ -111,7 +111,7 @@ procedure initialize; {this procedure gets things started properly}
@d last_text_char=255 {ordinal number of the largest element of |text_char|}
@z
-@x [23] Remove non-local goto
+@x [23] Remove non-local goto, declare jump_out as noreturn
@d abort(#)==begin print_ln(' ',#,'.'); jump_out;
end
@@ -131,12 +131,24 @@ end;
@<Basic printing procedures@>@;
procedure close_files_and_terminate; forward;
@#
-procedure jump_out;
+noreturn procedure jump_out;
begin mark_fatal; close_files_and_terminate;
uexit(1);
end;
@z
+@x [24] Declare confusion as noreturn
+procedure confusion(@!p:pckt_pointer);
+@y
+noreturn procedure confusion(@!p:pckt_pointer);
+@z
+
+@x [25] Declare overflow as noreturn
+procedure overflow(@!p:pckt_pointer;@!n:int_16u);
+@y
+noreturn procedure overflow(@!p:pckt_pointer;@!n:int_16u);
+@z
+
@x [51] Fix casting problem in C.
@d comp_spair(#) == if a<128 then #:=a*256+b @+ else #:=(a-256)*256+b
@d comp_upair(#) == #:=a*256+b
@@ -193,9 +205,9 @@ To reduce the required changes we simply ignore the parameters given
to |make_font_name|.
@^system dependencies@>
-@d append_to_name(#)== begin
+@d append_to_name(#)== begin
cur_name[l_cur_name]:=#;
- incr(l_cur_name);
+ incr(l_cur_name);
end
@d make_font_name_end(#)==
make_name
@@ -204,7 +216,12 @@ to |make_font_name|.
@z
% [67] No conversion of filenames in lower case, and initialize and
-% terminate for C strings.
+% terminate for C strings. Eliminate now unused variable.
+@x
+@!c:char; {a character to be appended to |cur_name|}
+@y
+@z
+
@x
cur_loc:=pckt_start[n]; cur_limit:=pckt_start[n+1];
@y
@@ -243,7 +260,7 @@ the default \.{TFM} directory, which is a system-dependent place where
the \.{TFM} files for standard fonts are kept.
The string variable |TFM_default_area| contains the name of this area.
@^system dependencies@>
-
+
@d TFM_default_area_name=='TeXfonts:' {change this to the correct name}
@d OFM_default_area_name=='TeXfonts:' {change this to the correct name}
@d TFM_default_area_name_length=9 {change this to the correct length}
@@ -264,6 +281,18 @@ OFM_default_area:=OFM_default_area_name;
@ (No initialization to be done. Keep this module to preserve numbering.)
@z
+@x [94] Declare bad_tfm as noreturn
+procedure bad_tfm;
+@y
+noreturn procedure bad_tfm;
+@z
+
+@x [94] Declare bad_font as noreturn
+procedure bad_font;
+@y
+noreturn procedure bad_font;
+@z
+
@x [96] Open TFM file
@<TFM: Open |tfm_file|@>=
make_font_name(TFM_default_area_name_length)(TFM_default_area)(tfm_ext);
@@ -274,10 +303,6 @@ if eof(tfm_file) then begin
if eof(tfm_file) then
@^system dependencies@>
abort('---not loaded, TFM or OFM file can''t be opened!')
- else font_extend(cur_fnt):=true
-@.TFM or OFM file can\'t be opened@>
- end
-else font_extend(cur_fnt):=false
@y
|TFM_default_area_name_length| and |TFM_default_area| will not
be used by |make_font_name|.
@@ -289,7 +314,6 @@ if full_name then begin
resetbin (tfm_file, full_name);
free (cur_name);
free (full_name);
- font_extend(cur_fnt):=false
end
else begin
make_font_name(OFM_default_area_name_length)(OFM_default_area)(ofm_ext);
@@ -298,10 +322,8 @@ else begin
resetbin (tfm_file, full_name);
free (cur_name);
free (full_name);
- font_extend(cur_fnt):=true
end
else abort('---not loaded, TFM or OFM file can''t be opened!')
- end
@z
@x
@@ -338,6 +360,13 @@ else #:=(((tfm_b0-intcast(256))*intcast(256)+tfm_b1)
(((tfm_b0*intcast(256)+tfm_b1)*intcast(256)+tfm_b2)*intcast(256)+tfm_b3)
@z
+@x [103] Avoid compiler warnings
+read_tfm_word; tfm_b01(first_two);
+@y
+nco:=0; extra_words:=0;
+read_tfm_word; tfm_b01(first_two);
+@z
+
@x [109] Declare full_name.
@!dvi_loc:int_32; {where we are about to look, in |dvi_file|}
@y
@@ -345,6 +374,12 @@ else #:=(((tfm_b0-intcast(256))*intcast(256)+tfm_b1)
@!full_name: ^char;
@z
+@x [109] Declare bad_dvi as noreturn
+procedure bad_dvi;
+@y
+noreturn procedure bad_dvi;
+@z
+
@x [111] Fix up opening the binary files
@ To prepare |dvi_file| for input, we |reset| it.
@@ -393,7 +428,7 @@ the default \.{VF} directory, which is a system-dependent place where
the \.{VF} files for standard fonts are kept.
The string variable |VF_default_area| contains the name of this area.
@^system dependencies@>
-
+
@d VF_default_area_name=='TeXvfonts:' {change this to the correct name}
@d VF_default_area_name_length=10 {change this to the correct length}
@d OVF_default_area_name=='TeXvfonts:' {change this to the correct name}
@@ -410,7 +445,7 @@ OVF_default_area:=OVF_default_area_name;
@ If no font directory has been specified, \.{\title} is supposed to use
the default \.{VF} directory, which is a system-dependent place where
the \.{VF} files for standard fonts are kept.
-
+
Actually, under UNIX the standard area is defined in an external
file \.{site.h}. And the users have a path searched for fonts,
by setting the \.{VFFONTS} environment variable.
@@ -442,7 +477,7 @@ if full_name then begin
end
else begin
make_font_name(OVF_default_area_name_length)(OVF_default_area)(ovf_ext);
- full_name := kpse_find_ovf (cur_name);
+ full_name := kpse_find_ovf (cur_name);
if full_name then begin
resetbin (vf_file, full_name);
free (cur_name);
@@ -542,7 +577,7 @@ rewrite(out_file); {prepares to write packed bytes to |out_file|}
@x [250] String declaration.
@!comment:packed array[1..comm_length] of char; {preamble comment prefix}
@y
-@!comment:^char; {preamble comment prefix}
+@!comment:const_w2c_u_string; {preamble comment prefix}
@z
@x [251] Output the string from 0 to len-1, not 1 to len.
@@ -598,13 +633,13 @@ begin
end else if argument_is ('magnification') then begin
out_mag := atou (optarg);
-
+
end else if argument_is ('max-pages') then begin
max_pages := atou (optarg);
-
+
end else if argument_is ('page-start') then begin
@<Determine the desired |start_count| values from |optarg|@>;
-
+
end; {Else it was a flag; |getopt| has already done the assignment.}
until getopt_return_val = -1;
@@ -614,17 +649,17 @@ begin
dvi_file := make_binary_file (stdin);
out_file := make_binary_file (stdout);
term_out := stderr;
-
+
end else if optind + 1 = argc then begin
resetbin (dvi_file, extend_filename (cmdline (optind), 'dvi'));
out_file := make_binary_file (stdout);
term_out := stderr;
-
+
end else if optind + 2 = argc then begin
resetbin (dvi_file, extend_filename (cmdline (optind), 'dvi'));
rewritebin (out_file, extend_filename (cmdline (optind + 1), 'dvi'));
term_out := stdout;
-
+
end else begin
write_ln (stderr, 'odvicopy: Need at most two file arguments.');
usage ('odvicopy');
@@ -682,7 +717,7 @@ long_options[current_option].flag := 0;
long_options[current_option].val := 0;
incr (current_option);
-@ Parsing the starting page specification is a bit complicated.
+@ Parsing the starting page specification is a bit complicated.
(This is the same as in \.{DVItype}.)
@<Determine the desired |start_count|...@> =
@@ -692,7 +727,7 @@ while optarg[m] do begin
if optarg[m] = "*" then begin
start_there[k] := false;
incr (m);
-
+
end else if optarg[m] = "." then begin
incr (k);
if k >= 10 then begin
@@ -700,7 +735,7 @@ while optarg[m] do begin
uexit (1);
end;
incr (m);
-
+
end else begin
start_count[k] := strtol (optarg + m, address_of (end_num), 10);
if end_num = optarg + m then begin