Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more warning fixes
  • Loading branch information
SizzlingCalamari committed Nov 14, 2013
1 parent ca5b3b4 commit 39a4d43
Show file tree
Hide file tree
Showing 27 changed files with 89 additions and 70 deletions.
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/FifoPlayer/FifoDataFile.cpp
Expand Up @@ -86,7 +86,7 @@ bool FifoDataFile::Save(const char *filename)
header.xfRegsSize = XF_REGS_SIZE;

header.frameListOffset = frameListOffset;
header.frameCount = m_Frames.size();
header.frameCount = (u32)m_Frames.size();

header.flags = m_Flags;

Expand All @@ -111,7 +111,7 @@ bool FifoDataFile::Save(const char *filename)
dstFrame.fifoStart = srcFrame.fifoStart;
dstFrame.fifoEnd = srcFrame.fifoEnd;
dstFrame.memoryUpdatesOffset = memoryUpdatesOffset;
dstFrame.numMemoryUpdates = srcFrame.memoryUpdates.size();
dstFrame.numMemoryUpdates = (u32)srcFrame.memoryUpdates.size();

// Write frame info
u64 frameOffset = frameListOffset + (i * sizeof(FileFrameInfo));
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/FifoPlayer/FifoPlaybackAnalyzer.cpp
Expand Up @@ -234,7 +234,7 @@ u32 FifoPlaybackAnalyzer::DecodeCommand(u8 *data)
break;
}

return data - dataStart;
return (u32)(data - dataStart);
}

void FifoPlaybackAnalyzer::StoreEfbCopyRegion()
Expand Down
10 changes: 7 additions & 3 deletions Source/Core/Core/Src/FifoPlayer/FifoPlayer.cpp
Expand Up @@ -105,7 +105,9 @@ bool FifoPlayer::Play()
u32 FifoPlayer::GetFrameObjectCount()
{
if (m_CurrentFrame < m_FrameInfo.size())
return m_FrameInfo[m_CurrentFrame].objectStarts.size();
{
return (u32)(m_FrameInfo[m_CurrentFrame].objectStarts.size());
}

return 0;
}
Expand Down Expand Up @@ -172,7 +174,7 @@ void FifoPlayer::WriteFrame(const FifoFrameInfo &frame, const AnalyzedFrameInfo
m_FrameFifoSize = frame.fifoDataSize;

// Determine start and end objects
u32 numObjects = info.objectStarts.size();
u32 numObjects = (u32)(info.objectStarts.size());
u32 drawStart = std::min(numObjects, m_ObjectRangeStart);
u32 drawEnd = std::min(numObjects - 1, m_ObjectRangeEnd);

Expand All @@ -181,7 +183,9 @@ void FifoPlayer::WriteFrame(const FifoFrameInfo &frame, const AnalyzedFrameInfo

// Skip memory updates during frame if true
if (m_EarlyMemoryUpdates)
memoryUpdate = frame.memoryUpdates.size();
{
memoryUpdate = (u32)(frame.memoryUpdates.size());
}

if (numObjects > 0)
{
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/Src/FifoPlayer/FifoRecorder.cpp
Expand Up @@ -83,9 +83,9 @@ void FifoRecorder::WriteGPCommand(u8 *data, u32 size)
if (m_FrameEnded && m_FifoData.size() > 0)
{
size_t dataSize = m_FifoData.size();
m_CurrentFrame.fifoDataSize = dataSize;
m_CurrentFrame.fifoDataSize = (u32)dataSize;
m_CurrentFrame.fifoData = new u8[dataSize];
memcpy(m_CurrentFrame.fifoData, &m_FifoData[0], dataSize);
memcpy(m_CurrentFrame.fifoData, m_FifoData.data(), dataSize);

sMutex.lock();

Expand Down Expand Up @@ -129,7 +129,7 @@ void FifoRecorder::WriteMemory(u32 address, u32 size, MemoryUpdate::Type type)
// Record memory update
MemoryUpdate memUpdate;
memUpdate.address = address;
memUpdate.fifoPosition = m_FifoData.size();
memUpdate.fifoPosition = (u32)(m_FifoData.size());
memUpdate.size = size;
memUpdate.type = type;
memUpdate.data = new u8[size];
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/HW/DVDInterface.cpp
Expand Up @@ -325,7 +325,7 @@ void ChangeDisc(const char* _newFileName)
{
Movie::g_bDiscChange = true;
std::string fileName = _newFileName;
int sizeofpath = fileName.find_last_of("/\\") + 1;
auto sizeofpath = fileName.find_last_of("/\\") + 1;
if (fileName.substr(sizeofpath).length() > 40)
{
PanicAlert("Saving iso filename to .dtm failed; max file name length is 40 characters.");
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp
Expand Up @@ -191,7 +191,7 @@ void CEXIMemoryCard::CmdDone()
void CEXIMemoryCard::CmdDoneLater(u64 cycles)
{
CoreTiming::RemoveEvent(et_cmd_done);
CoreTiming::ScheduleEvent(cycles, et_cmd_done, (u64)card_index);
CoreTiming::ScheduleEvent((int)cycles, et_cmd_done, (u64)card_index);
}

void CEXIMemoryCard::SetCS(int cs)
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/HW/GCMemcard.cpp
Expand Up @@ -40,7 +40,7 @@ GCMemcard::GCMemcard(const char *filename, bool forceCreation, bool sjis)
PanicAlertT("File has the extension \"%s\"\nvalid extensions are (.raw/.gcp)", fileType.c_str());
return;
}
u32 size = mcdFile.GetSize();
auto size = mcdFile.GetSize();
if (size < MC_FST_BLOCKS*BLOCK_SIZE)
{
PanicAlertT("%s failed to load as a memorycard \nfile is not large enough to be a valid memory card file (0x%x bytes)", filename, size);
Expand All @@ -52,7 +52,7 @@ GCMemcard::GCMemcard(const char *filename, bool forceCreation, bool sjis)
return;
}

m_sizeMb = (size/BLOCK_SIZE) / MBIT_TO_BLOCKS;
m_sizeMb = (u16)((size/BLOCK_SIZE) / MBIT_TO_BLOCKS);
switch (m_sizeMb)
{
case MemCard59Mb:
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/HW/GCPadEmu.cpp
Expand Up @@ -209,5 +209,5 @@ void GCPad::LoadDefaults(const ControllerInterface& ciface)

bool GCPad::GetMicButton() const
{
return m_buttons->controls.back()->control_ref->State();
return (0 != m_buttons->controls.back()->control_ref->State());
}
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp
Expand Up @@ -32,7 +32,7 @@
namespace WiimoteEmu
{

void Spy(Wiimote* wm_, const void* data_, int size_)
void Spy(Wiimote* wm_, const void* data_, size_t size_)
{
#if 0
// enable log
Expand Down Expand Up @@ -1275,7 +1275,7 @@ void Wiimote::DoState(PointerWrap& p)
else
{
std::queue<ReadRequest> tmp_queue(m_read_requests);
size = m_read_requests.size();
size = (u32)(m_read_requests.size());
p.Do(size);
while (!tmp_queue.empty())
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/HW/WiimoteEmu/WiimoteEmu.cpp
Expand Up @@ -765,7 +765,7 @@ void Wiimote::Update()
if (-1 == rptf_size)
{
std::copy(rpt.begin(), rpt.end(), data);
rptf_size = rpt.size();
rptf_size = (s8)(rpt.size());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/HW/WiimoteEmu/WiimoteEmu.h
Expand Up @@ -96,7 +96,7 @@ inline double trim(double a)
class Wiimote : public ControllerEmu
{
friend class WiimoteReal::Wiimote;
friend void Spy(Wiimote* wm_, const void* data_, int size_);
friend void Spy(Wiimote* wm_, const void* data_, size_t size_);
public:

enum
Expand Down Expand Up @@ -245,7 +245,7 @@ friend void Spy(Wiimote* wm_, const void* data_, int size_);
} m_reg_speaker;
};

void Spy(Wiimote* wm_, const void* data_, int size_);
void Spy(Wiimote* wm_, const void* data_, size_t size_);

}

Expand Down
10 changes: 5 additions & 5 deletions Source/Core/Core/Src/HW/WiimoteReal/IOWin.cpp
Expand Up @@ -140,7 +140,7 @@ namespace WiimoteReal
{


int _IOWrite(HANDLE &dev_handle, OVERLAPPED &hid_overlap_write, enum win_bt_stack_t &stack, const u8* buf, int len);
int _IOWrite(HANDLE &dev_handle, OVERLAPPED &hid_overlap_write, enum win_bt_stack_t &stack, const u8* buf, size_t len);
int _IORead(HANDLE &dev_handle, OVERLAPPED &hid_overlap_read, u8* buf, int index);
void _IOWakeup(HANDLE &dev_handle, OVERLAPPED &hid_overlap_read);

Expand Down Expand Up @@ -247,7 +247,7 @@ void WiimoteScanner::FindWiimotes(std::vector<Wiimote*> & found_wiimotes, Wiimot
// SLEEP(2000);

}
int CheckDeviceType_Write(HANDLE &dev_handle, const u8* buf, int size, int attempts)
int CheckDeviceType_Write(HANDLE &dev_handle, const u8* buf, size_t size, int attempts)
{
OVERLAPPED hid_overlap_write = OVERLAPPED();
hid_overlap_write.hEvent = CreateEvent(NULL, true, false, NULL);
Expand Down Expand Up @@ -641,7 +641,7 @@ int Wiimote::IORead(u8* buf)
}


int _IOWrite(HANDLE &dev_handle, OVERLAPPED &hid_overlap_write, enum win_bt_stack_t &stack, const u8* buf, int len)
int _IOWrite(HANDLE &dev_handle, OVERLAPPED &hid_overlap_write, enum win_bt_stack_t &stack, const u8* buf, size_t len)
{
WiimoteEmu::Spy(NULL, buf, len);

Expand All @@ -663,7 +663,7 @@ int _IOWrite(HANDLE &dev_handle, OVERLAPPED &hid_overlap_write, enum win_bt_stac
}
case MSBT_STACK_MS:
{
auto result = HidD_SetOutputReport(dev_handle, const_cast<u8*>(buf) + 1, len - 1);
auto result = HidD_SetOutputReport(dev_handle, const_cast<u8*>(buf) + 1, (ULONG)(len - 1));
//FlushFileBuffers(dev_handle);

if (!result)
Expand Down Expand Up @@ -715,7 +715,7 @@ int _IOWrite(HANDLE &dev_handle, OVERLAPPED &hid_overlap_write, enum win_bt_stac
return 0;
}

int Wiimote::IOWrite(const u8* buf, int len)
int Wiimote::IOWrite(const u8* buf, size_t len)
{
return _IOWrite(dev_handle, hid_overlap_write, stack, buf, len);
}
Expand Down
8 changes: 6 additions & 2 deletions Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
Expand Up @@ -239,7 +239,9 @@ bool Wiimote::Write()
IOWrite(rpt.data(), rpt.size());

if (is_speaker_data)
{
m_last_audio_report.Update();
}

m_write_reports.Pop();
return true;
Expand Down Expand Up @@ -293,8 +295,10 @@ void Wiimote::Update()

// Send the report
if (!rpt.empty() && m_channel > 0)
Core::Callback_WiimoteInterruptChannel(index, m_channel,
rpt.data(), rpt.size());
{
Core::Callback_WiimoteInterruptChannel(index, m_channel,
rpt.data(), (u32)rpt.size());
}
}

void Wiimote::Prepare(int _index)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h
Expand Up @@ -106,7 +106,7 @@ friend class WiimoteEmu::Wiimote;
void WriteReport(Report rpt);

int IORead(u8* buf);
int IOWrite(u8 const* buf, int len);
int IOWrite(u8 const* buf, size_t len);
void IOWakeup();

void ThreadFunc();
Expand Down
6 changes: 4 additions & 2 deletions Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp
Expand Up @@ -83,7 +83,7 @@ static u64 last_reply_time;
void EnqueReplyCallback(u64 userdata, int)
{
std::lock_guard<std::mutex> lk(s_reply_queue);
reply_queue.push_back(userdata);
reply_queue.push_back((u32)userdata);
}

void Init()
Expand Down Expand Up @@ -546,7 +546,9 @@ void ExecuteCommand(u32 _Address)
const s64 ticks_til_last_reply = last_reply_time - CoreTiming::GetTicks();

if (ticks_til_last_reply > 0)
reply_delay = ticks_til_last_reply;
{
reply_delay = (int)ticks_til_last_reply;
}

last_reply_time = CoreTiming::GetTicks() + reply_delay;

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp
Expand Up @@ -133,7 +133,7 @@ void CWII_IPC_HLE_Device_es::DoState(PointerWrap& p)
p.Do(m_AccessIdentID);
p.Do(m_TitleIDs);

u32 Count = m_ContentAccessMap.size();
u32 Count = (u32)(m_ContentAccessMap.size());
p.Do(Count);

u32 CFD, Position;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp
Expand Up @@ -571,7 +571,7 @@ void CWII_IPC_HLE_Device_fs::DoState(PointerWrap& p)
}
else
{
u32 size = entry.size;
u32 size = (u32)entry.size;
p.Do(size);

File::IOFile handle(entry.physicalName, "rb");
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
Expand Up @@ -866,7 +866,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRoleChange(bdaddr_t _bd, bool

bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventNumberOfCompletedPackets()
{
SQueuedEvent Event(sizeof(hci_event_hdr_t) + sizeof(hci_num_compl_pkts_ep) + sizeof(hci_num_compl_pkts_info) * m_WiiMotes.size(), 0);
SQueuedEvent Event((u32)(sizeof(hci_event_hdr_t) + sizeof(hci_num_compl_pkts_ep) + (sizeof(hci_num_compl_pkts_info) * m_WiiMotes.size())), 0);

INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventNumberOfCompletedPackets");

Expand Down
9 changes: 5 additions & 4 deletions Source/Core/Core/Src/NetPlayClient.cpp
Expand Up @@ -445,10 +445,11 @@ void NetPlayClient::SendWiimoteState(const PadMapping in_game_pad, const NetWiim
sf::Packet spac;
spac << (MessageId)NP_MSG_WIIMOTE_DATA;
spac << in_game_pad;
u8 size = nw.size();
spac << size;
for (unsigned int i = 0; i < size; ++i)
spac << nw.data()[i];
spac << (u8)nw.size();
for (auto it : nw)
{
spac << it;
}

std::lock_guard<std::recursive_mutex> lks(m_crit.send);
m_socket.Send(spac);
Expand Down
6 changes: 4 additions & 2 deletions Source/Core/Core/Src/NetPlayServer.cpp
Expand Up @@ -153,7 +153,7 @@ unsigned int NetPlayServer::OnConnect(sf::SocketTCP& socket)
rpac >> player.name;

// give new client first available id
player.pid = m_players.size() + 1;
player.pid = (PlayerId)(m_players.size() + 1);

// try to automatically assign new user a pad
for (unsigned int m = 0; m < 4; ++m)
Expand Down Expand Up @@ -435,12 +435,14 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, sf::SocketTCP& socket)

case NP_MSG_PONG :
{
const u32 ping = m_ping_timer.GetTimeElapsed();
const u32 ping = (u32)m_ping_timer.GetTimeElapsed();
u32 ping_key = 0;
packet >> ping_key;

if (m_ping_key == ping_key)
{
player.ping = ping;
}

sf::Packet spac;
spac << (MessageId)NP_MSG_PLAYER_PING_DATA;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp
Expand Up @@ -234,7 +234,7 @@ const u8 *Jitx86Base::BackPatch(u8 *codePtr, u32 emAddress, void *ctx_void)
XEmitter emitter(start);
const u8 *trampoline = trampolines.GetWriteTrampoline(info, registersInUse);
emitter.CALL((void *)trampoline);
emitter.NOP(codePtr + info.instructionSize - emitter.GetCodePtr());
emitter.NOP((int)(codePtr + info.instructionSize - emitter.GetCodePtr()));
return start;
}
#else
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp
Expand Up @@ -323,7 +323,7 @@ void EmuCodeBlock::SafeWriteRegToReg(X64Reg reg_value, X64Reg reg_addr, int acce
MOV(32, M(&PC), Imm32(jit->js.compilerPC)); // Helps external systems know which instruction triggered the write
TEST(32, R(reg_addr), Imm32(mem_mask));
FixupBranch fast = J_CC(CC_Z, true);
bool noProlog = flags & SAFE_LOADSTORE_NO_PROLOG;
bool noProlog = (0 != (flags & SAFE_LOADSTORE_NO_PROLOG));
bool swap = !(flags & SAFE_LOADSTORE_NO_SWAP);
ABI_PushRegistersAndAdjustStack(registersInUse, noProlog);
switch (accessSize)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/PowerPC/PPCTables.cpp
Expand Up @@ -192,7 +192,7 @@ void PrintInstructionRunCounts()
{
op_inf x;
x.name = m_allInstructions[i]->opname;
x.count = m_allInstructions[i]->runCount;
x.count = (int)(m_allInstructions[i]->runCount);
temp.push_back(x);
}
std::sort(temp.begin(), temp.end());
Expand Down
8 changes: 6 additions & 2 deletions Source/Core/Core/Src/State.cpp
Expand Up @@ -247,7 +247,7 @@ void CompressAndDumpState(CompressAndDumpState_args save_args)
// Setting up the header
StateHeader header;
memcpy(header.gameID, SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID().c_str(), 6);
header.size = g_use_compression ? buffer_size : 0;
header.size = g_use_compression ? (u32)buffer_size : 0;
header.time = Common::Timer::GetDoubleTime();

f.WriteArray(&header, 1);
Expand All @@ -261,9 +261,13 @@ void CompressAndDumpState(CompressAndDumpState_args save_args)
lzo_uint out_len = 0;

if ((i + IN_LEN) >= buffer_size)
cur_len = buffer_size - i;
{
cur_len = (lzo_uint32)(buffer_size - i);
}
else
{
cur_len = IN_LEN;
}

if (lzo1x_1_compress(buffer_data + i, cur_len, out, &out_len, wrkmem) != LZO_E_OK)
PanicAlertT("Internal LZO Error - compression failed");
Expand Down

0 comments on commit 39a4d43

Please sign in to comment.