Skip to content

Commit da71f98

Browse files
committed
ANSI-ify a few straggler K&R-style function definitions.
We still had a couple of these left in ancient src/port/ files. Convert them to modern style in preparation for switching to a version of pg_bsd_indent that doesn't cope well with K&R style. Discussion: https://postgr.es/m/16886.1558104483@sss.pgh.pa.us
1 parent 93f03da commit da71f98

File tree

2 files changed

+18
-35
lines changed

2 files changed

+18
-35
lines changed

src/port/crypt.c

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,7 @@ STATIC prtab(char *, unsigned char *, int);
302302

303303
#ifndef LARGEDATA
304304
STATIC
305-
permute(cp, out, p, chars_in)
306-
unsigned char *cp;
307-
C_block *out;
308-
C_block *p;
309-
int chars_in;
310-
305+
permute(unsigned char *cp, C_block *out, C_block *p, int chars_in)
311306
{
312307
DCL_BLOCK(D, D0, D1);
313308
C_block *tp;
@@ -490,9 +485,7 @@ extern char *__bcrypt(const char *, const char *); /* XXX */
490485
* followed by an encryption produced by the "key" and "setting".
491486
*/
492487
char *
493-
crypt(key, setting)
494-
const char *key;
495-
const char *setting;
488+
crypt(const char *key, const char *setting)
496489
{
497490
char *encp;
498491
int32_t i;
@@ -631,8 +624,7 @@ static volatile int des_ready = 0;
631624
* Set up the key schedule from the key.
632625
*/
633626
static int
634-
des_setkey(key)
635-
const char *key;
627+
des_setkey(const char *key)
636628
{
637629
DCL_BLOCK(K, K0, K1);
638630
C_block *ptabp;
@@ -664,11 +656,7 @@ const char *key;
664656
* compiler and machine architecture.
665657
*/
666658
static int
667-
des_cipher(in, out, salt, num_iter)
668-
const char *in;
669-
char *out;
670-
long salt;
671-
int num_iter;
659+
des_cipher(const char *in, char *out, long salt, int num_iter)
672660
{
673661
/* variables that we want in registers, most important first */
674662
#if defined(pdp11)
@@ -808,7 +796,7 @@ int num_iter;
808796
* done at compile time, if the compiler were capable of that sort of thing.
809797
*/
810798
STATIC
811-
init_des()
799+
init_des(void)
812800
{
813801
int i,
814802
j;
@@ -973,12 +961,10 @@ init_des()
973961
* "perm" must be all-zeroes on entry to this routine.
974962
*/
975963
STATIC
976-
init_perm(perm, p, chars_in, chars_out)
977-
C_block perm[64 / CHUNKBITS][1 << CHUNKBITS];
978-
unsigned char p[64];
979-
int chars_in,
980-
chars_out;
981-
964+
init_perm(C_block perm[64 / CHUNKBITS][1 << CHUNKBITS],
965+
unsigned char p[64],
966+
int chars_in,
967+
int chars_out)
982968
{
983969
int i,
984970
j,
@@ -1005,8 +991,7 @@ int chars_in,
1005991
*/
1006992
#ifdef NOT_USED
1007993
int
1008-
setkey(key)
1009-
const char *key;
994+
setkey(const char *key)
1010995
{
1011996
int i,
1012997
j,
@@ -1030,9 +1015,7 @@ const char *key;
10301015
* "encrypt" routine (for backwards compatibility)
10311016
*/
10321017
static int
1033-
encrypt(block, flag)
1034-
char *block;
1035-
int flag;
1018+
encrypt(char *block, int flag)
10361019
{
10371020
int i,
10381021
j,
@@ -1066,11 +1049,7 @@ int flag;
10661049

10671050
#ifdef DEBUG
10681051
STATIC
1069-
prtab(s, t, num_rows)
1070-
char *s;
1071-
unsigned char *t;
1072-
int num_rows;
1073-
1052+
prtab(char *s, unsigned char *t, int num_rows)
10741053
{
10751054
int i,
10761055
j;

src/port/isinf.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#if HAVE_IEEEFP_H
2323
#include <ieeefp.h>
2424
#endif
25+
2526
int
2627
isinf(double d)
2728
{
@@ -44,9 +45,9 @@ isinf(double d)
4445
#if HAVE_FP_CLASS_H
4546
#include <fp_class.h>
4647
#endif
48+
4749
int
48-
isinf(x)
49-
double x;
50+
isinf(double x)
5051
{
5152
#if HAVE_FP_CLASS
5253
int fpclass = fp_class(x);
@@ -60,7 +61,9 @@ double x;
6061
return -1;
6162
return 0;
6263
}
64+
6365
#elif defined(HAVE_CLASS)
66+
6467
int
6568
isinf(double x)
6669
{
@@ -72,6 +75,7 @@ isinf(double x)
7275
return -1;
7376
return 0;
7477
}
78+
7579
#endif
7680

7781
#endif

0 commit comments

Comments
 (0)