Fix some x64 type conversion warnings.

This commit is contained in:
Unknown W. Brackets 2013-04-05 20:29:20 -07:00
parent 4ebd3aaceb
commit 832edb0a8f
7 changed files with 16 additions and 16 deletions

View File

@ -122,7 +122,7 @@ void SymbolMap::AddSymbol(const char *symbolname, unsigned int vaddress, size_t
strncpy(e.name, symbolname, 127);
e.name[127] = '\0';
e.vaddress = vaddress;
e.size = size;
e.size = (u32)size;
e.type = st;
entries.push_back(e);
}

View File

@ -41,10 +41,10 @@ static int getBits(int numBits, const u8 *buf, size_t pos) {
return v;
}
static std::vector<int> getTable(const u8 *buf, int bpe, int length) {
static std::vector<int> getTable(const u8 *buf, int bpe, size_t length) {
std::vector<int> vec;
vec.resize(length);
for (int i = 0; i < length; i++) {
for (size_t i = 0; i < length; i++) {
vec[i] = getBits(bpe, buf, bpe * i);
}
return vec;
@ -72,10 +72,10 @@ void PGF::DoState(PointerWrap &p) {
}
if (fontDataSize) {
fontData = new u8[fontDataSize];
p.DoArray(fontData, fontDataSize);
p.DoArray(fontData, (int)fontDataSize);
}
} else if (fontDataSize) {
p.DoArray(fontData, fontDataSize);
p.DoArray(fontData, (int)fontDataSize);
}
p.Do(fileName);
@ -179,7 +179,7 @@ void PGF::ReadPtr(const u8 *ptr, size_t dataSize) {
}
// PGF Fontdata.
u32 fontDataOffset = uptr - startPtr;
u32 fontDataOffset = (u32)(uptr - startPtr);
fontDataSize = dataSize - fontDataOffset;
fontData = new u8[fontDataSize];

View File

@ -308,7 +308,7 @@ public:
fonts_.resize(params_.numFonts);
isfontopen_.resize(params_.numFonts);
for (size_t i = 0; i < fonts_.size(); i++) {
u32 addr = allocatedAddr + 4 + i * 4;
u32 addr = allocatedAddr + 4 + (u32)i * 4;
isfontopen_[i] = 0;
fonts_[i] = addr;
}
@ -502,7 +502,7 @@ Font *GetOptimumFont(const PGFFontStyle &requestedStyle, Font *optimumFont, Font
int GetInternalFontIndex(Font *font) {
for (size_t i = 0; i < internalFonts.size(); i++) {
if (internalFonts[i] == font)
return i;
return (int)i;
}
return -1;
}
@ -713,7 +713,7 @@ int sceFontFindFont(u32 libHandlePtr, u32 fontStylePtr, u32 errorCodePtr) {
for (size_t i = 0; i < internalFonts.size(); i++) {
if (internalFonts[i]->MatchesStyle(style, false)) {
Memory::Write_U32(0, errorCodePtr);
return i;
return (int)i;
}
}
return -1;
@ -866,7 +866,7 @@ int sceFontGetNumFontList(u32 fontLibHandle, u32 errorCodePtr) {
INFO_LOG(HLE, "sceFontGetNumFontList(%08x, %08x)", fontLibHandle, errorCodePtr);
if (Memory::IsValidAddress(errorCodePtr))
Memory::Write_U32(0, errorCodePtr);
return internalFonts.size();
return (int)internalFonts.size();
}
int sceFontSetResolution(u32 fontLibHandle, float hRes, float vRes) {

View File

@ -686,7 +686,7 @@ int sceKernelReferMutexStatus(SceUID id, u32 infoAddr)
if (Memory::Read_U32(infoAddr) != 0)
{
// Refresh and write
m->nm.numWaitThreads = m->waitingThreads.size();
m->nm.numWaitThreads = (int) m->waitingThreads.size();
Memory::WriteStruct(infoAddr, &m->nm);
}
return 0;
@ -1133,7 +1133,7 @@ int __KernelReferLwMutexStatus(SceUID uid, u32 infoPtr)
// Refresh and write
m->nm.currentCount = workarea->lockLevel;
m->nm.lockThread = workarea->lockThread == 0 ? -1 : workarea->lockThread;
m->nm.numWaitThreads = m->waitingThreads.size();
m->nm.numWaitThreads = (int) m->waitingThreads.size();
Memory::WriteStruct(infoPtr, &m->nm);
}
return 0;

View File

@ -1700,7 +1700,7 @@ int sceMp3GetInfoToAddStreamData(u32 mp3, u32 dstPtr, u32 towritePtr, u32 srcpos
if(Memory::IsValidAddress(towritePtr))
Memory::Write_U32(ctx->mp3BufSize, towritePtr);
if(Memory::IsValidAddress(srcposPtr))
Memory::Write_U32(ctx->mp3StreamPosition, srcposPtr);
Memory::Write_U32((u32)ctx->mp3StreamPosition, srcposPtr);
return 0;
}

View File

@ -574,7 +574,7 @@ void GPUCommon::DoState(PointerWrap &p) {
int currentID = 0;
if (currentList != NULL) {
ptrdiff_t off = currentList - &dls[0];
currentID = off / sizeof(DisplayList);
currentID = (int) (off / sizeof(DisplayList));
}
p.Do(currentID);
if (currentID == 0) {

View File

@ -269,11 +269,11 @@ void MenuScreen::render() {
GameInfo *ginfo = g_gameInfoCache.GetInfo(g_Config.recentIsos[i], false);
if (ginfo) {
if (UITextureButton(ctx, GEN_ID_LOOP(i), vlinear2, 144, 80, ginfo->iconTexture, ALIGN_LEFT)) {
if (UITextureButton(ctx, (int)GEN_ID_LOOP(i), vlinear2, 144, 80, ginfo->iconTexture, ALIGN_LEFT)) {
screenManager()->switchScreen(new EmuScreen(g_Config.recentIsos[i]));
}
} else {
if (UIButton(GEN_ID_LOOP(i), vlinear2, recentW, filename.c_str(), ALIGN_LEFT)) {
if (UIButton((int)GEN_ID_LOOP(i), vlinear2, recentW, filename.c_str(), ALIGN_LEFT)) {
screenManager()->switchScreen(new EmuScreen(g_Config.recentIsos[i]));
}
}