tmp++;
for (i = 0; i < ARRAY_SIZE(builtin_plugins); i++)
if (strcmp(tmp, builtin_plugins[i]) == 0)
- return (void *)(long)(PLUGIN_DL_BASE + builtin_plugin_ids[i]);
+ return (void *)(uintptr_t)(PLUGIN_DL_BASE + builtin_plugin_ids[i]);
}
#if !defined(_WIN32) && !defined(NO_DYLIB)
}
void *SysLoadSym(void *lib, const char *sym) {
- unsigned int plugid = (unsigned int)(long)lib;
+ unsigned int plugid = (unsigned int)(uintptr_t)lib;
if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins))
return plugin_link(plugid - PLUGIN_DL_BASE, sym);
}
void SysCloseLibrary(void *lib) {
- unsigned int plugid = (unsigned int)(long)lib;
+ unsigned int plugid = (unsigned int)(uintptr_t)lib;
if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins))
return;
/* if (is_fixed)
flags |= MAP_FIXED; */
- req = (void *)addr;
+ req = (void *)(uintptr_t)addr;
ret = mmap(req, size, PROT_READ | PROT_WRITE, flags, -1, 0);
if (ret == MAP_FAILED)
return ret;
}
- if (addr != 0 && ret != (void *)addr) {
+ if (addr != 0 && ret != (void *)(uintptr_t)addr) {
SysMessage("psxMap: warning: wanted to map @%08x, got %p\n",
addr, ret);
return MAP_FAILED;
}
- if (((addr ^ (unsigned long)ret) & ~0xff000000l) && try_ < 2)
+ if (((addr ^ (unsigned long)(uintptr_t)ret) & ~0xff000000l) && try_ < 2)
{
psxUnmap(ret, size, tag);
// try to use similarly aligned memory instead
// (recompiler needs this)
mask = try_ ? 0xffff : 0xffffff;
- addr = ((unsigned long)ret + mask) & ~mask;
+ addr = ((uintptr_t)ret + mask) & ~mask;
try_++;
goto retry;
}
d->sinc = s->sinc;\r
d->sinc_inv = 0;\r
memcpy(spu.SB + ch * SB_SIZE, s->SB, sizeof(spu.SB[0]) * SB_SIZE);\r
- d->pCurr = (void *)((long)s->iCurr & 0x7fff0);\r
- d->pLoop = (void *)((long)s->iLoop & 0x7fff0);\r
+ d->pCurr = (void *)((uintptr_t)s->iCurr & 0x7fff0);\r
+ d->pLoop = (void *)((uintptr_t)s->iLoop & 0x7fff0);\r
d->bReverb = s->bReverb;\r
d->iLeftVolume = s->iLeftVolume;\r
d->iRightVolume = s->iRightVolume;\r
pFO=(SPUOSSFreeze_t *)(pF+1); // store special stuff\r
\r
pFO->spuIrq = spu.regArea[(H_SPUirqAddr - 0x0c00) / 2];\r
- if(spu.pSpuIrq) pFO->pSpuIrq = (unsigned long)spu.pSpuIrq-(unsigned long)spu.spuMemC;\r
+ if(spu.pSpuIrq) pFO->pSpuIrq = spu.pSpuIrq - spu.spuMemC;\r
\r
pFO->spuAddr=spu.spuAddr;\r
if(pFO->spuAddr==0) pFO->spuAddr=0xbaadf00d;\r
{\r
load_channel(&spu.s_chan[i],&pFO->s_chan[i],i);\r
\r
- spu.s_chan[i].pCurr+=(unsigned long)spu.spuMemC;\r
- spu.s_chan[i].pLoop+=(unsigned long)spu.spuMemC;\r
+ spu.s_chan[i].pCurr+=(uintptr_t)spu.spuMemC;\r
+ spu.s_chan[i].pLoop+=(uintptr_t)spu.spuMemC;\r
}\r
}\r
\r
#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
#include <string.h>
#include "common.h"
num_width = width;
vram_ptr = (void *)vram_ptr16;
- if((long)vram_ptr16 & 2)
+ if((uintptr_t)vram_ptr16 & 2)
{
*vram_ptr16 = color_32bpp;
vram_ptr = (void *)(vram_ptr16 + 1);