mirror of
https://github.com/postgres/postgres.git
synced 2025-11-18 02:02:55 +03:00
Make functions static where possible, enclose unused functions in #ifdef NOT_USED.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.4 1996/11/10 03:03:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.5 1997/08/19 21:35:54 momjian Exp $
|
||||
*
|
||||
* NOTE
|
||||
* XXX This is a preliminary implementation which lacks fail-fast
|
||||
@@ -25,6 +25,10 @@
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
static void AllocPointerDump(AllocPointer pointer);
|
||||
static int AllocSetIterate(AllocSet set,
|
||||
void (*function)(AllocPointer pointer));
|
||||
|
||||
#undef AllocSetReset
|
||||
#undef malloc
|
||||
#undef free
|
||||
@@ -273,7 +277,7 @@ AllocSetRealloc(AllocSet set, AllocPointer pointer, Size size)
|
||||
* Exceptions:
|
||||
* BadArg if set is invalid.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
AllocSetIterate(AllocSet set,
|
||||
void (*function)(AllocPointer pointer))
|
||||
{
|
||||
@@ -295,6 +299,7 @@ AllocSetIterate(AllocSet set,
|
||||
return (count);
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
int
|
||||
AllocSetCount(AllocSet set)
|
||||
{
|
||||
@@ -310,6 +315,7 @@ AllocSetCount(AllocSet set)
|
||||
}
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Private routines
|
||||
@@ -367,7 +373,7 @@ AllocPointerGetNext(AllocPointer pointer)
|
||||
* XXX AllocPointerDump --
|
||||
* Displays allocated pointer.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AllocPointerDump(AllocPointer pointer)
|
||||
{
|
||||
printf("\t%-10ld@ %0#lx\n", ((long*)pointer)[-1], (long)pointer); /* XXX */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.2 1996/11/08 06:00:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.3 1997/08/19 21:35:57 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -281,6 +281,7 @@ MemoryContextRealloc(MemoryContext context,
|
||||
* ???
|
||||
* BadArgumentsErr if firstTime is true for subsequent calls.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
char*
|
||||
MemoryContextGetName(MemoryContext context)
|
||||
{
|
||||
@@ -289,6 +290,7 @@ MemoryContextGetName(MemoryContext context)
|
||||
|
||||
return (context->method->getName(context));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PointerGetAllocSize --
|
||||
@@ -301,6 +303,7 @@ MemoryContextGetName(MemoryContext context)
|
||||
* ???
|
||||
* BadArgumentsErr if firstTime is true for subsequent calls.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
Size
|
||||
PointerGetAllocSize(Pointer pointer)
|
||||
{
|
||||
@@ -309,6 +312,7 @@ PointerGetAllocSize(Pointer pointer)
|
||||
|
||||
return (PSIZE(pointer));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* MemoryContextSwitchTo --
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.1.1.1 1996/07/09 06:22:09 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.2 1997/08/19 21:35:59 momjian Exp $
|
||||
*
|
||||
* NOTE
|
||||
* XXX This is a preliminary implementation which lacks fail-fast
|
||||
@@ -89,6 +89,7 @@ OrderedSetGetHead(OrderedSet set)
|
||||
/*
|
||||
* OrderedSetGetTail --
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
Pointer
|
||||
OrderedSetGetTail(OrderedSet set)
|
||||
{
|
||||
@@ -100,6 +101,7 @@ OrderedSetGetTail(OrderedSet set)
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* OrderedElemGetPredecessor --
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.4 1997/08/12 22:54:57 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.5 1997/08/19 21:36:04 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -91,6 +91,12 @@
|
||||
|
||||
#include "utils/portal.h"
|
||||
|
||||
static void CollectNamedPortals(Portal *portalP, int destroy);
|
||||
static Portal PortalHeapMemoryGetPortal(PortalHeapMemory context);
|
||||
static PortalVariableMemory PortalHeapMemoryGetVariableMemory(PortalHeapMemory context);
|
||||
static void PortalResetHeapMemory(Portal portal);
|
||||
static Portal PortalVariableMemoryGetPortal(PortalVariableMemory context);
|
||||
|
||||
/* ----------------
|
||||
* ALLOCFREE_ERROR_ABORT
|
||||
* define this if you want a core dump when you try to
|
||||
@@ -413,7 +419,7 @@ PortalNameIsSpecial(char *pname)
|
||||
* entry *before* we destroy anything (destroying updates the hashtable
|
||||
* and screws up the sequential walk of the table). -mer 17 Aug 1992
|
||||
*/
|
||||
void
|
||||
static void
|
||||
CollectNamedPortals(Portal *portalP, int destroy)
|
||||
{
|
||||
static Portal *portalList = (Portal *)NULL;
|
||||
@@ -800,7 +806,7 @@ PortalDestroy(Portal *portalP)
|
||||
* BadArg if mode is invalid.
|
||||
* ----------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
PortalResetHeapMemory(Portal portal)
|
||||
{
|
||||
PortalHeapMemory context;
|
||||
@@ -929,7 +935,7 @@ PortalGetHeapMemory(Portal portal)
|
||||
* BadState if called when disabled.
|
||||
* BadArg if context is invalid.
|
||||
*/
|
||||
Portal
|
||||
static Portal
|
||||
PortalVariableMemoryGetPortal(PortalVariableMemory context)
|
||||
{
|
||||
return ((Portal)((char *)context - offsetof (PortalD, variable)));
|
||||
@@ -943,7 +949,7 @@ PortalVariableMemoryGetPortal(PortalVariableMemory context)
|
||||
* BadState if called when disabled.
|
||||
* BadArg if context is invalid.
|
||||
*/
|
||||
Portal
|
||||
static Portal
|
||||
PortalHeapMemoryGetPortal(PortalHeapMemory context)
|
||||
{
|
||||
return ((Portal)((char *)context - offsetof (PortalD, heap)));
|
||||
@@ -957,6 +963,7 @@ PortalHeapMemoryGetPortal(PortalHeapMemory context)
|
||||
* BadState if called when disabled.
|
||||
* BadArg if context is invalid.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
PortalHeapMemory
|
||||
PortalVariableMemoryGetHeapMemory(PortalVariableMemory context)
|
||||
{
|
||||
@@ -964,6 +971,7 @@ PortalVariableMemoryGetHeapMemory(PortalVariableMemory context)
|
||||
- offsetof (PortalD, variable)
|
||||
+ offsetof (PortalD, heap)));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PortalHeapMemoryGetVariableMemory --
|
||||
@@ -973,7 +981,7 @@ PortalVariableMemoryGetHeapMemory(PortalVariableMemory context)
|
||||
* BadState if called when disabled.
|
||||
* BadArg if context is invalid.
|
||||
*/
|
||||
PortalVariableMemory
|
||||
static PortalVariableMemory
|
||||
PortalHeapMemoryGetVariableMemory(PortalHeapMemory context)
|
||||
{
|
||||
return ((PortalVariableMemory)((char *)context
|
||||
|
||||
Reference in New Issue
Block a user