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

Commit0e72b9d

Browse files
author
Neil Conway
committed
Cosmetic improvements/code cleanup:
- replace some function signatures of the form "some_type foo()" with"some_type foo(void)"- replace a few instances of a literal 0 being used as a NULL pointer;there are more instances of this in the code, but I just fixed a few- in src/backend/utils/mb/wstrncmp.c, replace K&R style functiondeclarations with ANSI style, remove use of 'register' keyword- remove an "extern" modifier that was applied to a function definition(rather than a declaration)
1 parent86a39d5 commit0e72b9d

File tree

11 files changed

+27
-34
lines changed

11 files changed

+27
-34
lines changed

‎src/backend/bootstrap/bootparse.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/bootstrap/bootparse.y,v 1.73 2004/08/31 17:10:36 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/bootstrap/bootparse.y,v 1.74 2004/10/10 23:37:16 neilc Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -52,15 +52,15 @@
5252

5353

5454
staticvoid
55-
do_start()
55+
do_start(void)
5656
{
5757
StartTransactionCommand();
5858
elog(DEBUG4,"start transaction");
5959
}
6060

6161

6262
staticvoid
63-
do_end()
63+
do_end(void)
6464
{
6565
CommitTransactionCommand();
6666
elog(DEBUG4,"commit transaction");

‎src/backend/bootstrap/bootstrap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.194 2004/10/08 01:36:33 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.195 2004/10/10 23:37:16 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1012,7 +1012,7 @@ EnterString(char *str)
10121012

10131013
len=strlen(str);
10141014

1015-
node=FindStr(str,len,0);
1015+
node=FindStr(str,len,NULL);
10161016
if (node)
10171017
returnnode->strnum;
10181018
else

‎src/backend/utils/mb/wstrncmp.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@
3838
#include"mb/pg_wchar.h"
3939

4040
int
41-
pg_wchar_strncmp(s1,s2,n)
42-
registerconstpg_wchar*s1,
43-
*s2;
44-
registersize_tn;
41+
pg_wchar_strncmp(constpg_wchar*s1,constpg_wchar*s2,size_tn)
4542
{
4643
if (n==0)
4744
return0;
@@ -56,10 +53,7 @@ register size_t n;
5653
}
5754

5855
int
59-
pg_char_and_wchar_strncmp(s1,s2,n)
60-
registerconstchar*s1;
61-
registerconstpg_wchar*s2;
62-
registersize_tn;
56+
pg_char_and_wchar_strncmp(constchar*s1,constpg_wchar*s2,size_tn)
6357
{
6458
if (n==0)
6559
return0;
@@ -74,10 +68,9 @@ register size_t n;
7468
}
7569

7670
size_t
77-
pg_wchar_strlen(str)
78-
constpg_wchar*str;
71+
pg_wchar_strlen(constpg_wchar*str)
7972
{
80-
registerconstpg_wchar*s;
73+
constpg_wchar*s;
8174

8275
for (s=str;*s;++s)
8376
;

‎src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.241 2004/10/09 23:13:10 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.242 2004/10/10 23:37:28 neilc Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -4378,7 +4378,7 @@ DefineCustomStringVariable(
43784378
define_custom_variable(&var->gen);
43794379
}
43804380

4381-
externvoid
4381+
void
43824382
EmitWarningsOnPlaceholders(constchar*className)
43834383
{
43844384
structconfig_generic**vars=guc_variables;

‎src/bin/initdb/initdb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Portions Copyright (c) 1994, Regents of the University of California
4040
* Portions taken from FreeBSD.
4141
*
42-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.59 2004/10/07 18:57:26 tgl Exp $
42+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.60 2004/10/10 23:37:31 neilc Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -1881,7 +1881,7 @@ trapsig(int signum)
18811881
* call exit_nicely() if we got a signal, or else output "ok".
18821882
*/
18831883
staticvoid
1884-
check_ok()
1884+
check_ok(void)
18851885
{
18861886
if (caught_signal)
18871887
{
@@ -2066,7 +2066,7 @@ main(int argc, char *argv[])
20662066
{"debug",no_argument,NULL,'d'},
20672067
{"show",no_argument,NULL,'s'},
20682068
{"noclean",no_argument,NULL,'n'},
2069-
{0,0,0,0}
2069+
{NULL,0,NULL,0}
20702070
};
20712071

20722072
intc,

‎src/bin/pg_config/pg_config.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
1919
*
20-
* $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.7 2004/10/06 17:21:45 momjian Exp $
20+
* $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.8 2004/10/10 23:37:34 neilc Exp $
2121
*
2222
*-------------------------------------------------------------------------
2323
*/
@@ -31,7 +31,7 @@
3131
staticchar*progname;
3232

3333
staticvoid
34-
help()
34+
help(void)
3535
{
3636
printf(_("\n%s provides information about the installed version of PostgreSQL.\n\n"),progname);
3737
printf(_("Usage:\n"));
@@ -52,7 +52,7 @@ help()
5252
}
5353

5454
staticvoid
55-
advice()
55+
advice(void)
5656
{
5757
fprintf(stderr,_("\nTry \"%s --help\" for more information\n"),progname);
5858
}

‎src/bin/pg_ctl/pg_ctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.32 2004/10/07 15:21:55 momjian Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.33 2004/10/10 23:37:37 neilc Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -1190,7 +1190,7 @@ main(int argc, char **argv)
11901190
{"mode",required_argument,NULL,'m'},
11911191
{"pgdata",required_argument,NULL,'D'},
11921192
{"silent",no_argument,NULL,'s'},
1193-
{0,0,0,0}
1193+
{NULL,0,NULL,0}
11941194
};
11951195

11961196
intoption_index;

‎src/bin/psql/common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.91 2004/09/20 18:51:19 tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.92 2004/10/10 23:37:40 neilc Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"common.h"
@@ -268,7 +268,7 @@ handle_sigint(SIGNAL_ARGS)
268268
* Returns whether our backend connection is still there.
269269
*/
270270
staticbool
271-
ConnectionUp()
271+
ConnectionUp(void)
272272
{
273273
returnPQstatus(pset.db)!=CONNECTION_BAD;
274274
}

‎src/interfaces/ecpg/preproc/descriptor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ struct variable *
315315
descriptor_variable(constchar*name,intinput)
316316
{
317317
staticchardescriptor_names[2][MAX_DESCRIPTOR_NAMELEN];
318-
staticconststructECPGtypedescriptor_type= {ECPGt_descriptor,0};
318+
staticconststructECPGtypedescriptor_type= {ECPGt_descriptor,NULL};
319319
staticconststructvariablevarspace[2]= {
320320
{descriptor_names[0], (structECPGtype*)&descriptor_type,0,NULL},
321321
{descriptor_names[1], (structECPGtype*)&descriptor_type,0,NULL}

‎src/interfaces/ecpg/preproc/type.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ ECPGmake_simple_type(enum ECPGttype type, char *size)
9797

9898
ne->type=type;
9999
ne->size=size;
100-
ne->u.element=0;
100+
ne->u.element=NULL;
101101
ne->struct_sizeof=NULL;
102102

103103
returnne;
@@ -291,7 +291,7 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type,
291291
if (indicator_set&& (ind_type->type==ECPGt_struct||ind_type->type==ECPGt_array))
292292
mmerror(INDICATOR_NOT_SIMPLE,ET_FATAL,"Indicator for simple datatype has to be simple.\n");
293293

294-
ECPGdump_a_simple(o,name,type->type,0,make_str("-1"),NULL,prefix);
294+
ECPGdump_a_simple(o,name,type->type,NULL,make_str("-1"),NULL,prefix);
295295
ECPGdump_a_simple(o,ind_name,ind_type->type,ind_type->size,make_str("-1"),NULL,ind_prefix);
296296
break;
297297
default:

‎src/pl/plpgsql/src/pl_funcs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* procedural language
44
*
55
* IDENTIFICATION
6-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.37 2004/09/14 23:46:46 neilc Exp $
6+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.38 2004/10/10 23:37:45 neilc Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -166,7 +166,7 @@ plpgsql_ns_push(char *label)
166166
* ----------
167167
*/
168168
void
169-
plpgsql_ns_pop()
169+
plpgsql_ns_pop(void)
170170
{
171171
inti;
172172
PLpgSQL_ns*old;
@@ -503,7 +503,7 @@ static void dump_expr(PLpgSQL_expr *expr);
503503

504504

505505
staticvoid
506-
dump_ind()
506+
dump_ind(void)
507507
{
508508
inti;
509509

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp