summaryrefslogtreecommitdiff
path: root/Build/source/texk/dviljk
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-06-22 14:28:06 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-06-22 14:28:06 +0000
commitc8d9f4e6e363278ea526a41708c91b665d4cb8ed (patch)
tree1f2be51359daa79f3f0ec9a0c1ec0c049abca172 /Build/source/texk/dviljk
parentbab99def57f5138d7f4274bd198166f8bd57a3c3 (diff)
use ANSI C function declarations and prototypes
git-svn-id: svn://tug.org/texlive/trunk@13882 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dviljk')
-rw-r--r--Build/source/texk/dviljk/ChangeLog7
-rw-r--r--Build/source/texk/dviljk/config.h10
-rw-r--r--Build/source/texk/dviljk/dvi2xx.c348
-rw-r--r--Build/source/texk/dviljk/dvi2xx.h120
-rw-r--r--Build/source/texk/dviljk/tfm.c40
-rw-r--r--Build/source/texk/dviljk/tfm.h4
6 files changed, 67 insertions, 462 deletions
diff --git a/Build/source/texk/dviljk/ChangeLog b/Build/source/texk/dviljk/ChangeLog
index 568a3b4f74b..d2000373be0 100644
--- a/Build/source/texk/dviljk/ChangeLog
+++ b/Build/source/texk/dviljk/ChangeLog
@@ -1,5 +1,12 @@
2009-06-18 Peter Breitenlohner <peb@mppmu.mpg.de>
+ * config.h, dvi2xx.c, dvi2xx.h, tfm.c, tfm.h:
+ always use ANSI C function definitions and prototypes.
+ * dvi2xx.c (getnyb, pk_packed_num): declare as static.
+ * dvi2xx.h: #include <stdarg.h>, not <kpathsea/c-vararg.h>.
+
+2009-06-18 Peter Breitenlohner <peb@mppmu.mpg.de>
+
* Makefile.am (AM_CFLAGS): enable compiler warnings.
* dvi2xx.c: #include "tfm.h".
(getnum, setOffset, TryResident): declare as static.
diff --git a/Build/source/texk/dviljk/config.h b/Build/source/texk/dviljk/config.h
index bfbe22fbf51..97af49738fd 100644
--- a/Build/source/texk/dviljk/config.h
+++ b/Build/source/texk/dviljk/config.h
@@ -203,17 +203,7 @@ typedef SCHAR_TYPE signed_char;
# define long4 long
#endif
-#ifdef __STDC__
-#define NeedFunctionPrototypes 1
#include <stdarg.h>
-#else
-#define NeedFunctionPrototypes 0
-#include <varargs.h>
-#endif
-
-#if NeedFunctionPrototypes
-#define NeedVarargsPrototypes 1
-#endif
#ifndef KPATHSEA
#error "Would need changed findfile, dviljk has changed allocation semantic of name member in tfontptr"
diff --git a/Build/source/texk/dviljk/dvi2xx.c b/Build/source/texk/dviljk/dvi2xx.c
index e986b5de2b3..31095f26c86 100644
--- a/Build/source/texk/dviljk/dvi2xx.c
+++ b/Build/source/texk/dviljk/dvi2xx.c
@@ -127,13 +127,7 @@ unsigned char c;
/******************************* main *******************************/
/**********************************************************************/
int
-#if NeedFunctionPrototypes
main(int argc, char *argv[])
-#else
-main(argc, argv)
-int argc;
-char *argv[];
-#endif
{
struct stack_entry { /* stack entry */
long4 h, v, w, x, y, z; /* what's on stack */
@@ -655,12 +649,7 @@ char *argv[];
/* read a buffered byte */
char
-#if NeedFunctionPrototypes
b_read(FILEPTR spfp)
-#else
-b_read(spfp)
-FILEPTR spfp;
-#endif
{
if (biact >= binumber) {
#ifdef RISC_USE_OSL
@@ -675,13 +664,7 @@ FILEPTR spfp;
#ifdef RISC_BUFFER
void
-#if NeedFunctionPrototypes
b_write(FILEPTR spfp, char c) /* write a buffered byte */
-#else
-b_write(spfp, c)
-FILEPTR spfp;
-char c;
-#endif
{
if (boact >= BUFFSIZE) {
write_multi(buffout,1,BUFFSIZE,spfp);
@@ -691,14 +674,7 @@ char c;
}
void
-#if NeedFunctionPrototypes
b_wrtmult(FILEPTR spfp, char *buf, int len) /* write a sequence of bytes to the output buffer */
-#else
-b_wrtmult(spfp, buf, len)
-FILEPTR spfp;
-char *buf;
-int len;
-#endif
{
register int i;
@@ -722,12 +698,7 @@ int len;
/* flush the output buffer */
void
-#if NeedFunctionPrototypes
b_oflush(FILEPTR spfp)
-#else
-b_oflush(spfp)
-FILEPTR spfp;
-#endif
{
write_multi(buffout,1,boact,spfp);
boact = 0;
@@ -741,12 +712,7 @@ FILEPTR spfp;
/***************************** CopyFile ******************************/
/*********************************************************************/
void
-#if NeedFunctionPrototypes
CopyFile(char *str )
-#else
-CopyFile( str )
-char *str;
-#endif
{
FILEPTR spfp;
int todo;
@@ -778,13 +744,7 @@ char *str;
/***************************** CopyHPFile ******************************/
/*********************************************************************/
static int
-#if NeedFunctionPrototypes
getnum(FILEPTR spfp, char *t, char *numstr)
-#else
-getnum(spfp, t, numstr)
-FILEPTR spfp;
-char *t, *numstr;
-#endif
{
int count=0;
for (*t = (char)b_read(spfp); *t<0x40; *t = (char)b_read(spfp))
@@ -794,13 +754,7 @@ char *t, *numstr;
}
static void
-#if NeedFunctionPrototypes
setOffset(char dir, char sign, int pos)
-#else
-setOffset(dir, sign, pos)
-char dir, sign;
-int pos;
-#endif
{
if ((sign == '+' || sign == '-') && pos > 0 ) {
EMIT4("\033*p%c%d%c",sign,pos,dir);
@@ -826,12 +780,7 @@ int pos;
void
-#if NeedFunctionPrototypes
CopyHPFile(char *str )
-#else
-CopyHPFile( str )
-char *str;
-#endif
{
FILEPTR spfp;
char t,numstr[20];
@@ -1065,11 +1014,7 @@ char *str;
/* This function closes all open files */
void
-#if NeedFunctionPrototypes
CloseFiles(void)
-#else
-CloseFiles()
-#endif
{
struct font_entry *fe;
FILEPTR f;
@@ -1105,13 +1050,7 @@ CloseFiles()
/*************************** NoSignExtend ***************************/
/**********************************************************************/
long4
-#if NeedFunctionPrototypes
NoSignExtend(FILEPTR fp, register int n)
-#else
-NoSignExtend(fp, n) /* return n byte quantity from file fd */
-register FILEPTR fp; /* file pointer */
-register int n; /* number of bytes */
-#endif
{
long4 x = 0; /* number being constructed */
unsigned char h;
@@ -1135,13 +1074,7 @@ long4 extendTab[5] = {0,~0^0xff,~0^0xffff,~0^0xffffff,~0^0xffffffff};
/**************************** SignExtend ****************************/
/**********************************************************************/
long4
-#if NeedFunctionPrototypes
SignExtend(FILEPTR fp, register int n)
-#else
-SignExtend(fp, n) /* return n byte quantity from file fd */
-register FILEPTR fp; /* file pointer */
-register int n; /* number of bytes */
-#endif
{
int n1; /* number of bytes */
long4 x; /* number being constructed */
@@ -1214,13 +1147,7 @@ register int n; /* number of bytes */
favourable to collect as many PMP commands as possible in one envelope. */
/*****************************************************************************/
void
-#if NeedFunctionPrototypes
PMPout(int l, char *s)
-#else
-PMPout(l, s)
-int l;
-char *s;
-#endif
{
static char buffer[OUTBUFSIZE];
static unsigned short bp = 0; /* range 0..OUTBUFSIZE */
@@ -1261,12 +1188,7 @@ char *s;
void
-#if NeedFunctionPrototypes
PMPoutC(char c)
-#else
-PMPoutC(c)
-char c;
-#endif
{
PMPout(1, &c);
}
@@ -1286,12 +1208,7 @@ char c;
/* useless. (Background: MSDOS 3.2 Technical Reference upd 1 pg 6-137 */
/**********************************************************************/
void
-#if NeedFunctionPrototypes
AssureBinary(FILEPTR f)
-#else
-AssureBinary(f)
-FILEPTR f;
-#endif
{
union REGS regs; /* registers for bios call */
@@ -1322,13 +1239,7 @@ FILEPTR f;
/**************************** EmitChar ******************************/
/**********************************************************************/
void /* output a character bitmap */
-#if NeedFunctionPrototypes
EmitChar(long4 c, struct char_entry *ce)
-#else
-EmitChar(c, ce)
-long4 c;
-struct char_entry *ce;
-#endif
{
register int i;
register unsigned char *sl;
@@ -1637,17 +1548,7 @@ printf("Emit character %c(%d) id=%d, yoff=%d[%d], w=%d[%d], h=%d[%d]\n",
/*********************************************************************/
#ifdef USEPXL
-unsigned char getnyb (
-#if NeedFunctionPrototypes
- void
-#endif
-);
-
-long4 pk_packed_num (
-#if NeedFunctionPrototypes
- void
-#endif
-);
+static long4 pk_packed_num(void);
#define PKBYTE *pkloc; pkloc ++
#define OUTCHAR(c) raster_line_buf[bp]= (unsigned char)c; bp++
@@ -1658,13 +1559,7 @@ unsigned char *pkloc;
int repeatcount;
void /* <Read and translate raster description@>*/
-#if NeedFunctionPrototypes
PkRaster(struct char_entry *ce, int raster)
-#else
-PkRaster(ce, raster)
-struct char_entry *ce;
-int raster;
-#endif
{
int rp;
int current_line;
@@ -1905,11 +1800,8 @@ int raster;
} /* .... create normally packed raster */
}
-unsigned char getnyb(
-#if NeedFunctionPrototypes
- void
-#endif
- )
+static unsigned char
+getnyb(void)
{
register unsigned char temp;
if ( bitweight == 0 ) {
@@ -1923,11 +1815,8 @@ unsigned char getnyb(
}
-long4 pk_packed_num(
-#if NeedFunctionPrototypes
- void
-#endif
- )
+static long4
+pk_packed_num(void)
{ /*@<Packed number procedure@>= */
register int i;
long4 j;
@@ -1961,12 +1850,7 @@ long4 pk_packed_num(
#ifndef USEPXL
void
-#if NeedFunctionPrototypes
-bad_gf(int n)
-#else
bad_gf(int n)
-int n;
-#endif
{
Fatal("Bad gf file, case %d\n",n); /* See gf.c */
}
@@ -1976,14 +1860,7 @@ int n;
#ifdef LJ4
/* Compress a raster line in compression mode 2 */
int
-#if NeedFunctionPrototypes
CompressLine2(unsigned char *buffer, unsigned char *buffout, int emitbytes)
-#else
-CompressLine2(buffer, buffout, emitbytes)
-unsigned char *buffer;
-unsigned char *buffout;
-int emitbytes;
-#endif
{
unsigned char *pos,*ppos,*litpos,*upper;
int lit,i,pack;
@@ -2072,14 +1949,7 @@ int emitbytes;
/* Compress a raster line in compression mode 3 */
-#if NeedFunctionPrototypes
int CompressLine3(unsigned char *buffer, unsigned char *buffout, int emitbytes)
-#else
-int CompressLine3(buffer, buffout, emitbytes)
-unsigned char *buffer;
-unsigned char *buffout;
-int emitbytes;
-#endif
{
unsigned char *pos,*ppos,*litpos,*upper,*prev;
int lit,i,pack;
@@ -2139,15 +2009,8 @@ int emitbytes;
/**************************** RasterLine ****************************/
/**********************************************************************/
void
-#if NeedFunctionPrototypes
RasterLine(struct char_entry *ce, unsigned int nbpl,
unsigned int current_line, unsigned char *buffer)
-#else
-RasterLine(ce, nbpl, current_line, buffer)
-struct char_entry *ce;
-unsigned short nbpl, current_line;
-char *buffer;
-#endif
{
#ifdef IBM3812
long total;
@@ -2243,12 +2106,7 @@ char *buffer;
/**************************** RasterChar ****************************/
/**********************************************************************/
void /* raster a character bitmap */
-#if NeedFunctionPrototypes
RasterChar(struct char_entry *ce)
-#else
-RasterChar(ce)
-struct char_entry *ce;
-#endif
{
int i;
register unsigned char *sl;
@@ -2357,13 +2215,7 @@ struct char_entry *ce;
/***************************** LoadAChar ******************************/
/**********************************************************************/
void
-#if NeedFunctionPrototypes
LoadAChar(long4 c, register struct char_entry *ptr)
-#else
-LoadAChar(c, ptr)
-long4 c;
-register struct char_entry *ptr;
-#endif
{
long4 *pr;
long bytes;
@@ -2482,15 +2334,7 @@ register struct char_entry *ptr;
/***************************** SetChar ******************************/
/**********************************************************************/
void
-#if NeedFunctionPrototypes
SetChar(long4 c, short command, int PassNo, bool do_posn, bool in_string)
-#else
-SetChar(c, command, PassNo, do_posn,in_string)
-long4 c;
-short command;
-int PassNo;
-bool do_posn,in_string;
-#endif
{
register struct char_entry *ptr; /* temporary char_entry pointer */
bool pos_after = _FALSE;
@@ -2673,11 +2517,7 @@ bool do_posn,in_string;
last_rx = (int)PIXROUND(h, hconv) + x_goffset;
}
-#if NeedFunctionPrototypes
void DoBop(void)
-#else
-void DoBop()
-#endif
{
struct font_entry *p;
#ifdef LJ
@@ -2697,13 +2537,7 @@ void DoBop()
/***************************** SetString ****************************/
/**********************************************************************/
void
-#if NeedFunctionPrototypes
SetString(short firstch, int PassNo)
-#else
-SetString(firstch, PassNo) /* read and set a consecutive string of chars */
-short firstch;
-int PassNo;
-#endif
{
short c;
register unsigned short i;
@@ -2735,12 +2569,7 @@ int PassNo;
/***************************** SetPosn ******************************/
/**********************************************************************/
void /* output a positioning command */
-#if NeedFunctionPrototypes
SetPosn(long4 x, long4 y)
-#else
-SetPosn(x, y)
-long4 x, y;
-#endif
{
int rx, ry;
rx = (int)PIXROUND(x, hconv) + x_goffset;
@@ -2811,14 +2640,7 @@ long4 x, y;
compacted row (line repeat count). Updates the previous line
(PrevLine) if necessary. */
void
-#if NeedFunctionPrototypes
CompressedCharLine(struct char_entry *ce, int nbpl, unsigned char *buffer)
-#else
-CompressedCharLine(ce, nbpl, buffer)
-struct char_entry *ce;
-int nbpl;
-unsigned char *buffer;
-#endif
{
if (CChar_Off >= 0) {
register unsigned char *obuf,*buff;
@@ -2931,12 +2753,7 @@ check_checksum (c1, c2, name)
/************************** ActualFactor ****************************/
/**********************************************************************/
double /* compute the actual size factor given the approximation */
-#if NeedFunctionPrototypes
ActualFactor(long4 unmodsize)
-#else
-ActualFactor(unmodsize)
-long4 unmodsize; /* actually factor * 1000 */
-#endif
{
double realsize; /* the actual magnification factor */
realsize = (double)unmodsize / 1000.0;
@@ -2965,13 +2782,7 @@ long4 unmodsize; /* actually factor * 1000 */
/***************************** DecodeArgs ****************************/
/*********************************************************************/
void
-#if NeedFunctionPrototypes
DecodeArgs(int argc, char *argv[])
-#else
-DecodeArgs(argc, argv)
-int argc;
-char *argv[];
-#endif
{
int argind; /* argument index for flags */
char *curarea; /* current file area */
@@ -3545,13 +3356,7 @@ Primary author of Dvi2xx: Gustaf Neumann; -k maintainer: K. Berry.");
/******************************** DoConv ***************************/
/*********************************************************************/
long4
-#if NeedFunctionPrototypes
DoConv(long4 num, long4 den, int convResolution)
-#else
-DoConv(num, den, convResolution)
-long4 num, den;
-int convResolution;
-#endif
{
/*register*/ double conv;
conv = ((double)num / (double)den) *
@@ -3568,12 +3373,7 @@ int convResolution;
/**********************************************************************/
/****************************** AllDone ******************************/
/**********************************************************************/
-#if NeedFunctionPrototypes
void AllDone(bool PFlag)
-#else
-void AllDone(PFlag)
-bool PFlag;
-#endif
{
#ifdef TIMING
double time;
@@ -3784,14 +3584,7 @@ KeyDesc KeyTab[] = {
/* Compare two strings, ignoring case;
s1 pointer to null-terminated keyword, s2 pointer to parseline;
returns (if successful) pointer to character following keyword in s2 */
-#if NeedFunctionPrototypes
bool StrCompare(char *s1, char *s2, char **end)
-#else
-bool StrCompare(s1, s2, end)
-char *s1;
-char *s2;
-char **end;
-#endif
{
char *a,*b;
@@ -3809,15 +3602,8 @@ char **end;
/* Read <number> integer values from string and store results in
<result>. Returns number + of arguments actually read, end =
pointer to char following last number */
-#if NeedFunctionPrototypes
-int ParseNumbers(char *str, int *result, int number, char **end)
-#else
-int ParseNumbers(str, result, number, end)
-char *str;
-int *result;
-int number;
-char **end;
-#endif
+int
+ParseNumbers(char *str, int *result, int number, char **end)
{
char *s;
int count = 0;
@@ -3839,12 +3625,7 @@ char **end;
/* Diagram commands are parsed separately since the format varies from the one
+ used by the other special commands */
-#if NeedFunctionPrototypes
bool ParseDiagram(char *str)
-#else
-bool ParseDiagram(str)
-char *str;
-#endif
{
diagtrafo dt;
char *s,*sh;
@@ -3939,13 +3720,7 @@ char * mkdtemp ( char * template )
/* interpret a \special command, made up of keyword=value pairs */
-#if NeedFunctionPrototypes
void DoSpecial(char *str, int n)
-#else
-void DoSpecial(str, n)
-char *str;
-int n;
-#endif
{
bool first_keyword = _TRUE;
char xs[STRSIZE], ys[STRSIZE];
@@ -4353,13 +4128,7 @@ int n;
* Return pointer to remainder of string,
* return NULL if none found.
*/
-#if NeedFunctionPrototypes
char *GetKeyStr(char *str, KeyWord *kw )
-#else
-char *GetKeyStr( str, kw )
-char *str;
-KeyWord *kw;
-#endif
{
char *s, *start;
char save_char, quote_char;
@@ -4410,15 +4179,7 @@ KeyWord *kw;
/***************************** GetKeyVal ****************************/
/**********************************************************************/
/* get next keyword-value pair decode value according to table entry */
-#if NeedFunctionPrototypes
bool GetKeyVal(KeyWord *kw, KeyDesc tab[], int nt, int *tno)
-#else
-bool GetKeyVal( kw, tab, nt, tno)
-KeyWord *kw;
-KeyDesc tab[];
-int nt;
-int *tno;
-#endif
{
int i;
char c = '\0';
@@ -4454,12 +4215,7 @@ int *tno;
/******************************* IsSame *****************************/
/**********************************************************************/
/* compare strings, ignore case */
-#if NeedFunctionPrototypes
bool IsSame(char *a, char *b)
-#else
-bool IsSame(a, b)
-char *a, *b;
-#endif
{
char *x, *y;
@@ -4477,12 +4233,7 @@ char *a, *b;
/**********************************************************************/
/* this routine will move to the end of the file and find the start
of the postamble */
-#if NeedFunctionPrototypes
void FindPostAmblePtr(long *postambleptr)
-#else
-void FindPostAmblePtr(postambleptr)
-long *postambleptr;
-#endif
{
long4 i;
FSEEK(dvifp, 0l, SEEK_END); /* goto end of file */
@@ -4511,12 +4262,7 @@ long *postambleptr;
initializes the magnification and checks the stack height prior to
starting printing the document.
***********************************************************************/
-#if NeedFunctionPrototypes
void ReadPostAmble(bool load)
-#else
-void ReadPostAmble(load)
-bool load;
-#endif
{
FindPostAmblePtr(&postambleptr);
if (NoSignExtend(dvifp, 1) != POST)
@@ -4556,12 +4302,7 @@ bool load;
/***************************** PMPLine ******************************/
/**********************************************************************/
/* drawing lines on the 3812 using PMP vector commands */
-#if NeedFunctionPrototypes
void PMPLine(int w, int y, int x)
-#else
-void PMPLine(w, y, x)
-int w, y, x;
-#endif
{
if ((w == 0) || (x == 0 && y == 0))
@@ -4608,13 +4349,7 @@ int w, y, x;
/***************************** SetRule ******************************/
/**********************************************************************/
/* this routine will draw a rule */
-#if NeedFunctionPrototypes
void SetRule(long4 a, long4 b, int Set)
-#else
-void SetRule(a, b, Set)
-long4 a, b;
-int Set;
-#endif
{
long4 xx, yy;
#ifdef IBM3812
@@ -4743,11 +4478,7 @@ int Set;
/**********************************************************************/
/***************************** FormFeed ******************************/
/**********************************************************************/
-#if NeedFunctionPrototypes
void FormFeed(void)
-#else
-void FormFeed()
-#endif
{
#ifdef IBM3812
@@ -4778,11 +4509,7 @@ void FormFeed()
/**********************************************************************/
/**************************** GetFontDef *****************************/
/**********************************************************************/
-#if NeedFunctionPrototypes
void GetFontDef(void)
-#else
-void GetFontDef()
-#endif
/***********************************************************************
Read the font definitions as they are in the postamble of the DVI
file.
@@ -4820,11 +4547,7 @@ void GetFontDef()
/**********************************************************************/
/************************** OpenFontFile *****************************/
/**********************************************************************/
-#if NeedFunctionPrototypes
void OpenFontFile(void)
-#else
-void OpenFontFile()
-#endif
/***********************************************************************
The original version of this dvi driver reopened the font file each
time the font changed, resulting in an enormous number of relatively
@@ -4966,13 +4689,7 @@ void OpenFontFile()
/**********************************************************************/
/***************************** PixRound *****************************/
/**********************************************************************/
-#if NeedFunctionPrototypes
long4 PixRound(long4 x, long4 conv)
-#else
-long4 PixRound(x, conv) /* return rounded number of pixels */
-long4 x; /* in DVI units */
-long4 conv; /* conversion factor */
-#endif
{
return((x + conv) / conv);
}
@@ -4984,12 +4701,7 @@ long4 conv; /* conversion factor */
/**************************** TryResident ***************************/
/**********************************************************************/
static bool
-#if NeedFunctionPrototypes
TryResident(struct font_entry *fontptr)
-#else
-TryResident(fontptr)
-struct font_entry *fontptr;
-#endif
{
tfm_info_type tfm_info;
@@ -5070,12 +4782,7 @@ struct font_entry *fontptr;
/**************************** ReadFontDef ***************************/
/**********************************************************************/
-#if NeedFunctionPrototypes
unsigned char skip_specials(long4 *pkloc)
-#else
-unsigned char skip_specials(pkloc)
-long4 *pkloc;
-#endif
{
long4 i, j;
register unsigned char flag_byte;
@@ -5129,12 +4836,7 @@ long4 *pkloc;
}
-#if NeedFunctionPrototypes
void ReadFontDef(long4 k)
-#else
-void ReadFontDef(k)
-long4 k;
-#endif
{
long4 t;
unsigned short i;
@@ -5557,13 +5259,7 @@ printf("fontid=%d: max_width=%u, max_height=%d, max_yoff=%u\n",
/**********************************************************************/
/**************************** SetFntNum *****************************/
/**********************************************************************/
-#if NeedFunctionPrototypes
void SetFntNum(long4 k, bool Emitting)
-#else
-void SetFntNum(k, Emitting)
-long4 k;
-bool Emitting;
-#endif
/* this routine is used to specify the font to be used in printing future
characters */
{
@@ -5656,11 +5352,7 @@ bool Emitting;
/**********************************************************************/
/**************************** SkipFontDef ***************************/
/**********************************************************************/
-#if NeedFunctionPrototypes
void SkipFontDef(void)
-#else
-void SkipFontDef()
-#endif
{
int a, l;
char n[STRSIZE];
@@ -5682,24 +5374,11 @@ void SkipFontDef()
/****************************** Fatal *******************************/
/**********************************************************************/
void
-#if NeedVarargsPrototypes
Fatal (char *fmt, ...)
-#else
-Fatal(va_alist) /* issue a fatal error message */
- va_dcl
-#endif
{
-#if !NeedVarargsPrototypes
- const char *fmt;
-#endif
va_list args;
-#if NeedVarargsPrototypes
va_start(args, fmt);
-#else
- va_start(args);
- fmt = va_arg(args, const char *);
-#endif
fprintf(ERR_STREAM, "\n");
fprintf(ERR_STREAM, "%s: FATAL--", G_progname);
vfprintf(ERR_STREAM, fmt, args);
@@ -5721,24 +5400,11 @@ Fatal(va_alist) /* issue a fatal error message */
/***************************** Warning ******************************/
/**********************************************************************/
void /* issue a warning */
-#if NeedVarargsPrototypes
Warning(char *fmt, ...)
-#else
-Warning(va_alist)
- va_dcl
-#endif
{
-#if !NeedVarargsPrototypes
- const char *fmt;
-#endif
va_list args;
-#if NeedVarargsPrototypes
va_start(args, fmt);
-#else
- va_start(args);
- fmt = va_arg(args, const char *);
-#endif
#ifndef vms
G_errenc = 1;
diff --git a/Build/source/texk/dviljk/dvi2xx.h b/Build/source/texk/dviljk/dvi2xx.h
index ff443ea3ba5..5b8c95b575e 100644
--- a/Build/source/texk/dviljk/dvi2xx.h
+++ b/Build/source/texk/dviljk/dvi2xx.h
@@ -19,7 +19,7 @@
#include <kpathsea/tex-glyph.h>
#include <kpathsea/tex-hush.h>
#include <kpathsea/tex-make.h>
-#include <kpathsea/c-vararg.h>
+#include <stdarg.h>
#include <c-auto.h>
#else
#include <string.h>
@@ -298,11 +298,7 @@ char *MFMODE = MFMODE600;
#ifndef WIN32
#ifndef _AMIGA
# ifndef unix
-# if NeedFunctionPrototypes
long access(char *, int); /* all the other ones known under RISC OS */
-# else
-long access();
-# endif
# ifndef __riscos
FILEPTR BOPENCMD();
void exit();
@@ -452,79 +448,67 @@ typedef struct {
alphabetical order following the main() procedure. The names are
kept unique in the first 6 characters for portability. */
-#if NeedFunctionPrototypes
-# define DVIPROTO(x) x
-#if NeedVarargsPrototypes
-# define DVIELI() (char *fmt, ...)
-#else
-# define DVIELI() ()
-#endif
-#else
-# define DVIPROTO(x) ()
-# define DVIELI() ()
-#endif
-
-double ActualFactor DVIPROTO((long4));
-void AllDone DVIPROTO((bool));
+double ActualFactor(long4);
+void AllDone(bool);
#ifdef MSC5
-void AssureBinary DVIPROTO((FILEPTR)); /* DOS and Microsoft C dependent !!! */
+void AssureBinary(FILEPTR); /* DOS and Microsoft C dependent !!! */
#endif
-void CloseFiles DVIPROTO((void));
-void CopyFile DVIPROTO((char *));
-void CopyHPFile DVIPROTO((char *));
-void DecodeArgs DVIPROTO((int, char *[]));
+void CloseFiles(void);
+void CopyFile(char *);
+void CopyHPFile(char *);
+void DecodeArgs(int, char *[]);
#ifdef __riscos
-void diagram DVIPROTO((char *, diagtrafo *));
-void *xosfile_set_type DVIPROTO((char *, int));
-void MakeMetafontFile DVIPROTO((char *, char *, int));
-#endif
-void DoBop DVIPROTO((void));
-long4 DoConv DVIPROTO((long4, long4, int));
-void DoSpecial DVIPROTO((char *, int));
-void EmitChar DVIPROTO((long4, struct char_entry *));
-void Fatal DVIELI();
-void FindPostAmblePtr DVIPROTO((long *));
-void FormFeed DVIPROTO((void));
-void GetFontDef DVIPROTO((void));
-char *GetKeyStr DVIPROTO((char *, KeyWord *));
-bool GetKeyVal DVIPROTO((KeyWord *, KeyDesc[], int, int *));
-bool IsSame DVIPROTO((char *, char *));
-void LoadAChar DVIPROTO((long4, register struct char_entry *));
-long4 NoSignExtend DVIPROTO((FILEPTR, int));
-void OpenFontFile DVIPROTO((void));
-long4 PixRound DVIPROTO((long4, long4));
-void PkRaster DVIPROTO((struct char_entry *, int));
-void RasterLine DVIPROTO((struct char_entry *, unsigned int,
- unsigned int, unsigned char *));
-void RasterChar DVIPROTO((struct char_entry *));
-void ReadFontDef DVIPROTO((long4));
-void ReadPostAmble DVIPROTO((bool));
-void SetChar DVIPROTO((long4, short, int, bool, bool));
-void SetFntNum DVIPROTO((long4, bool));
-void SetPosn DVIPROTO((long4, long4));
-void SetRule DVIPROTO((long4, long4, int));
-void SetString DVIPROTO((short, int));
-long4 SignExtend DVIPROTO((FILEPTR, int));
-void SkipFontDef DVIPROTO((void));
-bool tfm_read_info DVIPROTO((char *, tfm_info_type *));
-void Warning DVIELI();
-unsigned char skip_specials DVIPROTO((long4 *));
+void diagram(char *, diagtrafo *);
+void *xosfile_set_type(char *, int);
+void MakeMetafontFile(char *, char *, int);
+#endif
+void DoBop(void);
+long4 DoConv(long4, long4, int);
+void DoSpecial(char *, int);
+void EmitChar(long4, struct char_entry *);
+void Fatal(char *fmt, ...);
+void FindPostAmblePtr(long *);
+void FormFeed(void);
+void GetFontDef(void);
+char *GetKeyStr(char *, KeyWord *);
+bool GetKeyVal(KeyWord *, KeyDesc[], int, int *);
+bool IsSame(char *, char *);
+void LoadAChar(long4, register struct char_entry *);
+long4 NoSignExtend(FILEPTR, int);
+void OpenFontFile(void);
+long4 PixRound(long4, long4);
+void PkRaster(struct char_entry *, int);
+void RasterLine(struct char_entry *, unsigned int,
+ unsigned int, unsigned char *);
+void RasterChar(struct char_entry *);
+void ReadFontDef(long4);
+void ReadPostAmble(bool);
+void SetChar(long4, short, int, bool, bool);
+void SetFntNum(long4, bool);
+void SetPosn(long4, long4);
+void SetRule(long4, long4, int);
+void SetString(short, int);
+long4 SignExtend(FILEPTR, int);
+void SkipFontDef(void);
+bool tfm_read_info (char *, tfm_info_type *);
+void Warning(char *fmt, ...);
+unsigned char skip_specials(long4 *);
#ifdef LJ4
-int CompressLine2 DVIPROTO((unsigned char *, unsigned char *, int));
-int CompressLine3 DVIPROTO((unsigned char *, unsigned char *, int));
-void CompressedCharLine DVIPROTO((struct char_entry *,int,unsigned char *));
+int CompressLine2(unsigned char *, unsigned char *, int);
+int CompressLine3(unsigned char *, unsigned char *, int);
+void CompressedCharLine(struct char_entry *,int,unsigned char *);
#endif
#ifdef IBM3812
-void PMPout DVIPROTO((int, char *));
-void PMPoutC DVIPROTO((char));
+void PMPout(int, char *);
+void PMPoutC(char);
#endif
/* buffer IO */
-char b_read DVIPROTO((FILEPTR));
+char b_read(FILEPTR);
#ifdef RISC_BUFFER
-void b_write DVIPROTO((FILEPTR, char));
-void b_wrtmult DVIPROTO((FILEPTR, char *, int));
-void b_oflush DVIPROTO((FILEPTR));
+void b_write(FILEPTR, char);
+void b_wrtmult(FILEPTR, char *, int);
+void b_oflush(FILEPTR);
#endif
diff --git a/Build/source/texk/dviljk/tfm.c b/Build/source/texk/dviljk/tfm.c
index 18d8eac204a..69f1d6b22a4 100644
--- a/Build/source/texk/dviljk/tfm.c
+++ b/Build/source/texk/dviljk/tfm.c
@@ -19,11 +19,7 @@ extern char* TFMpath;
#include "tfm.h"
-#ifdef NeedVarargsPrototypes
extern void Fatal(char *, ...);
-#else
-void Fatal();
-#endif
#ifdef vms
#include <ssdef.h>
@@ -31,14 +27,8 @@ void Fatal();
#define getenv vms_getenv
#endif
-#if NeedFunctionPrototypes
-# define DVIPROTO(x) x
-#else
-# define DVIPROTO(x) ()
-#endif
-
/* Defined in dvi2xx.c. */
-extern long4 NoSignExtend DVIPROTO((FILEPTR, int));
+extern long4 NoSignExtend(FILEPTR, int);
#define TFM_GET_TWO() NoSignExtend (tfm_fp, 2)
#define TFM_GET_FOUR() NoSignExtend (tfm_fp, 4)
@@ -50,14 +40,7 @@ extern void Warning();
OUTBUF==NULL, in which case throw them away. */
static void
-#if NeedFunctionPrototypes
tfm_get_n (FILEPTR tfm_fp, unsigned nwords, unsigned char **outbuf)
-#else
-tfm_get_n (tfm_fp, nwords, outbuf)
- FILE *tfm_fp;
- unsigned nwords;
- void **outbuf;
-#endif
{
unsigned n = nwords * 4;
void *buf = (void *) malloc (n);
@@ -83,13 +66,7 @@ tfm_get_n (tfm_fp, nwords, outbuf)
Assume STR is long enough. */
static void
-#if NeedFunctionPrototypes
get_bcpl (unsigned char *data, unsigned char *str)
-#else
-get_bcpl (data, str)
-unsigned char *data;
-unsigned char *str;
-#endif
{
unsigned length;
@@ -115,17 +92,8 @@ unsigned char *str;
Assume DATA is long enough for everything we might try to read. */
static bool
-#if NeedFunctionPrototypes
get_pcl_info (unsigned char *data, unsigned *spacing, unsigned *style,
int *weight, unsigned *typeface_id)
-#else
-get_pcl_info (data, spacing, style, weight, typeface_id)
- unsigned char *data;
- unsigned *spacing;
- unsigned *style;
- int *weight;
- unsigned *typeface_id;
-#endif
{
/* No magic number for our extensions => forget it. */
if (data[0] != 'K' && data[1] != 'N')
@@ -151,13 +119,7 @@ get_pcl_info (data, spacing, style, weight, typeface_id)
Otherwise, return false. */
bool
-#if NeedFunctionPrototypes
tfm_read_info (char *name, tfm_info_type *ret)
-#else
-tfm_read_info (name, ret)
- char *name;
- tfm_info_type *ret;
-#endif
{
/* Don't use a structure for this, since then it might occupy more
than the exactly four bytes that we need. */
diff --git a/Build/source/texk/dviljk/tfm.h b/Build/source/texk/dviljk/tfm.h
index c43a496b066..fbae3589125 100644
--- a/Build/source/texk/dviljk/tfm.h
+++ b/Build/source/texk/dviljk/tfm.h
@@ -1,10 +1,6 @@
#ifndef _TFM_H
#define _TFM_H
-#if NeedFunctionPrototypes
bool tfm_read_info(char *, tfm_info_type *);
-#else
-bool tfm_read_info();
-#endif
#endif /* _TFM_H */