Compiler Warnings: Mismatch edition. Also fixed some conversion warnings.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2557 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
cb121dab66
commit
432ea89b49
|
@ -34,7 +34,7 @@ CDolLoader::CDolLoader(const char* _szFilename)
|
||||||
u8* tmpBuffer = new u8[(size_t)size];
|
u8* tmpBuffer = new u8[(size_t)size];
|
||||||
|
|
||||||
FILE* pStream = fopen(_szFilename, "rb");
|
FILE* pStream = fopen(_szFilename, "rb");
|
||||||
fread(tmpBuffer, size, 1, pStream);
|
fread(tmpBuffer, size_t(size), 1, pStream);
|
||||||
fclose(pStream);
|
fclose(pStream);
|
||||||
|
|
||||||
m_bInit = Initialize(tmpBuffer, (u32)size);
|
m_bInit = Initialize(tmpBuffer, (u32)size);
|
||||||
|
|
|
@ -35,7 +35,7 @@ CARCFile::CARCFile(const std::string& _rFilename)
|
||||||
if (pReader != NULL)
|
if (pReader != NULL)
|
||||||
{
|
{
|
||||||
u64 FileSize = pReader->GetDataSize();
|
u64 FileSize = pReader->GetDataSize();
|
||||||
m_pBuffer = new u8[FileSize];
|
m_pBuffer = new u8[unsigned int(FileSize)];
|
||||||
pReader->Read(0, FileSize, m_pBuffer);
|
pReader->Read(0, FileSize, m_pBuffer);
|
||||||
delete pReader;
|
delete pReader;
|
||||||
|
|
||||||
|
|
|
@ -106,8 +106,8 @@ bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
u64 Size = File::GetSize(TMDFileName.c_str());
|
u64 Size = File::GetSize(TMDFileName.c_str());
|
||||||
u8* pTMD = new u8[Size];
|
u8* pTMD = new u8[unsigned int(Size)];
|
||||||
fread(pTMD, Size, 1, pTMDFile);
|
fread(pTMD, size_t(Size), 1, pTMDFile);
|
||||||
fclose(pTMDFile);
|
fclose(pTMDFile);
|
||||||
|
|
||||||
//////
|
//////
|
||||||
|
@ -135,11 +135,11 @@ bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
|
||||||
if (pFile != NULL)
|
if (pFile != NULL)
|
||||||
{
|
{
|
||||||
u64 Size = File::GetSize(szFilename);
|
u64 Size = File::GetSize(szFilename);
|
||||||
rContent.m_pData = new u8[Size];
|
rContent.m_pData = new u8[unsigned int(Size)];
|
||||||
|
|
||||||
_dbg_assert_msg_(BOOT, rContent.m_Size==Size, "TMDLoader: Filesize doesnt fit (%s %i)", szFilename, i);
|
_dbg_assert_msg_(BOOT, rContent.m_Size==Size, "TMDLoader: Filesize doesnt fit (%s %i)", szFilename, i);
|
||||||
|
|
||||||
fread(rContent.m_pData, Size, 1, pFile);
|
fread(rContent.m_pData, size_t(Size), 1, pFile);
|
||||||
fclose(pFile);
|
fclose(pFile);
|
||||||
} else {
|
} else {
|
||||||
ERROR_LOG(DISCIO, "CreateFromDirectory: error opening %s",
|
ERROR_LOG(DISCIO, "CreateFromDirectory: error opening %s",
|
||||||
|
|
|
@ -581,7 +581,7 @@ static void WriteStage(char *&p, int n, u32 texture_mask)
|
||||||
|
|
||||||
int texcoord = bpmem.tevorders[n/2].getTexCoord(n&1);
|
int texcoord = bpmem.tevorders[n/2].getTexCoord(n&1);
|
||||||
int texfun = xfregs.texcoords[texcoord].texmtxinfo.projection;
|
int texfun = xfregs.texcoords[texcoord].texmtxinfo.projection;
|
||||||
bool bHasTexCoord = texcoord < bpmem.genMode.numtexgens;
|
bool bHasTexCoord = unsigned int(texcoord) < bpmem.genMode.numtexgens;
|
||||||
bool bHasIndStage = bpmem.tevind[n].IsActive() && bpmem.tevind[n].bt < bpmem.genMode.numindstages;
|
bool bHasIndStage = bpmem.tevind[n].IsActive() && bpmem.tevind[n].bt < bpmem.genMode.numindstages;
|
||||||
|
|
||||||
// HACK to handle cases where the tex gen is not enabled
|
// HACK to handle cases where the tex gen is not enabled
|
||||||
|
|
|
@ -170,7 +170,7 @@ void Config::Load(bool ChangePad)
|
||||||
|
|
||||||
/* Prevent a crash from illegal access to joyinfo that will only have values for
|
/* Prevent a crash from illegal access to joyinfo that will only have values for
|
||||||
the current amount of connected PadMapping */
|
the current amount of connected PadMapping */
|
||||||
if(WiiMoteEmu::PadMapping[i].ID >= WiiMoteEmu::joyinfo.size()) continue;
|
if(unsigned int(WiiMoteEmu::PadMapping[i].ID) >= WiiMoteEmu::joyinfo.size()) continue;
|
||||||
|
|
||||||
// Create a section name
|
// Create a section name
|
||||||
SectionName = WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[i].ID].Name;
|
SectionName = WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[i].ID].Name;
|
||||||
|
@ -313,7 +313,7 @@ void Config::Save(int Slot)
|
||||||
|
|
||||||
/* Save joypad specific settings. Check for "PadMapping[i].ID < SDL_NumJoysticks()" to
|
/* Save joypad specific settings. Check for "PadMapping[i].ID < SDL_NumJoysticks()" to
|
||||||
avoid reading a joyinfo that does't exist */
|
avoid reading a joyinfo that does't exist */
|
||||||
if(WiiMoteEmu::PadMapping[i].ID >= WiiMoteEmu::joyinfo.size()) continue;
|
if(unsigned int(WiiMoteEmu::PadMapping[i].ID) >= WiiMoteEmu::joyinfo.size()) continue;
|
||||||
|
|
||||||
// Create a new section name after the joypad name
|
// Create a new section name after the joypad name
|
||||||
SectionName = WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[i].ID].Name;
|
SectionName = WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[i].ID].Name;
|
||||||
|
|
|
@ -264,13 +264,13 @@ void LoadRecordedMovements()
|
||||||
VRecording.at(i).IRBytes = TmpIRBytes;
|
VRecording.at(i).IRBytes = TmpIRBytes;
|
||||||
|
|
||||||
SRecording Tmp;
|
SRecording Tmp;
|
||||||
for (int j = 0, k = 0, l = 0; j < TmpMovement.length(); j+=13)
|
for (int j = 0, k = 0, l = 0; unsigned int(j) < TmpMovement.length(); j+=13)
|
||||||
{
|
{
|
||||||
// Skip blank savings
|
// Skip blank savings
|
||||||
if (TmpMovement.length() < 3) continue;
|
if (TmpMovement.length() < 3) continue;
|
||||||
|
|
||||||
// Avoid going to far, this can only happen with modified ini files, but we check for it anyway
|
// Avoid going to far, this can only happen with modified ini files, but we check for it anyway
|
||||||
if (TmpMovement.length() < j + 12) continue;
|
if (TmpMovement.length() < unsigned int(j + 12)) continue;
|
||||||
|
|
||||||
// Skip old style recordings
|
// Skip old style recordings
|
||||||
if (TmpMovement.substr(j, 1) != "-" && TmpMovement.substr(j, 1) != "+") continue;
|
if (TmpMovement.substr(j, 1) != "-" && TmpMovement.substr(j, 1) != "+") continue;
|
||||||
|
@ -290,7 +290,7 @@ void LoadRecordedMovements()
|
||||||
if (TmpIRBytes == 0) for(int i = 0; i < 12; i++) Tmp.IR[i] = 0;
|
if (TmpIRBytes == 0) for(int i = 0; i < 12; i++) Tmp.IR[i] = 0;
|
||||||
for(int ii = 0; ii < TmpIRBytes; ii++)
|
for(int ii = 0; ii < TmpIRBytes; ii++)
|
||||||
{
|
{
|
||||||
if(TmpIR.length() < (k + i + TmpIRBytes)) continue; // Safety check
|
if(TmpIR.length() < unsigned int((k + i + TmpIRBytes))) continue; // Safety check
|
||||||
std::string TmpStr = TmpIR.substr(k + ii*2, 2);
|
std::string TmpStr = TmpIR.substr(k + ii*2, 2);
|
||||||
u32 TmpU32;
|
u32 TmpU32;
|
||||||
AsciiToHex(TmpStr.c_str(), TmpU32);
|
AsciiToHex(TmpStr.c_str(), TmpU32);
|
||||||
|
@ -526,7 +526,7 @@ void Shutdown(void)
|
||||||
vector elements or any bad devices */
|
vector elements or any bad devices */
|
||||||
for (int i = 0; i < 1; i++)
|
for (int i = 0; i < 1; i++)
|
||||||
{
|
{
|
||||||
if (PadMapping[i].enabled && joyinfo.size() > PadMapping[i].ID)
|
if (PadMapping[i].enabled && joyinfo.size() > unsigned int(PadMapping[i].ID))
|
||||||
if (joyinfo.at(PadMapping[i].ID).Good)
|
if (joyinfo.at(PadMapping[i].ID).Good)
|
||||||
{
|
{
|
||||||
Console::Print("ShutDown: %i\n", PadState[i].joy);
|
Console::Print("ShutDown: %i\n", PadState[i].joy);
|
||||||
|
@ -731,7 +731,7 @@ void Update()
|
||||||
|| g_Config.Nunchuck.Type == g_Config.Nunchuck.ANALOG1 || g_Config.Nunchuck.Type == g_Config.Nunchuck.ANALOG2
|
|| g_Config.Nunchuck.Type == g_Config.Nunchuck.ANALOG1 || g_Config.Nunchuck.Type == g_Config.Nunchuck.ANALOG2
|
||||||
|| g_Config.ClassicController.LType == g_Config.ClassicController.ANALOG1 || g_Config.ClassicController.LType == g_Config.ClassicController.ANALOG2
|
|| g_Config.ClassicController.LType == g_Config.ClassicController.ANALOG1 || g_Config.ClassicController.LType == g_Config.ClassicController.ANALOG2
|
||||||
|| g_Config.ClassicController.RType == g_Config.ClassicController.ANALOG1 || g_Config.ClassicController.RType == g_Config.ClassicController.ANALOG2)
|
|| g_Config.ClassicController.RType == g_Config.ClassicController.ANALOG1 || g_Config.ClassicController.RType == g_Config.ClassicController.ANALOG2)
|
||||||
&& NumGoodPads > 0 && joyinfo.size() > PadMapping[0].ID)
|
&& NumGoodPads > 0 && joyinfo.size() > unsigned int(PadMapping[0].ID))
|
||||||
{
|
{
|
||||||
const int Page = 0;
|
const int Page = 0;
|
||||||
WiiMoteEmu::GetJoyState(PadState[Page], PadMapping[Page], Page, joyinfo[PadMapping[Page].ID].NumButtons);
|
WiiMoteEmu::GetJoyState(PadState[Page], PadMapping[Page], Page, joyinfo[PadMapping[Page].ID].NumButtons);
|
||||||
|
|
|
@ -65,7 +65,7 @@ bool Search_Devices(std::vector<InputCommon::CONTROLLER_INFO> &_joyinfo, int &_N
|
||||||
// Update the PadState[].joy handle
|
// Update the PadState[].joy handle
|
||||||
for (int i = 0; i < 1; i++)
|
for (int i = 0; i < 1; i++)
|
||||||
{
|
{
|
||||||
if (PadMapping[i].enabled && joyinfo.size() > PadMapping[i].ID)
|
if (PadMapping[i].enabled && joyinfo.size() > unsigned int (PadMapping[i].ID))
|
||||||
if(joyinfo.at(PadMapping[i].ID).Good)
|
if(joyinfo.at(PadMapping[i].ID).Good)
|
||||||
PadState[i].joy = SDL_JoystickOpen(PadMapping[i].ID);
|
PadState[i].joy = SDL_JoystickOpen(PadMapping[i].ID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ void Config::Save(int Slot)
|
||||||
{
|
{
|
||||||
/* Save joypad specific settings. Check for "PadMapping[i].ID < SDL_NumJoysticks()" to
|
/* Save joypad specific settings. Check for "PadMapping[i].ID < SDL_NumJoysticks()" to
|
||||||
avoid reading a joyinfo that does't exist */
|
avoid reading a joyinfo that does't exist */
|
||||||
if(PadMapping[i].ID >= joyinfo.size()) continue;
|
if(unsigned int(PadMapping[i].ID) >= joyinfo.size()) continue;
|
||||||
|
|
||||||
// Create a new section name after the joypad name
|
// Create a new section name after the joypad name
|
||||||
SectionName = joyinfo[PadMapping[i].ID].Name;
|
SectionName = joyinfo[PadMapping[i].ID].Name;
|
||||||
|
@ -234,7 +234,7 @@ void Config::Load(bool ChangePad, bool ChangeSaveByID)
|
||||||
{
|
{
|
||||||
/* Prevent a crash from illegal access to joyinfo that will only have values for
|
/* Prevent a crash from illegal access to joyinfo that will only have values for
|
||||||
the current amount of connected pads */
|
the current amount of connected pads */
|
||||||
if(PadMapping[i].ID >= joyinfo.size()) continue;
|
if(unsigned int(PadMapping[i].ID) >= joyinfo.size()) continue;
|
||||||
|
|
||||||
// Create a section name
|
// Create a section name
|
||||||
SectionName = joyinfo[PadMapping[i].ID].Name;
|
SectionName = joyinfo[PadMapping[i].ID].Name;
|
||||||
|
|
|
@ -256,7 +256,7 @@ void ConfigBox::Update()
|
||||||
is not update when the emulator is paused. */
|
is not update when the emulator is paused. */
|
||||||
if (g_Config.bCheckFocus || IsFocus()) // && !g_EmulatorRunning)
|
if (g_Config.bCheckFocus || IsFocus()) // && !g_EmulatorRunning)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < joyinfo.size(); i++)
|
for (int i = 0; unsigned int(i) < joyinfo.size(); i++)
|
||||||
InputCommon::GetJoyState(PadState[i], PadMapping[i], i, joyinfo[PadMapping[i].ID].NumButtons);
|
InputCommon::GetJoyState(PadState[i], PadMapping[i], i, joyinfo[PadMapping[i].ID].NumButtons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -386,7 +386,7 @@ void ConfigBox::SetButtonTextAll(int id, char text[128])
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
// Safety check to avoid crash
|
// Safety check to avoid crash
|
||||||
if(joyinfo.size() > PadMapping[i].ID)
|
if(joyinfo.size() > unsigned int(PadMapping[i].ID))
|
||||||
if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[notebookpage].ID].Name)
|
if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[notebookpage].ID].Name)
|
||||||
SetButtonText(id, text, i);
|
SetButtonText(id, text, i);
|
||||||
};
|
};
|
||||||
|
@ -397,7 +397,7 @@ void ConfigBox::SaveButtonMappingAll(int Slot)
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
// This can occur when no gamepad is detected
|
// This can occur when no gamepad is detected
|
||||||
if(joyinfo.size() > PadMapping[i].ID)
|
if(joyinfo.size() > unsigned int(PadMapping[i].ID))
|
||||||
if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[Slot].ID].Name)
|
if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[Slot].ID].Name)
|
||||||
SaveButtonMapping(i, false, Slot);
|
SaveButtonMapping(i, false, Slot);
|
||||||
}
|
}
|
||||||
|
@ -414,7 +414,7 @@ void ConfigBox::UpdateGUIAll(int Slot)
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
// Safety check to avoid crash
|
// Safety check to avoid crash
|
||||||
if(joyinfo.size() > PadMapping[i].ID)
|
if(joyinfo.size() > unsigned int(PadMapping[i].ID))
|
||||||
if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[Slot].ID].Name)
|
if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[Slot].ID].Name)
|
||||||
UpdateGUI(i);
|
UpdateGUI(i);
|
||||||
}
|
}
|
||||||
|
@ -660,7 +660,7 @@ void ConfigBox::CreateGUIControls()
|
||||||
wxArrayString arrayStringFor_Joyname; // The string array
|
wxArrayString arrayStringFor_Joyname; // The string array
|
||||||
if(NumGoodPads > 0)
|
if(NumGoodPads > 0)
|
||||||
{
|
{
|
||||||
for(int x = 0; x < joyinfo.size(); x++)
|
for(int x = 0; unsigned int(x) < joyinfo.size(); x++)
|
||||||
{
|
{
|
||||||
arrayStringFor_Joyname.Add(wxString::FromAscii(joyinfo[x].Name.c_str()));
|
arrayStringFor_Joyname.Add(wxString::FromAscii(joyinfo[x].Name.c_str()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,7 +304,7 @@ void Shutdown()
|
||||||
vector elements or any bad devices */
|
vector elements or any bad devices */
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
if (PadMapping[i].enabled && joyinfo.size() > PadMapping[i].ID)
|
if (PadMapping[i].enabled && joyinfo.size() > unsigned int(PadMapping[i].ID))
|
||||||
if (joyinfo.at(PadMapping[i].ID).Good)
|
if (joyinfo.at(PadMapping[i].ID).Good)
|
||||||
if(SDL_JoystickOpened(PadMapping[i].ID))
|
if(SDL_JoystickOpened(PadMapping[i].ID))
|
||||||
{
|
{
|
||||||
|
@ -610,7 +610,7 @@ bool Search_Devices(std::vector<InputCommon::CONTROLLER_INFO> &_joyinfo, int &_N
|
||||||
// Update the PadState[].joy handle
|
// Update the PadState[].joy handle
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
if (PadMapping[i].enabled && joyinfo.size() > PadMapping[i].ID)
|
if (PadMapping[i].enabled && joyinfo.size() > unsigned int(PadMapping[i].ID))
|
||||||
if(joyinfo.at(PadMapping[i].ID).Good)
|
if(joyinfo.at(PadMapping[i].ID).Good)
|
||||||
PadState[i].joy = SDL_JoystickOpen(PadMapping[i].ID);
|
PadState[i].joy = SDL_JoystickOpen(PadMapping[i].ID);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue