summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2002-08-07 00:40:44 +0000
committerwtc%netscape.com <devnull@localhost>2002-08-07 00:40:44 +0000
commitfb700c5a33721756e686340f6f9e0eb569ac6229 (patch)
tree5cb410b4d2de70e78754a4e110d7cfd82fc9bdb4
parent51264ba831e85a2b1f46c4d5a6384cb47428c9f6 (diff)
downloadnspr-hg-fb700c5a33721756e686340f6f9e0eb569ac6229.tar.gz
Bug 136344: added type casts to allow compilation with a C++ compiler.
The patch is contributed by Nick Blievers <nickb@adacel.com.au>.
-rw-r--r--lib/ds/plarena.c6
-rw-r--r--pr/src/malloc/prmem.c2
-rw-r--r--pr/src/md/unix/uxshm.c2
-rw-r--r--pr/src/misc/prinit.c2
-rw-r--r--pr/src/misc/prnetdb.c8
-rw-r--r--pr/src/misc/prtpool.c2
6 files changed, 11 insertions, 11 deletions
diff --git a/lib/ds/plarena.c b/lib/ds/plarena.c
index 7f144636..ad26f4a3 100644
--- a/lib/ds/plarena.c
+++ b/lib/ds/plarena.c
@@ -165,7 +165,7 @@ PR_IMPLEMENT(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb)
do {
if ( a->avail +nb <= a->limit ) {
pool->current = a;
- rp = (void *)a->avail;
+ rp = (char *)a->avail;
a->avail += nb;
return rp;
}
@@ -188,7 +188,7 @@ PR_IMPLEMENT(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb)
p->next = a->next;
UnlockArena();
a->avail = a->base;
- rp = (void *)a->avail;
+ rp = (char *)a->avail;
a->avail += nb;
/* the newly allocated arena is linked after pool->current
* and becomes pool->current */
@@ -211,7 +211,7 @@ PR_IMPLEMENT(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb)
if ( NULL != a ) {
a->limit = (PRUword)a + sz;
a->base = a->avail = (PRUword)PL_ARENA_ALIGN(pool, a + 1);
- rp = (void *)a->avail;
+ rp = (char *)a->avail;
a->avail += nb;
/* the newly allocated arena is linked after pool->current
* and becomes pool->current */
diff --git a/pr/src/malloc/prmem.c b/pr/src/malloc/prmem.c
index 20cf7e99..c3870ec7 100644
--- a/pr/src/malloc/prmem.c
+++ b/pr/src/malloc/prmem.c
@@ -167,7 +167,7 @@ _PR_InitZones(void)
char *envp;
PRBool *sym;
- if ((sym = pr_FindSymbolInProg("nspr_use_zone_allocator")) != NULL) {
+ if ((sym = (PRBool *)pr_FindSymbolInProg("nspr_use_zone_allocator")) != NULL) {
use_zone_allocator = *sym;
} else if ((envp = getenv("NSPR_USE_ZONE_ALLOCATOR")) != NULL) {
use_zone_allocator = (atoi(envp) == 1);
diff --git a/pr/src/md/unix/uxshm.c b/pr/src/md/unix/uxshm.c
index 81aa7487..1dc98386 100644
--- a/pr/src/md/unix/uxshm.c
+++ b/pr/src/md/unix/uxshm.c
@@ -94,7 +94,7 @@ extern PRSharedMemory * _MD_OpenSharedMemory(
return( NULL );
}
- shm->ipcname = PR_MALLOC( strlen( ipcname ) + 1 );
+ shm->ipcname = (char*)PR_MALLOC( strlen( ipcname ) + 1 );
if ( NULL == shm->ipcname )
{
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0 );
diff --git a/pr/src/misc/prinit.c b/pr/src/misc/prinit.c
index e512f1e0..944ff5d5 100644
--- a/pr/src/misc/prinit.c
+++ b/pr/src/misc/prinit.c
@@ -562,7 +562,7 @@ PR_ProcessAttrSetCurrentDirectory(
const char *dir)
{
PR_FREEIF(attr->currentDirectory);
- attr->currentDirectory = PR_MALLOC(strlen(dir) + 1);
+ attr->currentDirectory = (char *) PR_MALLOC(strlen(dir) + 1);
if (!attr->currentDirectory) {
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
return PR_FAILURE;
diff --git a/pr/src/misc/prnetdb.c b/pr/src/misc/prnetdb.c
index 58342292..41d151c7 100644
--- a/pr/src/misc/prnetdb.c
+++ b/pr/src/misc/prnetdb.c
@@ -246,7 +246,7 @@ _pr_QueryNetIfs(void)
lastlen = 0;
len = 100 * sizeof(struct ifreq); /* initial buffer size guess */
for (;;) {
- buf = PR_Malloc(len);
+ buf = (char *)PR_Malloc(len);
if (NULL == buf) {
close(sock);
return;
@@ -604,7 +604,7 @@ PR_IMPLEMENT(PRStatus) PR_GetHostByName(
tmpbuf = localbuf;
if (bufsize > sizeof(localbuf))
{
- tmpbuf = PR_Malloc(bufsize);
+ tmpbuf = (char *)PR_Malloc(bufsize);
if (NULL == tmpbuf)
{
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
@@ -736,7 +736,7 @@ PR_IMPLEMENT(PRStatus) PR_GetIPNodeByName(
tmpbuf = localbuf;
if (bufsize > sizeof(localbuf))
{
- tmpbuf = PR_Malloc(bufsize);
+ tmpbuf = (char *)PR_Malloc(bufsize);
if (NULL == tmpbuf)
{
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
@@ -923,7 +923,7 @@ PR_IMPLEMENT(PRStatus) PR_GetHostByAddr(
tmpbuf = localbuf;
if (bufsize > sizeof(localbuf))
{
- tmpbuf = PR_Malloc(bufsize);
+ tmpbuf = (char *)PR_Malloc(bufsize);
if (NULL == tmpbuf)
{
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
diff --git a/pr/src/misc/prtpool.c b/pr/src/misc/prtpool.c
index acf6ec77..d0816b30 100644
--- a/pr/src/misc/prtpool.c
+++ b/pr/src/misc/prtpool.c
@@ -603,7 +603,7 @@ alloc_threadpool(void)
{
PRThreadPool *tp;
- tp = PR_CALLOC(sizeof(*tp));
+ tp = (PRThreadPool *) PR_CALLOC(sizeof(*tp));
if (NULL == tp)
goto failed;
tp->jobq.lock = PR_NewLock();