Linux compile fix.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2559 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Marcus Wanners 2009-03-05 15:58:14 +00:00
parent 67af94c339
commit c0cf641779
11 changed files with 24 additions and 24 deletions

View File

@ -34,7 +34,7 @@ CDolLoader::CDolLoader(const char* _szFilename)
u8* tmpBuffer = new u8[(size_t)size];
FILE* pStream = fopen(_szFilename, "rb");
fread(tmpBuffer, size_t(size), 1, pStream);
fread(tmpBuffer, (size_t)size, 1, pStream);
fclose(pStream);
m_bInit = Initialize(tmpBuffer, (u32)size);

View File

@ -35,7 +35,7 @@ CARCFile::CARCFile(const std::string& _rFilename)
if (pReader != NULL)
{
u64 FileSize = pReader->GetDataSize();
m_pBuffer = new u8[unsigned int(FileSize)];
m_pBuffer = new u8[(u32)FileSize];
pReader->Read(0, FileSize, m_pBuffer);
delete pReader;

View File

@ -106,8 +106,8 @@ bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
return false;
}
u64 Size = File::GetSize(TMDFileName.c_str());
u8* pTMD = new u8[unsigned int(Size)];
fread(pTMD, size_t(Size), 1, pTMDFile);
u8* pTMD = new u8[(u32)Size];
fread(pTMD, (size_t)Size, 1, pTMDFile);
fclose(pTMDFile);
//////
@ -135,11 +135,11 @@ bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
if (pFile != NULL)
{
u64 Size = File::GetSize(szFilename);
rContent.m_pData = new u8[unsigned int(Size)];
rContent.m_pData = new u8[(u32)Size];
_dbg_assert_msg_(BOOT, rContent.m_Size==Size, "TMDLoader: Filesize doesnt fit (%s %i)", szFilename, i);
fread(rContent.m_pData, size_t(Size), 1, pFile);
fread(rContent.m_pData, (size_t)Size, 1, pFile);
fclose(pFile);
} else {
ERROR_LOG(DISCIO, "CreateFromDirectory: error opening %s",

View File

@ -581,7 +581,7 @@ static void WriteStage(char *&p, int n, u32 texture_mask)
int texcoord = bpmem.tevorders[n/2].getTexCoord(n&1);
int texfun = xfregs.texcoords[texcoord].texmtxinfo.projection;
bool bHasTexCoord = unsigned int(texcoord) < bpmem.genMode.numtexgens;
bool bHasTexCoord = (u32)texcoord < bpmem.genMode.numtexgens;
bool bHasIndStage = bpmem.tevind[n].IsActive() && bpmem.tevind[n].bt < bpmem.genMode.numindstages;
// HACK to handle cases where the tex gen is not enabled

View File

@ -170,7 +170,7 @@ void Config::Load(bool ChangePad)
/* Prevent a crash from illegal access to joyinfo that will only have values for
the current amount of connected PadMapping */
if(unsigned int(WiiMoteEmu::PadMapping[i].ID) >= WiiMoteEmu::joyinfo.size()) continue;
if((u32)WiiMoteEmu::PadMapping[i].ID >= WiiMoteEmu::joyinfo.size()) continue;
// Create a section 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
avoid reading a joyinfo that does't exist */
if(unsigned int(WiiMoteEmu::PadMapping[i].ID) >= WiiMoteEmu::joyinfo.size()) continue;
if((u32)WiiMoteEmu::PadMapping[i].ID >= WiiMoteEmu::joyinfo.size()) continue;
// Create a new section name after the joypad name
SectionName = WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[i].ID].Name;

View File

@ -264,13 +264,13 @@ void LoadRecordedMovements()
VRecording.at(i).IRBytes = TmpIRBytes;
SRecording Tmp;
for (int j = 0, k = 0, l = 0; unsigned int(j) < TmpMovement.length(); j+=13)
for (int j = 0, k = 0, l = 0; (u32)j < TmpMovement.length(); j+=13)
{
// Skip blank savings
if (TmpMovement.length() < 3) continue;
// Avoid going to far, this can only happen with modified ini files, but we check for it anyway
if (TmpMovement.length() < unsigned int(j + 12)) continue;
if (TmpMovement.length() < (u32)j + 12) continue;
// Skip old style recordings
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;
for(int ii = 0; ii < TmpIRBytes; ii++)
{
if(TmpIR.length() < unsigned int((k + i + TmpIRBytes))) continue; // Safety check
if(TmpIR.length() < (u32)(k + i + TmpIRBytes)) continue; // Safety check
std::string TmpStr = TmpIR.substr(k + ii*2, 2);
u32 TmpU32;
AsciiToHex(TmpStr.c_str(), TmpU32);
@ -526,7 +526,7 @@ void Shutdown(void)
vector elements or any bad devices */
for (int i = 0; i < 1; i++)
{
if (PadMapping[i].enabled && joyinfo.size() > unsigned int(PadMapping[i].ID))
if (PadMapping[i].enabled && joyinfo.size() > (u32)PadMapping[i].ID)
if (joyinfo.at(PadMapping[i].ID).Good)
{
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.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)
&& NumGoodPads > 0 && joyinfo.size() > unsigned int(PadMapping[0].ID))
&& NumGoodPads > 0 && joyinfo.size() > (u32)PadMapping[0].ID)
{
const int Page = 0;
WiiMoteEmu::GetJoyState(PadState[Page], PadMapping[Page], Page, joyinfo[PadMapping[Page].ID].NumButtons);

View File

@ -65,7 +65,7 @@ bool Search_Devices(std::vector<InputCommon::CONTROLLER_INFO> &_joyinfo, int &_N
// Update the PadState[].joy handle
for (int i = 0; i < 1; i++)
{
if (PadMapping[i].enabled && joyinfo.size() > unsigned int (PadMapping[i].ID))
if (PadMapping[i].enabled && joyinfo.size() > (u32)PadMapping[i].ID)
if(joyinfo.at(PadMapping[i].ID).Good)
PadState[i].joy = SDL_JoystickOpen(PadMapping[i].ID);
}

View File

@ -141,7 +141,7 @@ void Config::Save(int Slot)
{
/* Save joypad specific settings. Check for "PadMapping[i].ID < SDL_NumJoysticks()" to
avoid reading a joyinfo that does't exist */
if(unsigned int(PadMapping[i].ID) >= joyinfo.size()) continue;
if((u32)PadMapping[i].ID >= joyinfo.size()) continue;
// Create a new section name after the joypad 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
the current amount of connected pads */
if(unsigned int(PadMapping[i].ID) >= joyinfo.size()) continue;
if((u32)PadMapping[i].ID >= joyinfo.size()) continue;
// Create a section name
SectionName = joyinfo[PadMapping[i].ID].Name;

View File

@ -256,7 +256,7 @@ void ConfigBox::Update()
is not update when the emulator is paused. */
if (g_Config.bCheckFocus || IsFocus()) // && !g_EmulatorRunning)
{
for (int i = 0; unsigned int(i) < joyinfo.size(); i++)
for (int i = 0; (u32)i < joyinfo.size(); i++)
InputCommon::GetJoyState(PadState[i], PadMapping[i], i, joyinfo[PadMapping[i].ID].NumButtons);
}

View File

@ -386,7 +386,7 @@ void ConfigBox::SetButtonTextAll(int id, char text[128])
for (int i = 0; i < 4; i++)
{
// Safety check to avoid crash
if(joyinfo.size() > unsigned int(PadMapping[i].ID))
if(joyinfo.size() > (u32)PadMapping[i].ID)
if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[notebookpage].ID].Name)
SetButtonText(id, text, i);
};
@ -397,7 +397,7 @@ void ConfigBox::SaveButtonMappingAll(int Slot)
for (int i = 0; i < 4; i++)
{
// This can occur when no gamepad is detected
if(joyinfo.size() > unsigned int(PadMapping[i].ID))
if(joyinfo.size() > (u32)PadMapping[i].ID)
if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[Slot].ID].Name)
SaveButtonMapping(i, false, Slot);
}
@ -414,7 +414,7 @@ void ConfigBox::UpdateGUIAll(int Slot)
for (int i = 0; i < 4; i++)
{
// Safety check to avoid crash
if(joyinfo.size() > unsigned int(PadMapping[i].ID))
if(joyinfo.size() > (u32)PadMapping[i].ID)
if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[Slot].ID].Name)
UpdateGUI(i);
}
@ -660,7 +660,7 @@ void ConfigBox::CreateGUIControls()
wxArrayString arrayStringFor_Joyname; // The string array
if(NumGoodPads > 0)
{
for(int x = 0; unsigned int(x) < joyinfo.size(); x++)
for(int x = 0; (u32)x < joyinfo.size(); x++)
{
arrayStringFor_Joyname.Add(wxString::FromAscii(joyinfo[x].Name.c_str()));
}

View File

@ -304,7 +304,7 @@ void Shutdown()
vector elements or any bad devices */
for (int i = 0; i < 4; i++)
{
if (PadMapping[i].enabled && joyinfo.size() > unsigned int(PadMapping[i].ID))
if (PadMapping[i].enabled && joyinfo.size() > (u32)PadMapping[i].ID)
if (joyinfo.at(PadMapping[i].ID).Good)
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
for (int i = 0; i < 4; i++)
{
if (PadMapping[i].enabled && joyinfo.size() > unsigned int(PadMapping[i].ID))
if (PadMapping[i].enabled && joyinfo.size() > (u32)PadMapping[i].ID)
if(joyinfo.at(PadMapping[i].ID).Good)
PadState[i].joy = SDL_JoystickOpen(PadMapping[i].ID);
}