mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +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/storage/ipc/ipc.c,v 1.10 1997/01/08 08:32:01 bryanh Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.11 1997/08/19 21:32:54 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -49,6 +49,8 @@ int UsePrivateMemory = 1;
|
||||
int UsePrivateMemory = 0;
|
||||
#endif
|
||||
|
||||
static void IpcMemoryDetach(int status, char *shmaddr);
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* exit() handling stuff
|
||||
* ----------------------------------------------------------------
|
||||
@@ -312,6 +314,7 @@ IpcSemaphoreCreate(IpcSemaphoreKey semKey,
|
||||
/* */
|
||||
/* note: the xxx_return variables are only used for debugging. */
|
||||
/****************************************************************************/
|
||||
#ifdef NOT_USED
|
||||
static int IpcSemaphoreSet_return;
|
||||
|
||||
void
|
||||
@@ -330,6 +333,7 @@ IpcSemaphoreSet(int semId, int semno, int value)
|
||||
IpcConfigTip();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
/* IpcSemaphoreKill(key) - removes a semaphore */
|
||||
@@ -513,7 +517,7 @@ IpcMemoryIdGet(IpcMemoryKey memKey, uint32 size)
|
||||
/* from a backend address space */
|
||||
/* (only called by backends running under the postmaster) */
|
||||
/****************************************************************************/
|
||||
void
|
||||
static void
|
||||
IpcMemoryDetach(int status, char *shmaddr)
|
||||
{
|
||||
if (shmdt(shmaddr) < 0) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.17 1997/08/17 02:39:54 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.18 1997/08/19 21:33:01 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -45,9 +45,9 @@
|
||||
#if defined(HAS_TEST_AND_SET)
|
||||
|
||||
# if defined(__alpha__) && defined(linux)
|
||||
extern long int tas(slock_t *lock);
|
||||
static long int tas(slock_t *lock);
|
||||
# else
|
||||
extern int tas(slock_t *lock);
|
||||
static int tas(slock_t *lock);
|
||||
#endif
|
||||
|
||||
#if defined (nextstep)
|
||||
@@ -383,7 +383,7 @@ S_INIT_LOCK(unsigned char *addr)
|
||||
|
||||
#if defined(NEED_I386_TAS_ASM)
|
||||
|
||||
int
|
||||
static int
|
||||
tas(slock_t *m)
|
||||
{
|
||||
slock_t res;
|
||||
@@ -415,7 +415,7 @@ S_INIT_LOCK(slock_t *lock)
|
||||
|
||||
#if defined(__alpha__) && defined(linux)
|
||||
|
||||
long int
|
||||
static long int
|
||||
tas(slock_t *m)
|
||||
{
|
||||
slock_t res;
|
||||
@@ -459,7 +459,7 @@ S_INIT_LOCK(slock_t *lock)
|
||||
|
||||
#if defined(linux) && defined(sparc)
|
||||
|
||||
int
|
||||
static int
|
||||
tas(slock_t *m)
|
||||
{
|
||||
slock_t res;
|
||||
@@ -492,7 +492,7 @@ S_INIT_LOCK(slock_t *lock)
|
||||
|
||||
#if defined(NEED_NS32K_TAS_ASM)
|
||||
|
||||
int
|
||||
static int
|
||||
tas(slock_t *m)
|
||||
{
|
||||
slock_t res = 0;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmqueue.c,v 1.2 1996/11/03 05:06:58 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmqueue.c,v 1.3 1997/08/19 21:33:06 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -49,12 +49,14 @@ SHMQueueInit(SHM_QUEUE *queue)
|
||||
* SHMQueueIsDetached -- TRUE if element is not currently
|
||||
* in a queue.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
bool
|
||||
SHMQueueIsDetached(SHM_QUEUE *queue)
|
||||
{
|
||||
Assert(SHM_PTR_VALID(queue));
|
||||
return ((queue)->prev == INVALID_OFFSET);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* SHMQueueElemInit -- clear an element's links
|
||||
@@ -146,6 +148,7 @@ dumpQ(SHM_QUEUE *q, char *s)
|
||||
* SHMQueueInsertHD -- put elem in queue between the queue head
|
||||
* and its "prev" element.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
SHMQueueInsertHD(SHM_QUEUE *queue, SHM_QUEUE *elem)
|
||||
{
|
||||
@@ -168,6 +171,7 @@ SHMQueueInsertHD(SHM_QUEUE *queue, SHM_QUEUE *elem)
|
||||
dumpQ(queue, "in SHMQueueInsertHD: end");
|
||||
#endif /* SHMQUEUE_DEBUG_HD */
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
SHMQueueInsertTL(SHM_QUEUE *queue, SHM_QUEUE *elem)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.4 1997/01/14 01:53:11 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.5 1997/08/19 21:33:08 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -48,13 +48,6 @@ CreateSpinlocks(IPCKey key)
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
bool
|
||||
AttachSpinLocks(IPCKey key)
|
||||
{
|
||||
/* the spin lock shared memory must have been attached by now */
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
bool
|
||||
InitSpinLocks(int init, IPCKey key)
|
||||
{
|
||||
@@ -100,16 +93,26 @@ SpinRelease(SPINLOCK lock)
|
||||
ExclusiveUnlock(lock);
|
||||
}
|
||||
|
||||
bool
|
||||
#else /* HAS_TEST_AND_SET */
|
||||
/* Spinlocks are implemented using SysV semaphores */
|
||||
|
||||
static bool AttachSpinLocks(IPCKey key);
|
||||
static bool SpinIsLocked(SPINLOCK lock);
|
||||
|
||||
|
||||
static bool
|
||||
AttachSpinLocks(IPCKey key)
|
||||
{
|
||||
/* the spin lock shared memory must have been attached by now */
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
static bool
|
||||
SpinIsLocked(SPINLOCK lock)
|
||||
{
|
||||
return(!LockIsFree(lock));
|
||||
}
|
||||
|
||||
#else /* HAS_TEST_AND_SET */
|
||||
/* Spinlocks are implemented using SysV semaphores */
|
||||
|
||||
|
||||
/*
|
||||
* SpinAcquire -- try to grab a spinlock
|
||||
*
|
||||
@@ -135,7 +138,7 @@ SpinRelease(SPINLOCK lock)
|
||||
IpcSemaphoreUnlock(SpinLockId, lock, IpcExclusiveLock);
|
||||
}
|
||||
|
||||
bool
|
||||
static bool
|
||||
SpinIsLocked(SPINLOCK lock)
|
||||
{
|
||||
int semval;
|
||||
@@ -176,7 +179,7 @@ CreateSpinlocks(IPCKey key)
|
||||
/*
|
||||
* Attach to existing spinlock set
|
||||
*/
|
||||
bool
|
||||
static bool
|
||||
AttachSpinLocks(IPCKey key)
|
||||
{
|
||||
IpcSemaphoreId id;
|
||||
|
||||
Reference in New Issue
Block a user