Skip to content

Commit 7069dbc

Browse files
author
Neil Conway
committed
More minor cosmetic improvements:
- remove another senseless "extern" keyword that was applied to a function definition - change a foo more function signatures from "some_type foo()" to "some_type foo(void)" - rewrite another K&R style function definition - make the type of the "action" function pointer in the KeyWord struct in src/backend/utils/adt/formatting.c more precise
1 parent 1da2bcc commit 7069dbc

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

src/backend/executor/spi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.130 2004/10/12 21:54:37 petere Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.131 2004/10/13 01:25:10 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -348,7 +348,7 @@ SPI_execp(void *plan, Datum *Values, const char *Nulls, int tcount)
348348
* Passing snapshot == InvalidSnapshot will select the normal behavior of
349349
* fetching a new snapshot for each query.
350350
*/
351-
extern int
351+
int
352352
SPI_execute_snapshot(void *plan,
353353
Datum *Values, const char *Nulls,
354354
Snapshot snapshot, Snapshot crosscheck_snapshot,
@@ -1629,13 +1629,13 @@ _SPI_cursor_operation(Portal portal, bool forward, int count,
16291629

16301630

16311631
static MemoryContext
1632-
_SPI_execmem()
1632+
_SPI_execmem(void)
16331633
{
16341634
return MemoryContextSwitchTo(_SPI_current->execCxt);
16351635
}
16361636

16371637
static MemoryContext
1638-
_SPI_procmem()
1638+
_SPI_procmem(void)
16391639
{
16401640
return MemoryContextSwitchTo(_SPI_current->procCxt);
16411641
}

src/backend/port/sysv_shmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.38 2004/09/24 05:27:35 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.39 2004/10/13 01:25:11 neilc Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -143,7 +143,7 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, uint32 size)
143143
#ifdef EXEC_BACKEND
144144
memAddress = shmat(shmid, UsedShmemSegAddr, 0);
145145
#else
146-
memAddress = shmat(shmid, 0, 0);
146+
memAddress = shmat(shmid, NULL, 0);
147147
#endif
148148
#endif
149149

src/backend/utils/adt/formatting.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.78 2004/08/30 02:54:39 momjian Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.79 2004/10/13 01:25:11 neilc Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2004, PostgreSQL Global Development Group
@@ -129,23 +129,25 @@ typedef struct
129129
type; /* prefix / postfix */
130130
} KeySuffix;
131131

132+
typedef struct FormatNode FormatNode;
133+
132134
typedef struct
133135
{
134136
char *name; /* keyword */
135137
/* action for keyword */
136138
int len, /* keyword length */
137-
(*action) (),
139+
(*action) (int arg, char *inout, int suf, int flag, FormatNode *node, void *data),
138140
id; /* keyword id */
139141
bool isitdigit; /* is expected output/input digit */
140142
} KeyWord;
141143

142-
typedef struct
144+
struct FormatNode
143145
{
144146
int type; /* node type */
145147
KeyWord *key; /* if node type is KEYWORD */
146148
int character, /* if node type is CHAR */
147149
suffix; /* keyword suffix */
148-
} FormatNode;
150+
};
149151

150152
#define NODE_TYPE_END 1
151153
#define NODE_TYPE_ACTION 2

src/backend/utils/mb/mbutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* (currently mule internal code (mic) is used)
55
* Tatsuo Ishii
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.47 2004/08/29 05:06:51 momjian Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.48 2004/10/13 01:25:12 neilc Exp $
88
*/
99
#include "postgres.h"
1010

@@ -574,7 +574,7 @@ SetDatabaseEncoding(int encoding)
574574
}
575575

576576
void
577-
SetDefaultClientEncoding()
577+
SetDefaultClientEncoding(void)
578578
{
579579
ClientEncoding = &pg_enc2name_tbl[GetDatabaseEncoding()];
580580
}

src/backend/utils/mb/wstrcmp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@
3939
#include "mb/pg_wchar.h"
4040

4141
int
42-
pg_char_and_wchar_strcmp(s1, s2)
43-
register const char *s1;
44-
register const pg_wchar *s2;
42+
pg_char_and_wchar_strcmp(const char *s1, const pg_wchar *s2)
4543
{
4644
while ((pg_wchar) *s1 == *s2++)
4745
if (*s1++ == 0)

src/interfaces/ecpg/preproc/output.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "extern.h"
44

55
void
6-
output_line_number()
6+
output_line_number(void)
77
{
88
if (input_filename)
99
fprintf(yyout, "\n#line %d \"%s\"\n", yylineno, input_filename);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy