Merge pull request #1186 from unknownbrackets/warnings

Warning cleanup
This commit is contained in:
Henrik Rydgård 2013-04-06 00:46:24 -07:00
commit c41d4a17c4
23 changed files with 78 additions and 77 deletions

View File

@ -271,9 +271,9 @@ void ScheduleEvent(s64 cyclesIntoFuture, int event_type, u64 userdata)
}
// Returns cycles left in timer.
u64 UnscheduleEvent(int event_type, u64 userdata)
s64 UnscheduleEvent(int event_type, u64 userdata)
{
u64 result = 0;
s64 result = 0;
if (!first)
return result;
while(first)

View File

@ -93,7 +93,7 @@ namespace CoreTiming
void ScheduleEvent(s64 cyclesIntoFuture, int event_type, u64 userdata=0);
void ScheduleEvent_Threadsafe(s64 cyclesIntoFuture, int event_type, u64 userdata=0);
void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata=0);
u64 UnscheduleEvent(int event_type, u64 userdata);
s64 UnscheduleEvent(int event_type, u64 userdata);
void RemoveEvent(int event_type);
void RemoveThreadsafeEvent(int event_type);

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

@ -165,7 +165,7 @@ bool __KernelUnlockEventFlagForThread(EventFlag *e, EventFlagTh &th, u32 &error,
if (timeoutPtr != 0 && eventFlagWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(eventFlagWaitTimer, th.tid);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(eventFlagWaitTimer, th.tid);
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
}

View File

@ -205,7 +205,7 @@ bool __KernelUnlockMbxForThread(Mbx *m, MbxWaitingThread &th, u32 &error, int re
if (timeoutPtr != 0 && mbxWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(mbxWaitTimer, th.first);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(mbxWaitTimer, th.first);
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
}

View File

@ -804,7 +804,7 @@ bool __KernelUnlockVplForThread(VPL *vpl, VplWaitingThread &threadInfo, u32 &err
if (timeoutPtr != 0 && vplWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(vplWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(vplWaitTimer, threadID);
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
}

View File

@ -264,7 +264,7 @@ bool __KernelUnlockMutexForThread(Mutex *mutex, SceUID threadID, u32 &error, int
if (timeoutPtr != 0 && mutexWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
}
@ -289,7 +289,7 @@ void __KernelMutexBeginCallback(SceUID threadID, SceUID prevCallbackId)
if (timeoutPtr != 0 && mutexWaitTimer != -1)
{
u64 cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
mutex->pausedWaitTimeouts[pauseKey] = CoreTiming::GetTicks() + cyclesLeft;
}
else
@ -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;
@ -759,7 +759,7 @@ bool __KernelUnlockLwMutexForThread(LwMutex *mutex, T workarea, SceUID threadID,
if (timeoutPtr != 0 && lwMutexWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
}
@ -931,7 +931,7 @@ void __KernelLwMutexBeginCallback(SceUID threadID, SceUID prevCallbackId)
if (timeoutPtr != 0 && lwMutexWaitTimer != -1)
{
u64 cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
mutex->pausedWaitTimeouts[pauseKey] = CoreTiming::GetTicks() + cyclesLeft;
}
else
@ -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

@ -121,7 +121,7 @@ bool __KernelUnlockSemaForThread(Semaphore *s, SceUID threadID, u32 &error, int
if (timeoutPtr != 0 && semaWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
if (cyclesLeft < 0)
cyclesLeft = 0;
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
@ -149,7 +149,7 @@ void __KernelSemaBeginCallback(SceUID threadID, SceUID prevCallbackId)
if (timeoutPtr != 0 && semaWaitTimer != -1)
{
u64 cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
s->pausedWaitTimeouts[pauseKey] = CoreTiming::GetTicks() + cyclesLeft;
}
else

View File

@ -116,7 +116,7 @@ int sceKernelSysClock2USec(u32 sysclockPtr, u32 highPtr, u32 lowPtr)
int sceKernelSysClock2USecWide(u32 lowClock, u32 highClock, u32 lowPtr, u32 highPtr)
{
u64 sysClock = lowClock | ((u64)highClock << 32);
DEBUG_LOG(HLE, "sceKernelSysClock2USecWide(clock = %llu, lo = %08x, hi = %08x)", clock, lowPtr, highPtr);
DEBUG_LOG(HLE, "sceKernelSysClock2USecWide(clock = %llu, lo = %08x, hi = %08x)", sysClock, lowPtr, highPtr);
if (Memory::IsValidAddress(lowPtr)) {
Memory::Write_U32((u32)(sysClock / 1000000), lowPtr);
if (Memory::IsValidAddress(highPtr))

View File

@ -92,7 +92,7 @@ void __KernelScheduleVTimer(VTimer *vt, u64 schedule) {
CoreTiming::ScheduleEvent(usToCycles(vt->nvt.schedule + 372), vtimerTimer, vt->GetUID());
}
void __rescheduleVTimer(SceUID id, u32 delay) {
void __rescheduleVTimer(SceUID id, int delay) {
u32 error;
VTimer *vt = kernelObjects.Get<VTimer>(id, error);

View File

@ -56,7 +56,7 @@ static const int MPEG_DATA_STREAM = 3; // Arbitrary user defined type. Can
static const int MPEG_AUDIO_STREAM = 15;
static const int MPEG_AU_MODE_DECODE = 0;
static const int MPEG_AU_MODE_SKIP = 1;
static const int MPEG_MEMSIZE = 0x10000; // 64k.
static const u32 MPEG_MEMSIZE = 0x10000; // 64k.
static const int MPEG_AVC_DECODE_SUCCESS = 1; // Internal value.
static const int MPEG_AVC_DECODE_ERROR_FATAL = -8;
@ -968,7 +968,7 @@ int sceMpegInitAu(u32 mpeg, u32 bufferAddr, u32 auPointer)
SceMpegAu sceAu;
sceAu.read(auPointer);
if (bufferAddr >= 1 && bufferAddr <= NUM_ES_BUFFERS && ctx->esBuffers[bufferAddr - 1]) {
if (bufferAddr >= 1 && bufferAddr <= (u32)NUM_ES_BUFFERS && ctx->esBuffers[bufferAddr - 1]) {
// This esbuffer has been allocated for Avc.
sceAu.esBuffer = bufferAddr; // Can this be right??? not much of a buffer pointer..
sceAu.esSize = MPEG_AVC_ES_SIZE;
@ -1570,7 +1570,7 @@ int sceMp3Init(u32 mp3)
// 0 == VBR
int bitrate = ((header >> 10) & 0x3);
if(bitrate < sizeof(MP3_BITRATES) / sizeof(MP3_BITRATES[0]))
if(bitrate < (int)ARRAY_SIZE(MP3_BITRATES))
ctx->mp3Bitrate = MP3_BITRATES[bitrate];
else
ctx->mp3Bitrate = -1;
@ -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

@ -43,7 +43,7 @@ enum {
};
// MPEG statics.
static const int PSMF_MAGIC = 0x464D5350;
static const u32 PSMF_MAGIC = 0x464D5350;
static const int PSMF_VERSION_0012 = 0x32313030;
static const int PSMF_VERSION_0013 = 0x33313030;
static const int PSMF_VERSION_0014 = 0x34313030;

View File

@ -23,7 +23,7 @@ static const int modeBpp[4] = { 2, 2, 2, 4 };
void MediaEngine::writeVideoImage(u32 bufferPtr, int frameWidth, int videoPixelMode)
{
if (videoPixelMode > (sizeof(modeBpp) / sizeof(modeBpp[0])) || videoPixelMode < 0)
if (videoPixelMode > (int)(sizeof(modeBpp) / sizeof(modeBpp[0])) || videoPixelMode < 0)
{
ERROR_LOG(ME, "Unexpected videoPixelMode %d, using 0 instead.", videoPixelMode);
videoPixelMode = 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]));
}
}

View File

@ -203,7 +203,7 @@ void CtrlDisAsmView::onPaint(WPARAM wParam, LPARAM lParam)
int rowY1 = rect.bottom/2 + rowHeight*i - rowHeight/2;
int rowY2 = rect.bottom/2 + rowHeight*i + rowHeight/2;
char temp[256];
sprintf(temp,"%08x",address);
int temp_len = sprintf(temp,"%08x",address);
lbr.lbColor=marker==address?0xffeee0:debugger->getColor(address);
u32 bg = lbr.lbColor;
@ -228,13 +228,13 @@ void CtrlDisAsmView::onPaint(WPARAM wParam, LPARAM lParam)
SelectObject(hdc,currentBrush);
DeleteObject(mojsBrush);
SetTextColor(hdc,halfAndHalf(bg,0));
TextOut(hdc,17,rowY1,temp,strlen(temp));
TextOut(hdc,17,rowY1,temp,temp_len);
SetTextColor(hdc,0x000000);
if (debugger->isAlive())
{
const TCHAR *dizz = debugger->disasm(address, align);
char dis[512];
strcpy(dis, dizz);
char dis[512];
strcpy(dis, dizz);
TCHAR *dis2 = strchr(dis,'\t');
TCHAR desc[256]="";
if (dis2)
@ -278,11 +278,11 @@ void CtrlDisAsmView::onPaint(WPARAM wParam, LPARAM lParam)
}
else
SetTextColor(hdc,0x000000);
TextOut(hdc,149,rowY1,dis2,strlen(dis2));
TextOut(hdc,149,rowY1,dis2,(int)strlen(dis2));
}
SetTextColor(hdc,0x007000);
SelectObject(hdc,boldfont);
TextOut(hdc,84,rowY1,dis,strlen(dis));
TextOut(hdc,84,rowY1,dis,(int)strlen(dis));
SelectObject(hdc,font);
if (desc[0]==0)
{
@ -300,7 +300,7 @@ void CtrlDisAsmView::onPaint(WPARAM wParam, LPARAM lParam)
//char temp[256];
//UnDecorateSymbolName(desc,temp,255,UNDNAME_COMPLETE);
if (strlen(desc))
TextOut(hdc,max(280,width/3+190),rowY1,desc,strlen(desc));
TextOut(hdc,max(280,width/3+190),rowY1,desc,(int)strlen(desc));
if (debugger->isBreakpoint(address))
{
DrawIconEx(hdc,2,rowY1,breakPoint,32,32,0,0,DI_NORMAL);

View File

@ -180,7 +180,7 @@ void CtrlMemView::onPaint(WPARAM wParam, LPARAM lParam)
Rectangle(hdc,16,rowY1,width,rowY2);
SelectObject(hdc,nullBrush);
SetTextColor(hdc,0x600000);
TextOut(hdc,17,rowY1,temp,strlen(temp));
TextOut(hdc,17,rowY1,temp,(int)strlen(temp));
SetTextColor(hdc,0x000000);
if (debugger->isAlive())
{
@ -188,9 +188,9 @@ void CtrlMemView::onPaint(WPARAM wParam, LPARAM lParam)
switch(mode) {
case MV_NORMAL:
{
const char *m = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
if (Memory::IsValidAddress(address))
{
const char *m = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
if (Memory::IsValidAddress(address))
{
u32 memory[4] = {
debugger->readMemory(address),
debugger->readMemory(address+4),
@ -200,7 +200,7 @@ void CtrlMemView::onPaint(WPARAM wParam, LPARAM lParam)
m = (const char*)memory;
sprintf(temp, "%08x %08x %08x %08x ................",
memory[0],memory[1],memory[2],memory[3]);
}
}
for (int i=0; i<16; i++)
{
int c = (unsigned char)m[i];
@ -211,7 +211,7 @@ void CtrlMemView::onPaint(WPARAM wParam, LPARAM lParam)
// if (align == 16)
// else
// sprintf(temp, "%04x %04x %04x %04x", ReadMem16Unchecked(address),ReadMem16Unchecked(address+2), ReadMem16Unchecked(address+4), ReadMem16Unchecked(address+6))
TextOut(hdc,80,rowY1,temp,strlen(temp));
TextOut(hdc,80,rowY1,temp,(int)strlen(temp));
break;
case MV_SYMBOLS:
@ -224,7 +224,7 @@ void CtrlMemView::onPaint(WPARAM wParam, LPARAM lParam)
}
else
sprintf(temp, "%s (0x%x b)", symbolMap.GetSymbolName(fn),symbolMap.GetSymbolSize(fn));
TextOut(hdc,200,rowY1,temp,strlen(temp));
TextOut(hdc,200,rowY1,temp,(int)strlen(temp));
SetTextColor(hdc,0x0000000);
@ -239,7 +239,7 @@ void CtrlMemView::onPaint(WPARAM wParam, LPARAM lParam)
sprintf(temp, "%04x [%s]", value, symbolMap.GetSymbolName(symbolMap.GetSymbolNum(value)));
}
TextOut(hdc,70,rowY1,temp,strlen(temp));
TextOut(hdc,70,rowY1,temp,(int)strlen(temp));
break;
}
}

View File

@ -191,7 +191,7 @@ void CtrlRegisterList::onPaint(WPARAM wParam, LPARAM lParam)
SelectObject(hdc,i==category?pcBrush:nullBrush);
Rectangle(hdc,width*i/nc,0,width*(i+1)/nc,rowHeight);
const TCHAR *name = cpu->GetCategoryName(i);
TextOut(hdc,width*i/nc,1,name,strlen(name));
TextOut(hdc,width*i/nc,1,name,(int)strlen(name));
}
int numRows=rect.bottom/rowHeight;
@ -238,9 +238,9 @@ void CtrlRegisterList::onPaint(WPARAM wParam, LPARAM lParam)
if (i<cpu->GetNumRegsInCategory(category))
{
char temp[256];
sprintf(temp,"%s",cpu->GetRegName(category,i));
int temp_len = sprintf(temp,"%s",cpu->GetRegName(category,i));
SetTextColor(hdc,0x600000);
TextOut(hdc,17,rowY1,temp,strlen(temp));
TextOut(hdc,17,rowY1,temp,temp_len);
SetTextColor(hdc,0x000000);
cpu->PrintRegValue(category,i,temp);
@ -248,7 +248,7 @@ void CtrlRegisterList::onPaint(WPARAM wParam, LPARAM lParam)
SetTextColor(hdc, 0x0000FF);
else
SetTextColor(hdc,0x004000);
TextOut(hdc,77,rowY1,temp,strlen(temp));
TextOut(hdc,77,rowY1,temp,(int)strlen(temp));
}

View File

@ -82,11 +82,11 @@ BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
case LBN_DBLCLK:
case LBN_SELCHANGE:
{
HWND lb =GetDlgItem(m_hDlg,LOWORD(wParam));
int n =ComboBox_GetCurSel(lb);
HWND lb = GetDlgItem(m_hDlg,LOWORD(wParam));
int n = ComboBox_GetCurSel(lb);
if (n!=-1)
{
LONG_PTR addr = ComboBox_GetItemData(lb,n);
unsigned int addr = (unsigned int)ComboBox_GetItemData(lb,n);
mv->gotoAddr(addr);
}
}
@ -100,8 +100,8 @@ BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
case LBN_SELCHANGE:
{
HWND lb =GetDlgItem(m_hDlg,LOWORD(wParam));
int n =ListBox_GetCurSel(lb);
HWND lb = GetDlgItem(m_hDlg,LOWORD(wParam));
int n = ListBox_GetCurSel(lb);
if (n!=-1)
{
unsigned int addr = (unsigned int)ListBox_GetItemData(lb,n);

View File

@ -31,23 +31,23 @@ CVFPUDlg::CVFPUDlg(HINSTANCE _hInstance, HWND _hParent, DebugInterface *cpu_) :
tcItem.mask = TCIF_TEXT;
tcItem.dwState = 0;
tcItem.pszText = "Float";
tcItem.cchTextMax = strlen(tcItem.pszText)+1;
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
tcItem.iImage = 0;
TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
tcItem.pszText = "HalfFloat";
tcItem.cchTextMax = strlen(tcItem.pszText)+1;
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
tcItem.pszText = "Hex";
tcItem.cchTextMax = strlen(tcItem.pszText)+1;
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
tcItem.pszText = "Bytes";
tcItem.cchTextMax = strlen(tcItem.pszText)+1;
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
tcItem.pszText = "Shorts";
tcItem.cchTextMax = strlen(tcItem.pszText)+1;
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
tcItem.pszText = "Ints";
tcItem.cchTextMax = strlen(tcItem.pszText)+1;
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
mode=0;
Size();
@ -145,8 +145,8 @@ BOOL CVFPUDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
int my = (int)(yStart + matrix * rowHeight * 5.5f);
Rectangle(hdc, 0, my, xStart, my+rowHeight);
char temp[256];
sprintf_s(temp, "M%i00", matrix);
TextOut(hdc,3,my+2,temp,strlen(temp));
int temp_len = sprintf_s(temp, "M%i00", matrix);
TextOut(hdc,3,my+2,temp,temp_len);
Rectangle(hdc,xStart,my+rowHeight,xStart+columnWidth*4,my+5*rowHeight);
for (int column = 0; column<4; column++)
@ -156,12 +156,12 @@ BOOL CVFPUDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
Rectangle(hdc, x, y, x + columnWidth, y+rowHeight);
char temp[256];
sprintf_s(temp, "R%i0%i", matrix, column);
TextOut(hdc,x+3,y+2,temp,strlen(temp));
temp_len = sprintf_s(temp, "R%i0%i", matrix, column);
TextOut(hdc,x+3,y+2,temp,temp_len);
Rectangle(hdc, 0, y+rowHeight*(column+1), xStart, y+rowHeight*(column+2));
sprintf_s(temp, "C%i%i0", matrix, column);
TextOut(hdc,3,y+rowHeight*(column+1)+1,temp,strlen(temp));
temp_len = sprintf_s(temp, "C%i%i0", matrix, column);
TextOut(hdc,3,y+rowHeight*(column+1)+1,temp,temp_len);
y+=rowHeight;
@ -170,15 +170,16 @@ BOOL CVFPUDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
float val = mipsr4k.v[column*32+row+matrix*4];
u32 hex = *((u32*)&val);
char temp[256];
int temp_len;
switch (mode)
{
case 0: sprintf_s(temp,"%f",val); break;
// case 1: sprintf_s(temp,"??"); break;
case 2: sprintf_s(temp,"0x%08x",hex); break;
default:sprintf_s(temp,"%f",val); break;
case 0: temp_len = sprintf_s(temp,"%f",val); break;
// case 1: temp_len = sprintf_s(temp,"??"); break;
case 2: temp_len = sprintf_s(temp,"0x%08x",hex); break;
default:temp_len = sprintf_s(temp,"%f",val); break;
}
TextOut(hdc,x+3,y+2,temp,strlen(temp));
TextOut(hdc,x+3,y+2,temp,temp_len);
y+=rowHeight;
}
}

View File

@ -82,7 +82,7 @@ void RunTests()
std::string savedReportHost = g_Config.sReportHost;
g_Config.sReportHost = "";
for (int i = 0; i < ARRAY_SIZE(testsToRun); i++) {
for (size_t i = 0; i < ARRAY_SIZE(testsToRun); i++) {
const char *testName = testsToRun[i];
coreParam.fileToStart = baseDirectory + "pspautotests/tests/" + testName + ".prx";
std::string expectedFile = baseDirectory + "pspautotests/tests/" + testName + ".expected";