Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda71f98

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 toa 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 parent93f03da commitda71f98

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 @@ STATICprtab(char *, unsigned char *, int);
302302

303303
#ifndefLARGEDATA
304304
STATIC
305-
permute(cp,out,p,chars_in)
306-
unsignedchar*cp;
307-
C_block*out;
308-
C_block*p;
309-
intchars_in;
310-
305+
permute(unsignedchar*cp,C_block*out,C_block*p,intchars_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-
constchar*key;
495-
constchar*setting;
488+
crypt(constchar*key,constchar*setting)
496489
{
497490
char*encp;
498491
int32_ti;
@@ -631,8 +624,7 @@ static volatile int des_ready = 0;
631624
* Set up the key schedule from the key.
632625
*/
633626
staticint
634-
des_setkey(key)
635-
constchar*key;
627+
des_setkey(constchar*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
staticint
667-
des_cipher(in,out,salt,num_iter)
668-
constchar*in;
669-
char*out;
670-
longsalt;
671-
intnum_iter;
659+
des_cipher(constchar*in,char*out,longsalt,intnum_iter)
672660
{
673661
/* variables that we want in registers, most important first */
674662
#if defined(pdp11)
@@ -808,7 +796,7 @@ intnum_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
inti,
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_blockperm[64 /CHUNKBITS][1 <<CHUNKBITS];
978-
unsignedcharp[64];
979-
intchars_in,
980-
chars_out;
981-
964+
init_perm(C_blockperm[64 /CHUNKBITS][1 <<CHUNKBITS],
965+
unsignedcharp[64],
966+
intchars_in,
967+
intchars_out)
982968
{
983969
inti,
984970
j,
@@ -1005,8 +991,7 @@ intchars_in,
1005991
*/
1006992
#ifdefNOT_USED
1007993
int
1008-
setkey(key)
1009-
constchar*key;
994+
setkey(constchar*key)
1010995
{
1011996
inti,
1012997
j,
@@ -1030,9 +1015,7 @@ const char *key;
10301015
* "encrypt" routine (for backwards compatibility)
10311016
*/
10321017
staticint
1033-
encrypt(block,flag)
1034-
char*block;
1035-
intflag;
1018+
encrypt(char*block,intflag)
10361019
{
10371020
inti,
10381021
j,
@@ -1066,11 +1049,7 @@ intflag;
10661049

10671050
#ifdefDEBUG
10681051
STATIC
1069-
prtab(s,t,num_rows)
1070-
char*s;
1071-
unsignedchar*t;
1072-
intnum_rows;
1073-
1052+
prtab(char*s,unsignedchar*t,intnum_rows)
10741053
{
10751054
inti,
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
#ifHAVE_IEEEFP_H
2323
#include<ieeefp.h>
2424
#endif
25+
2526
int
2627
isinf(doubled)
2728
{
@@ -44,9 +45,9 @@ isinf(double d)
4445
#ifHAVE_FP_CLASS_H
4546
#include<fp_class.h>
4647
#endif
48+
4749
int
48-
isinf(x)
49-
doublex;
50+
isinf(doublex)
5051
{
5152
#ifHAVE_FP_CLASS
5253
intfpclass=fp_class(x);
@@ -60,7 +61,9 @@ doublex;
6061
return-1;
6162
return0;
6263
}
64+
6365
#elif defined(HAVE_CLASS)
66+
6467
int
6568
isinf(doublex)
6669
{
@@ -72,6 +75,7 @@ isinf(double x)
7275
return-1;
7376
return0;
7477
}
78+
7579
#endif
7680

7781
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp