Fix some of the compiler warnings that have appeared recently.

This commit is contained in:
Glenn Rice 2013-05-05 23:22:57 -05:00
parent 46cd91dc0d
commit 12d791a628
4 changed files with 9 additions and 10 deletions

View File

@ -66,9 +66,8 @@ void CUCode_AX::LoadResamplingCoefficients()
WARN_LOG(DSPHLE, "Loading polyphase resampling coeffs from %s", filename.c_str()); WARN_LOG(DSPHLE, "Loading polyphase resampling coeffs from %s", filename.c_str());
FILE* fp = fopen(filename.c_str(), "rb"); File::IOFile fp(filename, "rb");
fread(m_coeffs, 1, 0x1000, fp); fp.ReadBytes(m_coeffs, 0x1000);
fclose(fp);
for (u32 i = 0; i < 0x800; ++i) for (u32 i = 0; i < 0x800; ++i)
m_coeffs[i] = Common::swap16(m_coeffs[i]); m_coeffs[i] = Common::swap16(m_coeffs[i]);

View File

@ -157,7 +157,7 @@ void VerifyBuffer(std::vector<u8>& buffer)
// return state number not in map // return state number not in map
int GetEmptySlot(std::map<double, int> m) int GetEmptySlot(std::map<double, int> m)
{ {
for (int i = 1; i <= NUM_STATES; i++) for (int i = 1; i <= (int)NUM_STATES; i++)
{ {
bool found = false; bool found = false;
for (std::map<double, int>::iterator it = m.begin(); it != m.end(); it++) for (std::map<double, int>::iterator it = m.begin(); it != m.end(); it++)
@ -173,12 +173,14 @@ int GetEmptySlot(std::map<double, int> m)
return -1; return -1;
} }
static std::string MakeStateFilename(int number);
// read state timestamps // read state timestamps
std::map<double, int> GetSavedStates() std::map<double, int> GetSavedStates()
{ {
StateHeader header; StateHeader header;
std::map<double, int> m; std::map<double, int> m;
for (int i = 1; i <= NUM_STATES; i++) for (int i = 1; i <= (int)NUM_STATES; i++)
{ {
if (File::Exists(MakeStateFilename(i))) if (File::Exists(MakeStateFilename(i)))
{ {
@ -570,7 +572,7 @@ void LoadLastSaved(int i)
{ {
std::map<double, int> savedStates = GetSavedStates(); std::map<double, int> savedStates = GetSavedStates();
if (i > savedStates.size()) if (i > (int)savedStates.size())
Core::DisplayMessage("State doesn't exist", 2000); Core::DisplayMessage("State doesn't exist", 2000);
else else
{ {

View File

@ -49,8 +49,6 @@ void SaveToBuffer(std::vector<u8>& buffer);
void LoadFromBuffer(std::vector<u8>& buffer); void LoadFromBuffer(std::vector<u8>& buffer);
void VerifyBuffer(std::vector<u8>& buffer); void VerifyBuffer(std::vector<u8>& buffer);
static std::string MakeStateFilename(int number);
void LoadLastSaved(int i = 1); void LoadLastSaved(int i = 1);
void SaveFirstSaved(); void SaveFirstSaved();
void UndoSaveState(); void UndoSaveState();

View File

@ -159,14 +159,14 @@ void CFrame::CreateMenu()
loadMenu->Append(IDM_UNDOLOADSTATE, GetMenuLabel(HK_UNDO_LOAD_STATE)); loadMenu->Append(IDM_UNDOLOADSTATE, GetMenuLabel(HK_UNDO_LOAD_STATE));
loadMenu->AppendSeparator(); loadMenu->AppendSeparator();
for (int i = 1; i <= State::NUM_STATES; i++) for (unsigned int i = 1; i <= State::NUM_STATES; i++)
{ {
loadMenu->Append(IDM_LOADSLOT1 + i - 1, GetMenuLabel(HK_LOAD_STATE_SLOT_1 + i - 1)); loadMenu->Append(IDM_LOADSLOT1 + i - 1, GetMenuLabel(HK_LOAD_STATE_SLOT_1 + i - 1));
saveMenu->Append(IDM_SAVESLOT1 + i - 1, GetMenuLabel(HK_SAVE_STATE_SLOT_1 + i - 1)); saveMenu->Append(IDM_SAVESLOT1 + i - 1, GetMenuLabel(HK_SAVE_STATE_SLOT_1 + i - 1));
} }
loadMenu->AppendSeparator(); loadMenu->AppendSeparator();
for (int i = 1; i <= State::NUM_STATES; i++) for (unsigned int i = 1; i <= State::NUM_STATES; i++)
loadMenu->Append(IDM_LOADLAST1 + i - 1, GetMenuLabel(HK_LOAD_LAST_STATE_1 + i - 1)); loadMenu->Append(IDM_LOADLAST1 + i - 1, GetMenuLabel(HK_LOAD_LAST_STATE_1 + i - 1));
m_MenuBar->Append(emulationMenu, _("&Emulation")); m_MenuBar->Append(emulationMenu, _("&Emulation"));