Mop up from caddr_t -> Datum conversion to make things extra type safe

This commit is contained in:
Peter Eisentraut 2000-10-02 21:45:33 +00:00
parent 416bbbffa3
commit 65577dc83e
4 changed files with 17 additions and 14 deletions

View file

@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pqcomm.c,v 1.102 2000/10/02 19:42:46 petere Exp $ * $Id: pqcomm.c,v 1.103 2000/10/02 21:45:31 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -152,7 +152,7 @@ static char sock_path[MAXPGPATH];
* If a Unix socket is used for communication, explicitly close it. * If a Unix socket is used for communication, explicitly close it.
*/ */
static void static void
StreamDoUnlink() StreamDoUnlink(void)
{ {
Assert(sock_path[0]); Assert(sock_path[0]);
unlink(sock_path); unlink(sock_path);

View file

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.33 2000/10/02 19:42:48 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.34 2000/10/02 21:45:32 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -27,7 +27,7 @@ SISeg *shmInvalBuffer;
static void SISegmentAttach(IpcMemoryId shmid); static void SISegmentAttach(IpcMemoryId shmid);
static void SISegInit(SISeg *segP, int maxBackends); static void SISegInit(SISeg *segP, int maxBackends);
static void CleanupInvalidationState(int status, SISeg *segP); static void CleanupInvalidationState(int status, Datum arg);
static void SISetProcStateInvalid(SISeg *segP); static void SISetProcStateInvalid(SISeg *segP);
/* /*
@ -200,11 +200,14 @@ SIBackendInit(SISeg *segP)
* *
* This function is called via on_shmem_exit() during backend shutdown, * This function is called via on_shmem_exit() during backend shutdown,
* so the caller has NOT acquired the lock for us. * so the caller has NOT acquired the lock for us.
*
* arg is really of type "SISeg*".
*/ */
static void static void
CleanupInvalidationState(int status, CleanupInvalidationState(int status, Datum arg)
SISeg *segP)
{ {
SISeg *segP = (void*) DatumGetPointer(arg);
Assert(PointerIsValid(segP)); Assert(PointerIsValid(segP));
SpinAcquire(SInvalLock); SpinAcquire(SInvalLock);

View file

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.80 2000/10/02 19:42:48 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.81 2000/10/02 21:45:32 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -47,7 +47,7 @@
* This is so that we can support more backends. (system-wide semaphore * This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95 * sets run out pretty fast.) -ay 4/95
* *
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.80 2000/10/02 19:42:48 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.81 2000/10/02 21:45:32 petere Exp $
*/ */
#include "postgres.h" #include "postgres.h"
@ -88,7 +88,7 @@ static PROC_HDR *ProcGlobal = NULL;
PROC *MyProc = NULL; PROC *MyProc = NULL;
static void ProcKill(int exitStatus, int pid); static void ProcKill(int exitStatus, Datum pid);
static void ProcGetNewSemKeyAndNum(IPCKey *key, int *semNum); static void ProcGetNewSemKeyAndNum(IPCKey *key, int *semNum);
static void ProcFreeSem(IpcSemaphoreKey semKey, int semNum); static void ProcFreeSem(IpcSemaphoreKey semKey, int semNum);
@ -396,7 +396,7 @@ ProcRemove(int pid)
* this process. Release any of its held spin locks. * this process. Release any of its held spin locks.
*/ */
static void static void
ProcKill(int exitStatus, int pid) ProcKill(int exitStatus, Datum pid)
{ {
PROC *proc; PROC *proc;
SHMEM_OFFSET location; SHMEM_OFFSET location;
@ -416,7 +416,7 @@ ProcKill(int exitStatus, int pid)
proc = (PROC *) MAKE_PTR(location); proc = (PROC *) MAKE_PTR(location);
Assert(proc == MyProc || pid != MyProcPid); Assert(proc == MyProc || (int)pid != MyProcPid);
MyProc = NULL; MyProc = NULL;

View file

@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.38 2000/10/02 19:42:52 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.39 2000/10/02 21:45:33 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -19,7 +19,7 @@
#include "storage/smgr.h" #include "storage/smgr.h"
static void smgrshutdown(int dummy); static void smgrshutdown(void);
typedef struct f_smgr typedef struct f_smgr
{ {
@ -118,7 +118,7 @@ smgrinit()
} }
static void static void
smgrshutdown(int dummy) smgrshutdown(void)
{ {
int i; int i;