mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Remove un-needed braces around single statements.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.21 1998/05/29 17:00:10 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.22 1998/06/15 19:29:13 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -310,9 +310,7 @@ IpcSemaphoreCreate(IpcSemaphoreKey semKey,
|
||||
exitpg(3);
|
||||
}
|
||||
for (i = 0; i < semNum; i++)
|
||||
{
|
||||
array[i] = semStartValue;
|
||||
}
|
||||
semun.array = array;
|
||||
errStatus = semctl(semId, 0, SETALL, semun);
|
||||
if (errStatus == -1)
|
||||
@@ -513,9 +511,7 @@ IpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission)
|
||||
shmid = PrivateMemoryCreate(memKey, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
shmid = shmget(memKey, size, IPC_CREAT | permission);
|
||||
}
|
||||
|
||||
if (shmid < 0)
|
||||
{
|
||||
@@ -564,9 +560,7 @@ static void
|
||||
IpcMemoryDetach(int status, char *shmaddr)
|
||||
{
|
||||
if (shmdt(shmaddr) < 0)
|
||||
{
|
||||
elog(NOTICE, "IpcMemoryDetach: shmdt(0x%x): %m", shmaddr);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@@ -582,13 +576,9 @@ IpcMemoryAttach(IpcMemoryId memId)
|
||||
char *memAddress;
|
||||
|
||||
if (UsePrivateMemory)
|
||||
{
|
||||
memAddress = (char *) PrivateMemoryAttach(memId);
|
||||
}
|
||||
else
|
||||
{
|
||||
memAddress = (char *) shmat(memId, 0, 0);
|
||||
}
|
||||
|
||||
/* if ( *memAddress == -1) { XXX ??? */
|
||||
if (memAddress == (char *) -1)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.19 1998/05/26 17:29:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.20 1998/06/15 19:29:14 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -189,18 +189,14 @@ InitShmem(unsigned int key, unsigned int size)
|
||||
* allocator and binding table.
|
||||
*/
|
||||
if (!InitSpinLocks(ShmemBootstrap, IPCKeyGetSpinLockSemaphoreKey(key)))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* We have just allocated additional space for two spinlocks. Now
|
||||
* setup the global free space count
|
||||
*/
|
||||
if (ShmemBootstrap)
|
||||
{
|
||||
*ShmemFreeStart = currFreeSpace;
|
||||
}
|
||||
|
||||
/* if ShmemFreeStart is NULL, then the allocator won't work */
|
||||
Assert(*ShmemFreeStart);
|
||||
@@ -256,9 +252,7 @@ InitShmem(unsigned int key, unsigned int size)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert(!ShmemBootstrap);
|
||||
}
|
||||
/* now release the lock acquired in ShmemHashInit */
|
||||
SpinRelease(BindingLock);
|
||||
|
||||
@@ -303,16 +297,12 @@ ShmemAlloc(unsigned long size)
|
||||
*ShmemFreeStart += size;
|
||||
}
|
||||
else
|
||||
{
|
||||
newSpace = NULL;
|
||||
}
|
||||
|
||||
SpinRelease(ShmemLock);
|
||||
|
||||
if (!newSpace)
|
||||
{
|
||||
elog(NOTICE, "ShmemAlloc: out of memory ");
|
||||
}
|
||||
return (newSpace);
|
||||
}
|
||||
|
||||
@@ -420,13 +410,9 @@ ShmemPIDLookup(int pid, SHMEM_OFFSET *locationPtr)
|
||||
}
|
||||
|
||||
if (found)
|
||||
{
|
||||
*locationPtr = result->location;
|
||||
}
|
||||
else
|
||||
{
|
||||
result->location = *locationPtr;
|
||||
}
|
||||
|
||||
SpinRelease(BindingLock);
|
||||
return (TRUE);
|
||||
@@ -473,9 +459,7 @@ ShmemPIDDestroy(int pid)
|
||||
if (found)
|
||||
return (location);
|
||||
else
|
||||
{
|
||||
return (INVALID_OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.9 1997/09/08 02:28:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.10 1998/06/15 19:29:15 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -49,9 +49,7 @@ CreateSharedInvalidationState(IPCKey key)
|
||||
status = SISegmentInit(true, IPCKeyGetSIBufferMemoryBlock(key));
|
||||
|
||||
if (status == -1)
|
||||
{
|
||||
elog(FATAL, "CreateSharedInvalidationState: failed segment init");
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@@ -73,9 +71,7 @@ AttachSharedInvalidationState(IPCKey key)
|
||||
status = SISegmentInit(false, IPCKeyGetSIBufferMemoryBlock(key));
|
||||
|
||||
if (status == -1)
|
||||
{
|
||||
elog(FATAL, "AttachSharedInvalidationState: failed segment init");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -126,13 +122,9 @@ RegisterSharedInvalid(int cacheId, /* XXX */
|
||||
newInvalid.hashIndex = hashIndex;
|
||||
|
||||
if (ItemPointerIsValid(pointer))
|
||||
{
|
||||
ItemPointerCopy(pointer, &newInvalid.pointerData);
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemPointerSetInvalid(&newInvalid.pointerData);
|
||||
}
|
||||
|
||||
SpinAcquire(SInvalLock);
|
||||
if (!SISetDataEntry(shmInvalBuffer, &newInvalid))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.8 1997/09/08 21:47:15 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.9 1998/06/15 19:29:15 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -133,9 +133,7 @@ SIAssignBackendId(SISeg *segInOutP, BackendTag backendTag)
|
||||
(segInOutP->procState[index].limit <
|
||||
stateP->limit ||
|
||||
stateP->tag < backendTag)))
|
||||
{
|
||||
stateP = &segInOutP->procState[index];
|
||||
}
|
||||
}
|
||||
|
||||
/* verify that all "procState" entries checked for matching tags */
|
||||
@@ -664,9 +662,7 @@ SIReadEntryData(SISeg *segP,
|
||||
}
|
||||
/* check whether we can remove dead messages */
|
||||
if (i > MAXNUMMESSAGES)
|
||||
{
|
||||
elog(FATAL, "SIReadEntryData: Invalid segment state");
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
@@ -696,9 +692,7 @@ SIDelExpiredDataEntries(SISeg *segP)
|
||||
{
|
||||
/* this adjusts also the state limits! */
|
||||
if (!SIDelDataEntry(segP))
|
||||
{
|
||||
elog(FATAL, "SIDelExpiredDataEntries: Invalid segment state");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -779,13 +773,9 @@ SISegmentGet(int key, /* the corresponding key for the segment */
|
||||
IpcMemoryId shmid;
|
||||
|
||||
if (create)
|
||||
{
|
||||
shmid = IpcMemoryCreate(key, size, IPCProtection);
|
||||
}
|
||||
else
|
||||
{
|
||||
shmid = IpcMemoryIdGet(key, size);
|
||||
}
|
||||
return (shmid);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.10 1997/09/22 04:20:53 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.11 1998/06/15 19:29:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -157,9 +157,7 @@ SpinRelease(SPINLOCK lockid)
|
||||
S_UNLOCK(&(slckP->shlock));
|
||||
}
|
||||
else
|
||||
{
|
||||
S_UNLOCK(&(slckP->shlock));
|
||||
}
|
||||
S_UNLOCK(&(slckP->exlock));
|
||||
S_UNLOCK(&(slckP->locklock));
|
||||
#ifdef LOCKDEBUG
|
||||
|
||||
Reference in New Issue
Block a user