mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 136344: added type casts to allow compilation with a C++ compiler.
The patch is contributed by Nick Blievers <nickb@adacel.com.au>.
This commit is contained in:
parent
14956082f7
commit
0c3ceb4878
@ -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 */
|
||||
|
@ -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);
|
||||
|
@ -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 );
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user