aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-06-30 17:19:46 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-06-30 17:19:46 -0400
commit81e82643837de93909e0c5a8e14e805f3f69f41e (patch)
tree91e556248a0038eea5ad94c7f7a93560249efb10 /src/backend
parent541ffa65c32b278da8ab2d19433fa6d37bd15c8d (diff)
downloadpostgresql-81e82643837de93909e0c5a8e14e805f3f69f41e.tar.gz
postgresql-81e82643837de93909e0c5a8e14e805f3f69f41e.zip
Declare AnonymousShmem pointer as "void *".
The original coding had it as "PGShmemHeader *", but that doesn't offer any notational benefit because we don't dereference it. And it was resulting in compiler warnings on some platforms, notably buildfarm member castoroides, where mmap() and munmap() are evidently declared to take and return "char *".
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/port/sysv_shmem.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/backend/port/sysv_shmem.c b/src/backend/port/sysv_shmem.c
index e040400bb15..98e049380a7 100644
--- a/src/backend/port/sysv_shmem.c
+++ b/src/backend/port/sysv_shmem.c
@@ -65,7 +65,7 @@ typedef int IpcMemoryId; /* shared memory ID returned by shmget(2) */
unsigned long UsedShmemSegID = 0;
void *UsedShmemSegAddr = NULL;
static Size AnonymousShmemSize;
-static PGShmemHeader *AnonymousShmem;
+static void *AnonymousShmem;
static void *InternalIpcMemoryCreate(IpcMemoryKey memKey, Size size);
static void IpcMemoryDetach(int status, Datum shmaddr);
@@ -382,7 +382,7 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
PGShmemHeader *hdr;
IpcMemoryId shmid;
struct stat statbuf;
- Size allocsize = size;
+ Size sysvsize = size;
/* Room for a header? */
Assert(size > MAXALIGN(sizeof(PGShmemHeader)));
@@ -440,7 +440,7 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
AnonymousShmemSize = size;
/* Now we need only allocate a minimal-sized SysV shmem block. */
- allocsize = sizeof(PGShmemHeader);
+ sysvsize = sizeof(PGShmemHeader);
}
#endif
@@ -453,7 +453,7 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
for (NextShmemSegID++;; NextShmemSegID++)
{
/* Try to create new segment */
- memAddress = InternalIpcMemoryCreate(NextShmemSegID, allocsize);
+ memAddress = InternalIpcMemoryCreate(NextShmemSegID, sysvsize);
if (memAddress)
break; /* successful create and attach */
@@ -492,7 +492,7 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
/*
* Now try again to create the segment.
*/
- memAddress = InternalIpcMemoryCreate(NextShmemSegID, allocsize);
+ memAddress = InternalIpcMemoryCreate(NextShmemSegID, sysvsize);
if (memAddress)
break; /* successful create and attach */
@@ -540,8 +540,7 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
if (AnonymousShmem == NULL)
return hdr;
memcpy(AnonymousShmem, hdr, sizeof(PGShmemHeader));
- return AnonymousShmem;
-
+ return (PGShmemHeader *) AnonymousShmem;
}
#ifdef EXEC_BACKEND