Merge pull request #4376 from leoetlino/warning-fix

Warning fixes
This commit is contained in:
Markus Wick 2016-10-31 12:57:03 +01:00 committed by GitHub
commit 2afa877119
5 changed files with 28 additions and 14 deletions

View File

@ -33,7 +33,7 @@
namespace Common namespace Common
{ {
#if !defined(_WIN32) #if !defined(_WIN32) && defined(_M_X86_64) && !defined(MAP_32BIT)
#include <unistd.h> #include <unistd.h>
static uintptr_t RoundPage(uintptr_t addr) static uintptr_t RoundPage(uintptr_t addr)
{ {

View File

@ -122,6 +122,7 @@ bool CEXIETHERNET::SendFrame(const u8* frame, u32 size)
#endif #endif
} }
#ifdef __linux__
static void ReadThreadHandler(CEXIETHERNET* self) static void ReadThreadHandler(CEXIETHERNET* self)
{ {
while (!self->readThreadShutdown.IsSet()) while (!self->readThreadShutdown.IsSet())
@ -150,6 +151,7 @@ static void ReadThreadHandler(CEXIETHERNET* self)
} }
} }
} }
#endif
bool CEXIETHERNET::RecvInit() bool CEXIETHERNET::RecvInit()
{ {

View File

@ -344,8 +344,8 @@ static u32 AdvanceDTK(u32 maximum_samples, u32* samples_to_process)
{ {
if (s_audio_position >= s_current_start + s_current_length) if (s_audio_position >= s_current_start + s_current_length)
{ {
DEBUG_LOG(DVDINTERFACE, "AdvanceDTK: NextStart=%08x, NextLength=%08x, " DEBUG_LOG(DVDINTERFACE, "AdvanceDTK: NextStart=%08" PRIx64 ", NextLength=%08x, "
"CurrentStart=%08x, CurrentLength=%08x, AudioPos=%08x", "CurrentStart=%08" PRIx64 ", CurrentLength=%08x, AudioPos=%08" PRIx64,
s_next_start, s_next_length, s_current_start, s_current_length, s_audio_position); s_next_start, s_next_length, s_current_start, s_current_length, s_audio_position);
s_audio_position = s_next_start; s_audio_position = s_next_start;
@ -1005,19 +1005,20 @@ void ExecuteCommand(u32 command_0, u32 command_1, u32 command_2, u32 output_addr
switch (command_0 >> 16 & 0xFF) switch (command_0 >> 16 & 0xFF)
{ {
case 0x00: // Returns streaming status case 0x00: // Returns streaming status
INFO_LOG(DVDINTERFACE, "(Audio): Stream Status: Request Audio status AudioPos:%08x/%08x " INFO_LOG(DVDINTERFACE, "(Audio): Stream Status: Request Audio status "
"CurrentStart:%08x CurrentLength:%08x", "AudioPos:%08" PRIx64 "/%08" PRIx64 " "
"CurrentStart:%08" PRIx64 " CurrentLength:%08x",
s_audio_position, s_current_start + s_current_length, s_current_start, s_audio_position, s_current_start + s_current_length, s_current_start,
s_current_length); s_current_length);
WriteImmediate(s_stream ? 1 : 0, output_address, reply_to_ios); WriteImmediate(s_stream ? 1 : 0, output_address, reply_to_ios);
break; break;
case 0x01: // Returns the current offset case 0x01: // Returns the current offset
INFO_LOG(DVDINTERFACE, "(Audio): Stream Status: Request Audio status AudioPos:%08x", INFO_LOG(DVDINTERFACE, "(Audio): Stream Status: Request Audio status AudioPos:%08" PRIx64,
s_audio_position); s_audio_position);
WriteImmediate(static_cast<u32>(s_audio_position >> 2), output_address, reply_to_ios); WriteImmediate(static_cast<u32>(s_audio_position >> 2), output_address, reply_to_ios);
break; break;
case 0x02: // Returns the start offset case 0x02: // Returns the start offset
INFO_LOG(DVDINTERFACE, "(Audio): Stream Status: Request Audio status CurrentStart:%08x", INFO_LOG(DVDINTERFACE, "(Audio): Stream Status: Request Audio status CurrentStart:%08" PRIx64,
s_current_start); s_current_start);
WriteImmediate(static_cast<u32>(s_current_start >> 2), output_address, reply_to_ios); WriteImmediate(static_cast<u32>(s_current_start >> 2), output_address, reply_to_ios);
break; break;

View File

@ -292,6 +292,17 @@ static BOOL WINAPI s_ctrl_handler(DWORD fdwCtrlType)
} }
#endif #endif
#if defined(__unix__) || defined(__unix) || defined(__APPLE__)
static void SignalHandler(int)
{
const char message[] = "A signal was received. A second signal will force Dolphin to stop.\n";
if (write(STDERR_FILENO, message, sizeof(message)) < 0)
{
}
s_shutdown_signal_received.Set();
}
#endif
CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geometry, CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geometry,
bool use_debugger, bool batch_mode, bool show_log_window, long style) bool use_debugger, bool batch_mode, bool show_log_window, long style)
: CRenderFrame(parent, id, title, wxDefaultPosition, wxSize(800, 600), style), : CRenderFrame(parent, id, title, wxDefaultPosition, wxSize(800, 600), style),
@ -443,11 +454,7 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo
#if defined(__unix__) || defined(__unix) || defined(__APPLE__) #if defined(__unix__) || defined(__unix) || defined(__APPLE__)
struct sigaction sa; struct sigaction sa;
sa.sa_handler = [](int unused) { sa.sa_handler = SignalHandler;
char message[] = "A signal was received. A second signal will force Dolphin to stop.\n";
write(STDERR_FILENO, message, sizeof(message));
s_shutdown_signal_received.Set();
};
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESETHAND; sa.sa_flags = SA_RESETHAND;
sigaction(SIGINT, &sa, nullptr); sigaction(SIGINT, &sa, nullptr);

View File

@ -131,7 +131,9 @@ static void StopHotplugThread()
{ {
// Write something to efd so that select() stops blocking. // Write something to efd so that select() stops blocking.
uint64_t value = 1; uint64_t value = 1;
write(s_wakeup_eventfd, &value, sizeof(uint64_t)); if (write(s_wakeup_eventfd, &value, sizeof(uint64_t)) < 0)
{
}
s_hotplug_thread.join(); s_hotplug_thread.join();
} }
} }
@ -404,7 +406,9 @@ void evdevDevice::ForceFeedback::SetState(ControlState state)
play.code = m_id; play.code = m_id;
play.value = 1; play.value = 1;
write(m_fd, (const void*)&play, sizeof(play)); if (write(m_fd, &play, sizeof(play)) < 0)
{
}
} }
} }