summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2019-05-19 00:16:50 +0000
committerTom Lane2019-05-19 00:16:50 +0000
commitda71f98efba9aed493a178aa29f25dbca7407eaf (patch)
tree5133b12ba315b3210bbdff671f4fd844deb3a8c6
parent93f03dad824f14f40519597e5e4a8fe7b6df858e (diff)
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/[email protected]
-rw-r--r--src/port/crypt.c45
-rw-r--r--src/port/isinf.c8
2 files changed, 18 insertions, 35 deletions
diff --git a/src/port/crypt.c b/src/port/crypt.c
index 786161ff35..6abf061d65 100644
--- a/src/port/crypt.c
+++ b/src/port/crypt.c
@@ -302,12 +302,7 @@ STATIC prtab(char *, unsigned char *, int);
#ifndef LARGEDATA
STATIC
-permute(cp, out, p, chars_in)
-unsigned char *cp;
-C_block *out;
-C_block *p;
-int chars_in;
-
+permute(unsigned char *cp, C_block *out, C_block *p, int chars_in)
{
DCL_BLOCK(D, D0, D1);
C_block *tp;
@@ -490,9 +485,7 @@ extern char *__bcrypt(const char *, const char *); /* XXX */
* followed by an encryption produced by the "key" and "setting".
*/
char *
-crypt(key, setting)
-const char *key;
-const char *setting;
+crypt(const char *key, const char *setting)
{
char *encp;
int32_t i;
@@ -631,8 +624,7 @@ static volatile int des_ready = 0;
* Set up the key schedule from the key.
*/
static int
-des_setkey(key)
-const char *key;
+des_setkey(const char *key)
{
DCL_BLOCK(K, K0, K1);
C_block *ptabp;
@@ -664,11 +656,7 @@ const char *key;
* compiler and machine architecture.
*/
static int
-des_cipher(in, out, salt, num_iter)
-const char *in;
-char *out;
-long salt;
-int num_iter;
+des_cipher(const char *in, char *out, long salt, int num_iter)
{
/* variables that we want in registers, most important first */
#if defined(pdp11)
@@ -808,7 +796,7 @@ int num_iter;
* done at compile time, if the compiler were capable of that sort of thing.
*/
STATIC
-init_des()
+init_des(void)
{
int i,
j;
@@ -973,12 +961,10 @@ init_des()
* "perm" must be all-zeroes on entry to this routine.
*/
STATIC
-init_perm(perm, p, chars_in, chars_out)
-C_block perm[64 / CHUNKBITS][1 << CHUNKBITS];
-unsigned char p[64];
-int chars_in,
- chars_out;
-
+init_perm(C_block perm[64 / CHUNKBITS][1 << CHUNKBITS],
+ unsigned char p[64],
+ int chars_in,
+ int chars_out)
{
int i,
j,
@@ -1005,8 +991,7 @@ int chars_in,
*/
#ifdef NOT_USED
int
-setkey(key)
-const char *key;
+setkey(const char *key)
{
int i,
j,
@@ -1030,9 +1015,7 @@ const char *key;
* "encrypt" routine (for backwards compatibility)
*/
static int
-encrypt(block, flag)
-char *block;
-int flag;
+encrypt(char *block, int flag)
{
int i,
j,
@@ -1066,11 +1049,7 @@ int flag;
#ifdef DEBUG
STATIC
-prtab(s, t, num_rows)
-char *s;
-unsigned char *t;
-int num_rows;
-
+prtab(char *s, unsigned char *t, int num_rows)
{
int i,
j;
diff --git a/src/port/isinf.c b/src/port/isinf.c
index 6eb881e41b..e4823d4133 100644
--- a/src/port/isinf.c
+++ b/src/port/isinf.c
@@ -22,6 +22,7 @@
#if HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
+
int
isinf(double d)
{
@@ -44,9 +45,9 @@ isinf(double d)
#if HAVE_FP_CLASS_H
#include <fp_class.h>
#endif
+
int
-isinf(x)
-double x;
+isinf(double x)
{
#if HAVE_FP_CLASS
int fpclass = fp_class(x);
@@ -60,7 +61,9 @@ double x;
return -1;
return 0;
}
+
#elif defined(HAVE_CLASS)
+
int
isinf(double x)
{
@@ -72,6 +75,7 @@ isinf(double x)
return -1;
return 0;
}
+
#endif
#endif