diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-11 07:58:18 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-11 07:58:18 +0000 |
commit | 6f0789bd6e4408b1876f05e1d4ad48451312b9b5 (patch) | |
tree | d46f123cb746257e847a58e3046f30d1dc77258b /Build/source/texk/ps2pkm/pkin.c | |
parent | 114b4c2453b3e1e5a379a57ff5be9fc0808bf1d6 (diff) |
ps2pkm: Cleanup. Added a test case
git-svn-id: svn://tug.org/texlive/trunk@26996 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ps2pkm/pkin.c')
-rw-r--r-- | Build/source/texk/ps2pkm/pkin.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/Build/source/texk/ps2pkm/pkin.c b/Build/source/texk/ps2pkm/pkin.c index a539b1de5b0..45083b3cf50 100644 --- a/Build/source/texk/ps2pkm/pkin.c +++ b/Build/source/texk/ps2pkm/pkin.c @@ -25,7 +25,7 @@ /* * Forward declaration */ -static void error(); +static void error(const char *s); /* * Now we have some routines to get stuff from the pk file. pkbyte returns @@ -35,7 +35,7 @@ static void error(); static FILE *pkfile ; static shalfword -pkbyte() +pkbyte(void) { register shalfword i ; @@ -45,7 +45,7 @@ pkbyte() } static integer -pkquad() +pkquad(void) { register integer i ; @@ -59,7 +59,7 @@ pkquad() } static integer -pktrio() +pktrio(void) { register integer i ; @@ -70,7 +70,7 @@ pktrio() } static integer -pkpair() +pkpair(void) { register integer i ; @@ -80,7 +80,7 @@ pkpair() } static integer -pkspair() +pkspair(void) { register integer i ; @@ -97,8 +97,7 @@ static char errbuf[80] ; */ static Boolean -pkopen(name) - char name[] ; +pkopen(const char *name) { if ((pkfile=fopen(name, RB))==NULL) { (void)sprintf(errbuf, "Could not open %s", name) ; @@ -123,7 +122,7 @@ static halfword dynf ; static halfword repeatcount ; static shalfword -getnyb () +getnyb (void) { halfword temp; if ( bitweight == 0 ) { bitweight = 16 ; @@ -137,7 +136,7 @@ getnyb () } static Boolean -getbit () +getbit (void) { bitweight >>= 1 ; if ( bitweight == 0 ) @@ -149,9 +148,11 @@ getbit () static halfword (*realfunc)() ; long PKremainder ; -static halfword handlehuge() ; +static halfword handlehuge(halfword i, halfword k) ; -static halfword pkpackednum () { +static halfword +pkpackednum (void) +{ register halfword i, j ; i = getnyb () ; if ( i == 0 ) @@ -185,7 +186,7 @@ register halfword i, j ; } } -static halfword rest () +static halfword rest (void) { halfword i ; @@ -210,8 +211,8 @@ static halfword rest () return 0; } -static halfword handlehuge ( i , k ) -halfword i , k ; +static halfword +handlehuge (halfword i, halfword k) { register long j = k ; @@ -232,8 +233,7 @@ static halfword gpower[17] = { 0 , 1 , 3 , 7 , 15 , 31 , 63 , 127 , 255 , 511 , 1023 , 2047 , 4095 , 8191 , 16383 , 32767 , 65535 } ; static void -unpack(cd) -chardesc *cd; +unpack(chardesc *cd) { register integer i, j ; register halfword word, wordweight ; @@ -334,10 +334,7 @@ chardesc *cd; * return FALSE (0) otherwise. */ int -readchar(name, c, cd) -char name[]; -shalfword c; -chardesc *cd; +readchar(char *name, shalfword c, chardesc *cd) { register shalfword i ; register integer k ; @@ -446,8 +443,8 @@ default: return(0); /* character not found */ } -static void error(s) -char s[]; +static void +error(const char *s) { fprintf(stderr, "%s\n", s); exit(1); |