Skip to content

Commit 65577dc

Browse files
committed
Mop up from caddr_t -> Datum conversion to make things extra type safe
1 parent 416bbbf commit 65577dc

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

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.102 2000/10/02 19:42:46 petere Exp $
32+
* $Id: pqcomm.c,v 1.103 2000/10/02 21:45:31 petere Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -152,7 +152,7 @@ static char sock_path[MAXPGPATH];
152152
* If a Unix socket is used for communication, explicitly close it.
153153
*/
154154
static void
155-
StreamDoUnlink()
155+
StreamDoUnlink(void)
156156
{
157157
Assert(sock_path[0]);
158158
unlink(sock_path);

src/backend/storage/ipc/sinvaladt.c

Lines changed: 7 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/storage/ipc/sinvaladt.c,v 1.33 2000/10/02 19:42:48 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.34 2000/10/02 21:45:32 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -27,7 +27,7 @@ SISeg *shmInvalBuffer;
2727

2828
static void SISegmentAttach(IpcMemoryId shmid);
2929
static void SISegInit(SISeg *segP, int maxBackends);
30-
static void CleanupInvalidationState(int status, SISeg *segP);
30+
static void CleanupInvalidationState(int status, Datum arg);
3131
static void SISetProcStateInvalid(SISeg *segP);
3232

3333
/*
@@ -200,11 +200,14 @@ SIBackendInit(SISeg *segP)
200200
*
201201
* This function is called via on_shmem_exit() during backend shutdown,
202202
* so the caller has NOT acquired the lock for us.
203+
*
204+
* arg is really of type "SISeg*".
203205
*/
204206
static void
205-
CleanupInvalidationState(int status,
206-
SISeg *segP)
207+
CleanupInvalidationState(int status, Datum arg)
207208
{
209+
SISeg *segP = (void*) DatumGetPointer(arg);
210+
208211
Assert(PointerIsValid(segP));
209212

210213
SpinAcquire(SInvalLock);

src/backend/storage/lmgr/proc.c

Lines changed: 5 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.80 2000/10/02 19:42:48 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.81 2000/10/02 21:45:32 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -47,7 +47,7 @@
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.80 2000/10/02 19:42:48 petere Exp $
50+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.81 2000/10/02 21:45:32 petere Exp $
5151
*/
5252
#include "postgres.h"
5353

@@ -88,7 +88,7 @@ static PROC_HDR *ProcGlobal = NULL;
8888

8989
PROC *MyProc = NULL;
9090

91-
static void ProcKill(int exitStatus, int pid);
91+
static void ProcKill(int exitStatus, Datum pid);
9292
static void ProcGetNewSemKeyAndNum(IPCKey *key, int *semNum);
9393
static void ProcFreeSem(IpcSemaphoreKey semKey, int semNum);
9494

@@ -396,7 +396,7 @@ ProcRemove(int pid)
396396
* this process. Release any of its held spin locks.
397397
*/
398398
static void
399-
ProcKill(int exitStatus, int pid)
399+
ProcKill(int exitStatus, Datum pid)
400400
{
401401
PROC *proc;
402402
SHMEM_OFFSET location;
@@ -416,7 +416,7 @@ ProcKill(int exitStatus, int pid)
416416

417417
proc = (PROC *) MAKE_PTR(location);
418418

419-
Assert(proc == MyProc || pid != MyProcPid);
419+
Assert(proc == MyProc || (int)pid != MyProcPid);
420420

421421
MyProc = NULL;
422422

src/backend/storage/smgr/smgr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.38 2000/10/02 19:42:52 petere Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.39 2000/10/02 21:45:33 petere Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
1818
#include "postgres.h"
1919

2020
#include "storage/smgr.h"
2121

22-
static void smgrshutdown(int dummy);
22+
static void smgrshutdown(void);
2323

2424
typedef struct f_smgr
2525
{
@@ -118,7 +118,7 @@ smgrinit()
118118
}
119119

120120
static void
121-
smgrshutdown(int dummy)
121+
smgrshutdown(void)
122122
{
123123
int i;
124124

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy