1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Banish caddr_t (mostly), use Datum where appropriate.

This commit is contained in:
Peter Eisentraut
2000-10-02 19:42:56 +00:00
parent a81aef7f25
commit 416bbbffa3
11 changed files with 48 additions and 48 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.63 2000/08/27 21:48:00 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.64 2000/10/02 19:42:47 petere Exp $
*
* NOTES:
*
@@ -38,6 +38,8 @@
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <sys/types.h>
#include <sys/file.h>
#include <sys/param.h>
@@ -46,7 +48,6 @@
#include <unistd.h>
#include <fcntl.h>
#include "postgres.h"
#include "miscadmin.h"
#include "storage/fd.h"
@@ -472,7 +473,7 @@ AllocateVfd(void)
* register proc-exit call to ensure temp files are dropped at
* exit
*/
on_proc_exit(AtEOXact_Files, NULL);
on_proc_exit(AtEOXact_Files, 0);
}
if (VfdCache[0].nextFree == 0)

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.49 2000/07/22 14:49:01 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.50 2000/10/02 19:42:48 petere Exp $
*
* NOTES
*
@@ -25,12 +25,12 @@
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <sys/types.h>
#include <sys/file.h>
#include <errno.h>
#include "postgres.h"
#include "storage/ipc.h"
#include "storage/s_lock.h"
/* In Ultrix, sem.h and shm.h must be included AFTER ipc.h */
@@ -65,7 +65,7 @@ static void IpcMemoryDetach(int status, char *shmaddr);
static struct ONEXIT
{
void (*function) ();
caddr_t arg;
Datum arg;
} on_proc_exit_list[MAX_ON_EXITS], on_shmem_exit_list[MAX_ON_EXITS];
static int on_proc_exit_index,
@@ -182,7 +182,7 @@ shmem_exit(int code)
* ----------------------------------------------------------------
*/
int
on_proc_exit(void (*function) (), caddr_t arg)
on_proc_exit(void (*function) (), Datum arg)
{
if (on_proc_exit_index >= MAX_ON_EXITS)
return -1;
@@ -203,7 +203,7 @@ int
* ----------------------------------------------------------------
*/
int
on_shmem_exit(void (*function) (), caddr_t arg)
on_shmem_exit(void (*function) (), Datum arg)
{
if (on_shmem_exit_index >= MAX_ON_EXITS)
return -1;
@@ -234,8 +234,7 @@ on_exit_reset(void)
/* */
/****************************************************************************/
static void
IPCPrivateSemaphoreKill(int status,
int semId) /* caddr_t */
IPCPrivateSemaphoreKill(int status, int semId)
{
union semun semun;
semun.val = 0; /* unused */
@@ -251,8 +250,7 @@ IPCPrivateSemaphoreKill(int status,
/* */
/****************************************************************************/
static void
IPCPrivateMemoryKill(int status,
int shmId) /* caddr_t */
IPCPrivateMemoryKill(int status, int shmId)
{
if (UsePrivateMemory)
{
@@ -343,7 +341,7 @@ IpcSemaphoreCreate(IpcSemaphoreKey semKey,
}
if (removeOnExit)
on_shmem_exit(IPCPrivateSemaphoreKill, (caddr_t) semId);
on_shmem_exit(IPCPrivateSemaphoreKill, (Datum)semId);
}
#ifdef DEBUG_IPC
@@ -565,7 +563,7 @@ IpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission)
}
/* if (memKey == PrivateIPCKey) */
on_shmem_exit(IPCPrivateMemoryKill, (caddr_t) shmid);
on_shmem_exit(IPCPrivateMemoryKill, (Datum) shmid);
return shmid;
}
@@ -629,7 +627,7 @@ IpcMemoryAttach(IpcMemoryId memId)
}
if (!UsePrivateMemory)
on_shmem_exit(IpcMemoryDetach, (caddr_t) memAddress);
on_shmem_exit(IpcMemoryDetach, PointerGetDatum(memAddress));
return (char *) memAddress;
}

View File

@@ -8,15 +8,15 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.32 2000/05/31 00:28:29 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.33 2000/10/02 19:42:48 petere Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <signal.h>
#include <unistd.h>
#include "postgres.h"
#include "miscadmin.h"
#include "storage/backendid.h"
#include "storage/proc.h"
@@ -189,7 +189,7 @@ SIBackendInit(SISeg *segP)
stateP->procStruct = MAKE_OFFSET(MyProc);
/* register exit routine to mark my entry inactive at exit */
on_shmem_exit(CleanupInvalidationState, (caddr_t) segP);
on_shmem_exit(CleanupInvalidationState, PointerGetDatum(segP));
return 1;
}

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.79 2000/08/29 09:36:44 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.80 2000/10/02 19:42:48 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -47,8 +47,10 @@
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
*
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.79 2000/08/29 09:36:44 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.80 2000/10/02 19:42:48 petere Exp $
*/
#include "postgres.h"
#include <sys/time.h>
#include <unistd.h>
#include <signal.h>
@@ -59,7 +61,6 @@
#include <sys/sem.h>
#endif
#include "postgres.h"
#include "miscadmin.h"
@@ -140,7 +141,7 @@ InitProcGlobal(IPCKey key, int maxBackends)
* Arrange to delete semas on exit --- set this up now so that we
* will clean up if pre-allocation fails...
*/
on_shmem_exit(ProcFreeAllSemaphores, NULL);
on_shmem_exit(ProcFreeAllSemaphores, 0);
/*
* Pre-create the semaphores for the first maxBackends processes,
@@ -306,7 +307,7 @@ InitProcess(IPCKey key)
MyProc->errType = NO_ERROR;
SHMQueueElemInit(&(MyProc->links));
on_shmem_exit(ProcKill, (caddr_t) MyProcPid);
on_shmem_exit(ProcKill, (Datum) MyProcPid);
}
/* -----------------------

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.37 2000/06/19 23:37:08 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.38 2000/10/02 19:42:52 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -112,7 +112,7 @@ smgrinit()
}
/* register the shutdown proc */
on_proc_exit(smgrshutdown, NULL);
on_proc_exit(smgrshutdown, 0);
return SM_SUCCESS;
}