summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-01-13 07:35:45 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-01-13 07:35:45 +0000
commitb83822f4ed06282c5c503ef4cf2534646208090a (patch)
tree5a35926163a1d7b53e725478b69c776eb401a9c3 /Build/source/texk
parent8cf3c492f65da822e1acf372ed64ca50a202ac00 (diff)
texk/web2c: Use ^byte and alloc_array() in TFtoPL, VFtoVF & Co
Drop casttobytepointer and pointertobyte git-svn-id: svn://tug.org/texlive/trunk@36045 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/web2c/ChangeLog5
-rw-r--r--Build/source/texk/web2c/cpascal.h4
-rw-r--r--Build/source/texk/web2c/omegaware/ChangeLog4
-rw-r--r--Build/source/texk/web2c/omegaware/ofm2opl.ch7
-rw-r--r--Build/source/texk/web2c/omegaware/ovf2ovp.ch7
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/ptexdir/ptftopl.ch8
-rw-r--r--Build/source/texk/web2c/tftopl.ch7
-rw-r--r--Build/source/texk/web2c/vftovp.ch7
-rw-r--r--Build/source/texk/web2c/web2c/ChangeLog4
-rw-r--r--Build/source/texk/web2c/web2c/common.defines2
11 files changed, 33 insertions, 26 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 9a2dfcbf843..388b86de177 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * tftopl.ch, vftovp.ch: Use ^byte and x*alloc_array().
+ * cpascal.h: Remove casttobytepointer and pointertobyte.
+
2015-01-10 Peter Breitenlohner <peb@mppmu.mpg.de>
* tftopl.ch: Non-zero return code in case of problems.
diff --git a/Build/source/texk/web2c/cpascal.h b/Build/source/texk/web2c/cpascal.h
index 785f81a4e23..903ebfdfa21 100644
--- a/Build/source/texk/web2c/cpascal.h
+++ b/Build/source/texk/web2c/cpascal.h
@@ -142,10 +142,6 @@ typedef FILE *text;
#define aopenout(f) open_output (&(f), FOPEN_W_MODE)
#define aclose close_file
-/* For faking arrays in tftopl. */
-typedef unsigned char *pointertobyte;
-#define casttobytepointer(e) ((pointertobyte) e)
-
/* How to output to the GF or DVI file. */
#define WRITE_OUT(a, b) \
if ((size_t) fwrite ((char *) &OUT_BUF[a], sizeof (OUT_BUF[a]), \
diff --git a/Build/source/texk/web2c/omegaware/ChangeLog b/Build/source/texk/web2c/omegaware/ChangeLog
index 3a0dd8fa86e..38514dc1c7b 100644
--- a/Build/source/texk/web2c/omegaware/ChangeLog
+++ b/Build/source/texk/web2c/omegaware/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ofm2opl.ch, ovf2ovp.ch: Use ^byte and x*alloc_array().
+
2015-01-11 Peter Breitenlohner <peb@mppmu.mpg.de>
* ovf2ovp.ch: Send diagnostic messages to stderr.
diff --git a/Build/source/texk/web2c/omegaware/ofm2opl.ch b/Build/source/texk/web2c/omegaware/ofm2opl.ch
index 87aa1eee957..181a5b04d64 100644
--- a/Build/source/texk/web2c/omegaware/ofm2opl.ch
+++ b/Build/source/texk/web2c/omegaware/ofm2opl.ch
@@ -68,7 +68,7 @@ procedure initialize; {this procedure gets things started properly}
kpse_init_prog ('OFM2OPL', 0, nil, nil);
{We |xrealloc| when we know how big the file is. The 1000 comes
from the negative lower bound.}
- tfm_file_array := cast_to_byte_pointer (xmalloc (1009));
+ tfm_file_array := xmalloc_array (byte, 1008);
parse_arguments;
@z
@@ -136,7 +136,7 @@ end;
{Kludge here to define |tfm| as a macro which takes care of the negative
lower bound. We've defined |tfm| for the benefit of web2c above.}
@=#define tfm (tfmfilearray + 1001);@>@\
-@!tfm_file_array: pointer_to_byte; {the input data all goes here}
+@!tfm_file_array: ^byte; {the input data all goes here}
@z
% [21] abort() should cause a bad exit code.
@@ -156,8 +156,7 @@ end;
if 4*lf-1>tfm_size then abort('The file is bigger than I can handle!');
@.The file is bigger...@>
@y
-tfm_file_array
- := cast_to_byte_pointer (xrealloc (tfm_file_array, 4 * lf - 1 + 1002));
+tfm_file_array := xrealloc_array (tfm_file_array, byte, 4 * lf + 1000);
@z
% [28, 29] Change strings to C char pointers. The Pascal strings are
diff --git a/Build/source/texk/web2c/omegaware/ovf2ovp.ch b/Build/source/texk/web2c/omegaware/ovf2ovp.ch
index 888fe27ce01..84df6150450 100644
--- a/Build/source/texk/web2c/omegaware/ovf2ovp.ch
+++ b/Build/source/texk/web2c/omegaware/ovf2ovp.ch
@@ -58,7 +58,7 @@ procedure initialize; {this procedure gets things started properly}
kpse_init_prog ('VFTOVP', 0, nil, nil);
{We |xrealloc| when we know how big the file is. The 1000 comes
from the negative lower bound.}
- tfm_file_array := cast_to_byte_pointer (xmalloc (1009));
+ tfm_file_array := xmalloc_array (byte, 1008);
parse_arguments;
@z
@@ -143,7 +143,7 @@ end;
{Kludge here to define |tfm| as a macro which takes care of the negative
lower bound. We've defined |tfm| for the benefit of web2c above.}
@=#define tfm (tfmfilearray + 1001);@>@\
-@!tfm_file_array: pointer_to_byte; {the input data all goes here}
+@!tfm_file_array: ^byte; {the input data all goes here}
@z
% [25] abort() should cause a bad exit code.
@@ -163,8 +163,7 @@ end;
if 4*lf-1>tfm_size then abort('The file is bigger than I can handle!');
@.The file is bigger...@>
@y
-tfm_file_array
- := cast_to_byte_pointer (xrealloc (tfm_file_array, 4 * lf - 1 + 1002));
+tfm_file_array := xrealloc_array (tfm_file_array, byte, 4 * lf + 1000);
@z
% [31] Ditto for vf_abort.
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index 0afc80cd4ac..9178981ae70 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ptftopl.ch: Use ^byte and xmalloc_array().
+
2014-12-12 Peter Breitenlohner <peb@mppmu.mpg.de>
* ptriptest: Complain early if trip.fmt is not created.
diff --git a/Build/source/texk/web2c/ptexdir/ptftopl.ch b/Build/source/texk/web2c/ptexdir/ptftopl.ch
index 57dffda83d0..302b2d2f69c 100644
--- a/Build/source/texk/web2c/ptexdir/ptftopl.ch
+++ b/Build/source/texk/web2c/ptexdir/ptftopl.ch
@@ -26,9 +26,9 @@ var @!k:integer; {all-purpose initiallization index}
@z
@x [2] l.97 - pTeX:
- tfm_file_array := cast_to_byte_pointer (xmalloc (1003));
+ tfm_file_array := xmalloc_array (byte, 1002);
@y
- tfm_file_array := cast_to_byte_pointer (xmalloc (1003+4));
+ tfm_file_array := xmalloc_array (byte, 1002 + 4);
@z
@x
@@ -57,9 +57,9 @@ var @!k:integer; {all-purpose initiallization index}
@z
@x [18.20] l.448 - pTeX:
-@!tfm_file_array: pointer_to_byte; {the input data all goes here}
+@!tfm_file_array: ^byte; {the input data all goes here}
@y
-@!tfm_file_array: pointer_to_byte; {the input data all goes here}
+@!tfm_file_array: ^byte; {the input data all goes here}
@!file_format:tfm_format..vfm_format; {format of tfm file}
@!nt:0..@'77777; {number of words in the character type table}
@!ng:0..@'77777; {number of words in the glue table}
diff --git a/Build/source/texk/web2c/tftopl.ch b/Build/source/texk/web2c/tftopl.ch
index 3287df32fc5..f2fa5894633 100644
--- a/Build/source/texk/web2c/tftopl.ch
+++ b/Build/source/texk/web2c/tftopl.ch
@@ -66,7 +66,7 @@ procedure initialize; {this procedure gets things started properly}
kpse_init_prog ('TFTOPL', 0, nil, nil);
{We |xrealloc| when we know how big the file is. The 1000 comes
from the negative lower bound.}
- tfm_file_array := cast_to_byte_pointer (xmalloc (1003));
+ tfm_file_array := xmalloc_array (byte, 1002);
parse_arguments;
@z
@@ -141,15 +141,14 @@ end;
{Kludge here to define |tfm| as a macro which takes care of the negative
lower bound. We've defined |tfm| for the benefit of web2c above.}
@=#define tfm (tfmfilearray + 1001);@>@\
-@!tfm_file_array: pointer_to_byte; {the input data all goes here}
+@!tfm_file_array: ^byte; {the input data all goes here}
@z
@x [20] Allow arbitrarily large input files.
if 4*lf-1>tfm_size then abort('The file is bigger than I can handle!');
@.The file is bigger...@>
@y
-tfm_file_array
- := cast_to_byte_pointer (xrealloc (tfm_file_array, 4 * lf - 1 + 1002));
+tfm_file_array := xrealloc_array (tfm_file_array, byte, 4 * lf + 1000);
@z
% [27, 28] Change strings to C char pointers. The Pascal strings are
diff --git a/Build/source/texk/web2c/vftovp.ch b/Build/source/texk/web2c/vftovp.ch
index ad8325205ab..dd523e5ffbb 100644
--- a/Build/source/texk/web2c/vftovp.ch
+++ b/Build/source/texk/web2c/vftovp.ch
@@ -52,7 +52,7 @@ procedure initialize; {this procedure gets things started properly}
kpse_init_prog ('VFTOVP', 0, nil, nil);
{We |xrealloc| when we know how big the file is. The 1000 comes
from the negative lower bound.}
- tfm_file_array := cast_to_byte_pointer (xmalloc (1003));
+ tfm_file_array := xmalloc_array (byte, 1002);
parse_arguments;
@z
@@ -139,7 +139,7 @@ end;
{Kludge here to define |tfm| as a macro which takes care of the negative
lower bound. We've defined |tfm| for the benefit of web2c above.}
@=#define tfm (tfmfilearray + 1001);@>@\
-@!tfm_file_array: pointer_to_byte; {the input data all goes here}
+@!tfm_file_array: ^byte; {the input data all goes here}
@z
% [24] abort() should cause a bad exit code.
@@ -159,8 +159,7 @@ end;
if 4*lf-1>tfm_size then abort('The file is bigger than I can handle!');
@.The file is bigger...@>
@y
-tfm_file_array
- := cast_to_byte_pointer (xrealloc (tfm_file_array, 4 * lf - 1 + 1002));
+tfm_file_array := xrealloc_array (tfm_file_array, byte, 4 * lf + 1000);
@z
% [31] Ditto for vf_abort.
diff --git a/Build/source/texk/web2c/web2c/ChangeLog b/Build/source/texk/web2c/web2c/ChangeLog
index 15c7b6ac10e..87ebc2ab88b 100644
--- a/Build/source/texk/web2c/web2c/ChangeLog
+++ b/Build/source/texk/web2c/web2c/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * common.defines: Remove casttobytepointer and pointertobyte.
+
2014-11-06 Peter Breitenlohner <peb@mppmu.mpg.de>
* configure.ac: Add AC_CHECK_SIZEOF([long]),
diff --git a/Build/source/texk/web2c/web2c/common.defines b/Build/source/texk/web2c/web2c/common.defines
index af0543a0514..a729af03720 100644
--- a/Build/source/texk/web2c/web2c/common.defines
+++ b/Build/source/texk/web2c/web2c/common.defines
@@ -103,7 +103,6 @@
@define function atou ();
@define function basename ();
@define function basenamechangesuffix ();
-@define function casttobytepointer ();
@define function chartostring ();
@define function chr ();
@define function cmdline ();
@@ -211,7 +210,6 @@
@define type integer64;
@define type longinteger;
@define type memoryword; {for gftodvi, TeX, and Metafont}
-@define type pointertobyte;
@define type real;
@define type text;
@define type w2custring;