This patch makes another set of small 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

Barring any objections I intend to apply this to HEAD tomorrow.

-Neil

Index: src/backend/executor/spi.c
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/backend/executor/spi.c,v
retrieving revision 1.129
diff -c -r1.129 spi.c
*** src/backend/executor/spi.c	16 Sep 2004 20:17:20 -0000	1.129
--- src/backend/executor/spi.c	10 Oct 2004 23:46:10 -0000
***************
*** 348,354 ****
   * Passing snapshot == InvalidSnapshot will select the normal behavior of
   * fetching a new snapshot for each query.
   */
! extern int
  SPI_execute_snapshot(void *plan,
  					 Datum *Values, const char *Nulls,
  					 Snapshot snapshot, Snapshot crosscheck_snapshot,
--- 348,354 ----
   * Passing snapshot == InvalidSnapshot will select the normal behavior of
   * fetching a new snapshot for each query.
   */
! int
  SPI_execute_snapshot(void *plan,
  					 Datum *Values, const char *Nulls,
  					 Snapshot snapshot, Snapshot crosscheck_snapshot,
***************
*** 1629,1641 ****
  
  
  static MemoryContext
! _SPI_execmem()
  {
  	return MemoryContextSwitchTo(_SPI_current->execCxt);
  }
  
  static MemoryContext
! _SPI_procmem()
  {
  	return MemoryContextSwitchTo(_SPI_current->procCxt);
  }
--- 1629,1641 ----
  
  
  static MemoryContext
! _SPI_execmem(void)
  {
  	return MemoryContextSwitchTo(_SPI_current->execCxt);
  }
  
  static MemoryContext
! _SPI_procmem(void)
  {
  	return MemoryContextSwitchTo(_SPI_current->procCxt);
  }
Index: src/backend/port/sysv_shmem.c
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/backend/port/sysv_shmem.c,v
retrieving revision 1.38
diff -c -r1.38 sysv_shmem.c
*** src/backend/port/sysv_shmem.c	24 Sep 2004 05:27:35 -0000	1.38
--- src/backend/port/sysv_shmem.c	10 Oct 2004 23:46:10 -0000
***************
*** 143,149 ****
  #ifdef EXEC_BACKEND
  	memAddress = shmat(shmid, UsedShmemSegAddr, 0);
  #else
! 	memAddress = shmat(shmid, 0, 0);
  #endif
  #endif
  
--- 143,149 ----
  #ifdef EXEC_BACKEND
  	memAddress = shmat(shmid, UsedShmemSegAddr, 0);
  #else
! 	memAddress = shmat(shmid, NULL, 0);
  #endif
  #endif
  
Index: src/backend/utils/adt/formatting.c
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/backend/utils/adt/formatting.c,v
retrieving revision 1.78
diff -c -r1.78 formatting.c
*** src/backend/utils/adt/formatting.c	30 Aug 2004 02:54:39 -0000	1.78
--- src/backend/utils/adt/formatting.c	10 Oct 2004 23:46:10 -0000
***************
*** 129,151 ****
  				type;			/* prefix / postfix			*/
  } KeySuffix;
  
  typedef struct
  {
  	char	   *name;			/* keyword			*/
  	/* action for keyword		*/
  	int			len,			/* keyword length		*/
! 				(*action) (),
  				id;				/* keyword id			*/
  	bool		isitdigit;		/* is expected output/input digit */
  } KeyWord;
  
! typedef struct
  {
  	int			type;			/* node type			*/
  	KeyWord    *key;			/* if node type is KEYWORD	*/
  	int			character,		/* if node type is CHAR		*/
  				suffix;			/* keyword suffix		*/
! } FormatNode;
  
  #define NODE_TYPE_END		1
  #define NODE_TYPE_ACTION	2
--- 129,153 ----
  				type;			/* prefix / postfix			*/
  } KeySuffix;
  
+ typedef struct FormatNode FormatNode;
+ 
  typedef struct
  {
  	char	   *name;			/* keyword			*/
  	/* action for keyword		*/
  	int			len,			/* keyword length		*/
! 				(*action) (int arg, char *inout, int suf, int flag, FormatNode *node, void *data),
  				id;				/* keyword id			*/
  	bool		isitdigit;		/* is expected output/input digit */
  } KeyWord;
  
! struct FormatNode
  {
  	int			type;			/* node type			*/
  	KeyWord    *key;			/* if node type is KEYWORD	*/
  	int			character,		/* if node type is CHAR		*/
  				suffix;			/* keyword suffix		*/
! };
  
  #define NODE_TYPE_END		1
  #define NODE_TYPE_ACTION	2
Index: src/backend/utils/mb/mbutils.c
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/backend/utils/mb/mbutils.c,v
retrieving revision 1.47
diff -c -r1.47 mbutils.c
*** src/backend/utils/mb/mbutils.c	29 Aug 2004 05:06:51 -0000	1.47
--- src/backend/utils/mb/mbutils.c	10 Oct 2004 23:46:10 -0000
***************
*** 574,580 ****
  }
  
  void
! SetDefaultClientEncoding()
  {
  	ClientEncoding = &pg_enc2name_tbl[GetDatabaseEncoding()];
  }
--- 574,580 ----
  }
  
  void
! SetDefaultClientEncoding(void)
  {
  	ClientEncoding = &pg_enc2name_tbl[GetDatabaseEncoding()];
  }
Index: src/backend/utils/mb/wstrcmp.c
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/backend/utils/mb/wstrcmp.c,v
retrieving revision 1.6
diff -c -r1.6 wstrcmp.c
*** src/backend/utils/mb/wstrcmp.c	25 Oct 2001 05:49:51 -0000	1.6
--- src/backend/utils/mb/wstrcmp.c	10 Oct 2004 23:46:10 -0000
***************
*** 39,47 ****
  #include "mb/pg_wchar.h"
  
  int
! pg_char_and_wchar_strcmp(s1, s2)
! register const char *s1;
! register const pg_wchar *s2;
  {
  	while ((pg_wchar) *s1 == *s2++)
  		if (*s1++ == 0)
--- 39,45 ----
  #include "mb/pg_wchar.h"
  
  int
! pg_char_and_wchar_strcmp(const char *s1, const pg_wchar *s2)
  {
  	while ((pg_wchar) *s1 == *s2++)
  		if (*s1++ == 0)
Index: src/interfaces/ecpg/preproc/output.c
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/interfaces/ecpg/preproc/output.c,v
retrieving revision 1.11
diff -c -r1.11 output.c
*** src/interfaces/ecpg/preproc/output.c	25 Jun 2003 10:44:21 -0000	1.11
--- src/interfaces/ecpg/preproc/output.c	10 Oct 2004 23:46:10 -0000
***************
*** 3,9 ****
  #include "extern.h"
  
  void
! output_line_number()
  {
  	if (input_filename)
  		fprintf(yyout, "\n#line %d \"%s\"\n", yylineno, input_filename);
--- 3,9 ----
  #include "extern.h"
  
  void
! output_line_number(void)
  {
  	if (input_filename)
  		fprintf(yyout, "\n#line %d \"%s\"\n", yylineno, input_filename);
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to