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
This commit is contained in:
parent
1da2bccabb
commit
7069dbcc31
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.130 2004/10/12 21:54:37 petere Exp $
|
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.131 2004/10/13 01:25:10 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -348,7 +348,7 @@ SPI_execp(void *plan, Datum *Values, const char *Nulls, int tcount)
|
|||||||
* Passing snapshot == InvalidSnapshot will select the normal behavior of
|
* Passing snapshot == InvalidSnapshot will select the normal behavior of
|
||||||
* fetching a new snapshot for each query.
|
* fetching a new snapshot for each query.
|
||||||
*/
|
*/
|
||||||
extern int
|
int
|
||||||
SPI_execute_snapshot(void *plan,
|
SPI_execute_snapshot(void *plan,
|
||||||
Datum *Values, const char *Nulls,
|
Datum *Values, const char *Nulls,
|
||||||
Snapshot snapshot, Snapshot crosscheck_snapshot,
|
Snapshot snapshot, Snapshot crosscheck_snapshot,
|
||||||
@ -1629,13 +1629,13 @@ _SPI_cursor_operation(Portal portal, bool forward, int count,
|
|||||||
|
|
||||||
|
|
||||||
static MemoryContext
|
static MemoryContext
|
||||||
_SPI_execmem()
|
_SPI_execmem(void)
|
||||||
{
|
{
|
||||||
return MemoryContextSwitchTo(_SPI_current->execCxt);
|
return MemoryContextSwitchTo(_SPI_current->execCxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static MemoryContext
|
static MemoryContext
|
||||||
_SPI_procmem()
|
_SPI_procmem(void)
|
||||||
{
|
{
|
||||||
return MemoryContextSwitchTo(_SPI_current->procCxt);
|
return MemoryContextSwitchTo(_SPI_current->procCxt);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.38 2004/09/24 05:27:35 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.39 2004/10/13 01:25:11 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -143,7 +143,7 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, uint32 size)
|
|||||||
#ifdef EXEC_BACKEND
|
#ifdef EXEC_BACKEND
|
||||||
memAddress = shmat(shmid, UsedShmemSegAddr, 0);
|
memAddress = shmat(shmid, UsedShmemSegAddr, 0);
|
||||||
#else
|
#else
|
||||||
memAddress = shmat(shmid, 0, 0);
|
memAddress = shmat(shmid, NULL, 0);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
* formatting.c
|
* formatting.c
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.78 2004/08/30 02:54:39 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.79 2004/10/13 01:25:11 neilc Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Portions Copyright (c) 1999-2004, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1999-2004, PostgreSQL Global Development Group
|
||||||
@ -129,23 +129,25 @@ typedef struct
|
|||||||
type; /* prefix / postfix */
|
type; /* prefix / postfix */
|
||||||
} KeySuffix;
|
} KeySuffix;
|
||||||
|
|
||||||
|
typedef struct FormatNode FormatNode;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char *name; /* keyword */
|
char *name; /* keyword */
|
||||||
/* action for keyword */
|
/* action for keyword */
|
||||||
int len, /* keyword length */
|
int len, /* keyword length */
|
||||||
(*action) (),
|
(*action) (int arg, char *inout, int suf, int flag, FormatNode *node, void *data),
|
||||||
id; /* keyword id */
|
id; /* keyword id */
|
||||||
bool isitdigit; /* is expected output/input digit */
|
bool isitdigit; /* is expected output/input digit */
|
||||||
} KeyWord;
|
} KeyWord;
|
||||||
|
|
||||||
typedef struct
|
struct FormatNode
|
||||||
{
|
{
|
||||||
int type; /* node type */
|
int type; /* node type */
|
||||||
KeyWord *key; /* if node type is KEYWORD */
|
KeyWord *key; /* if node type is KEYWORD */
|
||||||
int character, /* if node type is CHAR */
|
int character, /* if node type is CHAR */
|
||||||
suffix; /* keyword suffix */
|
suffix; /* keyword suffix */
|
||||||
} FormatNode;
|
};
|
||||||
|
|
||||||
#define NODE_TYPE_END 1
|
#define NODE_TYPE_END 1
|
||||||
#define NODE_TYPE_ACTION 2
|
#define NODE_TYPE_ACTION 2
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* (currently mule internal code (mic) is used)
|
* (currently mule internal code (mic) is used)
|
||||||
* Tatsuo Ishii
|
* Tatsuo Ishii
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.47 2004/08/29 05:06:51 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.48 2004/10/13 01:25:12 neilc Exp $
|
||||||
*/
|
*/
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
@ -574,7 +574,7 @@ SetDatabaseEncoding(int encoding)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SetDefaultClientEncoding()
|
SetDefaultClientEncoding(void)
|
||||||
{
|
{
|
||||||
ClientEncoding = &pg_enc2name_tbl[GetDatabaseEncoding()];
|
ClientEncoding = &pg_enc2name_tbl[GetDatabaseEncoding()];
|
||||||
}
|
}
|
||||||
|
@ -39,9 +39,7 @@
|
|||||||
#include "mb/pg_wchar.h"
|
#include "mb/pg_wchar.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
pg_char_and_wchar_strcmp(s1, s2)
|
pg_char_and_wchar_strcmp(const char *s1, const pg_wchar *s2)
|
||||||
register const char *s1;
|
|
||||||
register const pg_wchar *s2;
|
|
||||||
{
|
{
|
||||||
while ((pg_wchar) *s1 == *s2++)
|
while ((pg_wchar) *s1 == *s2++)
|
||||||
if (*s1++ == 0)
|
if (*s1++ == 0)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
output_line_number()
|
output_line_number(void)
|
||||||
{
|
{
|
||||||
if (input_filename)
|
if (input_filename)
|
||||||
fprintf(yyout, "\n#line %d \"%s\"\n", yylineno, input_filename);
|
fprintf(yyout, "\n#line %d \"%s\"\n", yylineno, input_filename);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user