Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit416bbbf

Browse files
committed
Banish caddr_t (mostly), use Datum where appropriate.
1 parenta81aef7 commit416bbbf

File tree

11 files changed

+48
-48
lines changed

11 files changed

+48
-48
lines changed

‎src/backend/commands/async.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.68 2000/08/29 09:36:39 petere Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.69 2000/10/02 19:42:45 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -70,14 +70,14 @@
7070
*-------------------------------------------------------------------------
7171
*/
7272

73+
#include"postgres.h"
74+
7375
#include<unistd.h>
7476
#include<signal.h>
7577
#include<errno.h>
7678
#include<sys/types.h>
7779
#include<netinet/in.h>
7880

79-
#include"postgres.h"
80-
8181
#include"access/heapam.h"
8282
#include"catalog/catname.h"
8383
#include"catalog/indexing.h"
@@ -255,7 +255,7 @@ Async_Listen(char *relname, int pid)
255255
*/
256256
if (!unlistenExitRegistered)
257257
{
258-
if (on_shmem_exit(Async_UnlistenOnExit,(caddr_t)NULL)<0)
258+
if (on_shmem_exit(Async_UnlistenOnExit,0)<0)
259259
elog(NOTICE,"Async_Listen: out of shmem_exit slots");
260260
unlistenExitRegistered=1;
261261
}
@@ -373,7 +373,7 @@ Async_UnlistenAll()
373373
*--------------------------------------------------------------
374374
*/
375375
staticvoid
376-
Async_UnlistenOnExit()
376+
Async_UnlistenOnExit(void)
377377
{
378378

379379
/*

‎src/backend/libpq/pqcomm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
3030
* Portions Copyright (c) 1994, Regents of the University of California
3131
*
32-
*$Id: pqcomm.c,v 1.101 2000/09/27 15:17:54 petere Exp $
32+
*$Id: pqcomm.c,v 1.102 2000/10/02 19:42:46 petere Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -260,7 +260,7 @@ StreamServerPort(int family, unsigned short portName, int *fdP)
260260

261261
if (family==AF_UNIX)
262262
{
263-
on_proc_exit(StreamDoUnlink,NULL);
263+
on_proc_exit(StreamDoUnlink,0);
264264

265265
/*
266266
* Open the socket file and get an advisory lock on it. The

‎src/backend/postmaster/postmaster.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.166 2000/09/06 19:54:46 petere Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.167 2000/10/02 19:42:46 petere Exp $
1515
*
1616
* NOTES
1717
*
@@ -628,7 +628,7 @@ PostmasterMain(int argc, char *argv[])
628628
/*
629629
* register clean up proc
630630
*/
631-
on_proc_exit(UnlinkPidFile,NULL);
631+
on_proc_exit(UnlinkPidFile,0);
632632
}
633633

634634
/*
@@ -727,7 +727,7 @@ pmdaemonize(int argc, char *argv[])
727727
/*
728728
* register clean up proc
729729
*/
730-
on_proc_exit(UnlinkPidFile,NULL);
730+
on_proc_exit(UnlinkPidFile,0);
731731
}
732732

733733

‎src/backend/storage/file/fd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.63 2000/08/27 21:48:00 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.64 2000/10/02 19:42:47 petere Exp $
1111
*
1212
* NOTES:
1313
*
@@ -38,6 +38,8 @@
3838
*-------------------------------------------------------------------------
3939
*/
4040

41+
#include"postgres.h"
42+
4143
#include<sys/types.h>
4244
#include<sys/file.h>
4345
#include<sys/param.h>
@@ -46,7 +48,6 @@
4648
#include<unistd.h>
4749
#include<fcntl.h>
4850

49-
#include"postgres.h"
5051
#include"miscadmin.h"
5152
#include"storage/fd.h"
5253

@@ -472,7 +473,7 @@ AllocateVfd(void)
472473
* register proc-exit call to ensure temp files are dropped at
473474
* exit
474475
*/
475-
on_proc_exit(AtEOXact_Files,NULL);
476+
on_proc_exit(AtEOXact_Files,0);
476477
}
477478

478479
if (VfdCache[0].nextFree==0)

‎src/backend/storage/ipc/ipc.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.49 2000/07/22 14:49:01 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.50 2000/10/02 19:42:48 petere Exp $
1212
*
1313
* NOTES
1414
*
@@ -25,12 +25,12 @@
2525
*
2626
*-------------------------------------------------------------------------
2727
*/
28+
#include"postgres.h"
29+
2830
#include<sys/types.h>
2931
#include<sys/file.h>
3032
#include<errno.h>
3133

32-
#include"postgres.h"
33-
3434
#include"storage/ipc.h"
3535
#include"storage/s_lock.h"
3636
/* In Ultrix, sem.h and shm.h must be included AFTER ipc.h */
@@ -65,7 +65,7 @@ static void IpcMemoryDetach(int status, char *shmaddr);
6565
staticstructONEXIT
6666
{
6767
void(*function) ();
68-
caddr_targ;
68+
Datumarg;
6969
}on_proc_exit_list[MAX_ON_EXITS],on_shmem_exit_list[MAX_ON_EXITS];
7070

7171
staticinton_proc_exit_index,
@@ -182,7 +182,7 @@ shmem_exit(int code)
182182
* ----------------------------------------------------------------
183183
*/
184184
int
185-
on_proc_exit(void (*function) (),caddr_targ)
185+
on_proc_exit(void (*function) (),Datumarg)
186186
{
187187
if (on_proc_exit_index >=MAX_ON_EXITS)
188188
return-1;
@@ -203,7 +203,7 @@ int
203203
* ----------------------------------------------------------------
204204
*/
205205
int
206-
on_shmem_exit(void (*function) (),caddr_targ)
206+
on_shmem_exit(void (*function) (),Datumarg)
207207
{
208208
if (on_shmem_exit_index >=MAX_ON_EXITS)
209209
return-1;
@@ -234,8 +234,7 @@ on_exit_reset(void)
234234
/**/
235235
/****************************************************************************/
236236
staticvoid
237-
IPCPrivateSemaphoreKill(intstatus,
238-
intsemId)/* caddr_t */
237+
IPCPrivateSemaphoreKill(intstatus,intsemId)
239238
{
240239
unionsemunsemun;
241240
semun.val=0;/* unused */
@@ -251,8 +250,7 @@ IPCPrivateSemaphoreKill(int status,
251250
/**/
252251
/****************************************************************************/
253252
staticvoid
254-
IPCPrivateMemoryKill(intstatus,
255-
intshmId)/* caddr_t */
253+
IPCPrivateMemoryKill(intstatus,intshmId)
256254
{
257255
if (UsePrivateMemory)
258256
{
@@ -343,7 +341,7 @@ IpcSemaphoreCreate(IpcSemaphoreKey semKey,
343341
}
344342

345343
if (removeOnExit)
346-
on_shmem_exit(IPCPrivateSemaphoreKill, (caddr_t)semId);
344+
on_shmem_exit(IPCPrivateSemaphoreKill, (Datum)semId);
347345
}
348346

349347
#ifdefDEBUG_IPC
@@ -565,7 +563,7 @@ IpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission)
565563
}
566564

567565
/* if (memKey == PrivateIPCKey) */
568-
on_shmem_exit(IPCPrivateMemoryKill, (caddr_t)shmid);
566+
on_shmem_exit(IPCPrivateMemoryKill, (Datum)shmid);
569567

570568
returnshmid;
571569
}
@@ -629,7 +627,7 @@ IpcMemoryAttach(IpcMemoryId memId)
629627
}
630628

631629
if (!UsePrivateMemory)
632-
on_shmem_exit(IpcMemoryDetach,(caddr_t)memAddress);
630+
on_shmem_exit(IpcMemoryDetach,PointerGetDatum(memAddress));
633631

634632
return (char*)memAddress;
635633
}

‎src/backend/storage/ipc/sinvaladt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.32 2000/05/31 00:28:29 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.33 2000/10/02 19:42:48 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
15+
#include"postgres.h"
16+
1517
#include<signal.h>
1618
#include<unistd.h>
1719

18-
#include"postgres.h"
19-
2020
#include"miscadmin.h"
2121
#include"storage/backendid.h"
2222
#include"storage/proc.h"
@@ -189,7 +189,7 @@ SIBackendInit(SISeg *segP)
189189
stateP->procStruct=MAKE_OFFSET(MyProc);
190190

191191
/* register exit routine to mark my entry inactive at exit */
192-
on_shmem_exit(CleanupInvalidationState,(caddr_t)segP);
192+
on_shmem_exit(CleanupInvalidationState,PointerGetDatum(segP));
193193

194194
return1;
195195
}

‎src/backend/storage/lmgr/proc.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.79 2000/08/29 09:36:44 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.80 2000/10/02 19:42:48 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -47,8 +47,10 @@
4747
*This is so that we can support more backends. (system-wide semaphore
4848
*sets run out pretty fast.) -ay 4/95
4949
*
50-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.79 2000/08/29 09:36:44 petere Exp $
50+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.80 2000/10/02 19:42:48 petere Exp $
5151
*/
52+
#include"postgres.h"
53+
5254
#include<sys/time.h>
5355
#include<unistd.h>
5456
#include<signal.h>
@@ -59,7 +61,6 @@
5961
#include<sys/sem.h>
6062
#endif
6163

62-
#include"postgres.h"
6364
#include"miscadmin.h"
6465

6566

@@ -140,7 +141,7 @@ InitProcGlobal(IPCKey key, int maxBackends)
140141
* Arrange to delete semas on exit --- set this up now so that we
141142
* will clean up if pre-allocation fails...
142143
*/
143-
on_shmem_exit(ProcFreeAllSemaphores,NULL);
144+
on_shmem_exit(ProcFreeAllSemaphores,0);
144145

145146
/*
146147
* Pre-create the semaphores for the first maxBackends processes,
@@ -306,7 +307,7 @@ InitProcess(IPCKey key)
306307
MyProc->errType=NO_ERROR;
307308
SHMQueueElemInit(&(MyProc->links));
308309

309-
on_shmem_exit(ProcKill, (caddr_t)MyProcPid);
310+
on_shmem_exit(ProcKill, (Datum)MyProcPid);
310311
}
311312

312313
/* -----------------------

‎src/backend/storage/smgr/smgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.37 2000/06/19 23:37:08 tgl Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.38 2000/10/02 19:42:52 petere Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -112,7 +112,7 @@ smgrinit()
112112
}
113113

114114
/* register the shutdown proc */
115-
on_proc_exit(smgrshutdown,NULL);
115+
on_proc_exit(smgrshutdown,0);
116116

117117
returnSM_SUCCESS;
118118
}

‎src/backend/tcop/postgres.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.175 2000/09/06 14:15:21 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.176 2000/10/02 19:42:53 petere Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1284,7 +1284,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
12841284
/*
12851285
* Register clean up proc.
12861286
*/
1287-
on_proc_exit(UnlinkPidFile,NULL);
1287+
on_proc_exit(UnlinkPidFile,0);
12881288

12891289
BaseInit();
12901290
snprintf(XLogDir,MAXPGPATH,"%s/pg_xlog",DataDir);
@@ -1376,7 +1376,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
13761376
reset_client_encoding();
13771377
#endif
13781378

1379-
on_shmem_exit(remove_all_temp_relations,NULL);
1379+
on_shmem_exit(remove_all_temp_relations,0);
13801380

13811381
/*
13821382
* Send this backend's cancellation info to the frontend.
@@ -1397,7 +1397,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
13971397
if (!IsUnderPostmaster)
13981398
{
13991399
puts("\nPOSTGRES backend interactive interface ");
1400-
puts("$Revision: 1.175 $ $Date: 2000/09/06 14:15:21 $\n");
1400+
puts("$Revision: 1.176 $ $Date: 2000/10/02 19:42:53 $\n");
14011401
}
14021402

14031403
/*

‎src/backend/utils/init/postinit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.66 2000/09/19 18:17:57 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.67 2000/10/02 19:42:54 petere Exp $
1212
*
1313
*
1414
*-------------------------------------------------------------------------
@@ -232,7 +232,7 @@ InitPostgres(const char *dbname, const char *username)
232232

233233
#ifndefXLOG
234234
if (!TransactionFlushEnabled())
235-
on_shmem_exit(FlushBufferPool,(caddr_t)NULL);
235+
on_shmem_exit(FlushBufferPool,0);
236236
#endif
237237

238238
SetDatabaseName(dbname);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp