summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/AudioCommon/Src/Mixer.h2
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp4
-rw-r--r--Source/Core/Core/Src/HLE/HLE_OS.cpp2
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp2
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp2
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp12
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h2
-rw-r--r--Source/Core/Core/Src/MemTools.cpp35
-rw-r--r--Source/Core/DebuggerWX/Src/MemoryWindow.cpp2
-rw-r--r--Source/Core/DiscIO/Src/BannerLoader.cpp8
-rw-r--r--Source/Core/DolphinWX/Src/MainNoGUI.cpp2
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderGen.cpp9
12 files changed, 46 insertions, 36 deletions
diff --git a/Source/Core/AudioCommon/Src/Mixer.h b/Source/Core/AudioCommon/Src/Mixer.h
index 9682054b57..c1bf17be1a 100644
--- a/Source/Core/AudioCommon/Src/Mixer.h
+++ b/Source/Core/AudioCommon/Src/Mixer.h
@@ -44,6 +44,8 @@ public:
INFO_LOG(AUDIO_INTERFACE, "Mixer is initialized (AISampleRate:%i, DACSampleRate:%i)", AISampleRate, DACSampleRate);
}
+ virtual ~CMixer() {}
+
// Called from audio threads
virtual unsigned int Mix(short* samples, unsigned int numSamples);
virtual void Premix(short *samples, unsigned int numSamples) {}
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp
index 1080ae3f08..7722d4aab4 100644
--- a/Source/Core/Common/Src/FileUtil.cpp
+++ b/Source/Core/Common/Src/FileUtil.cpp
@@ -28,6 +28,7 @@
#include <io.h>
#include <direct.h> // getcwd
#else
+#include <sys/param.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
@@ -38,7 +39,6 @@
#include <CoreFoundation/CFString.h>
#include <CoreFoundation/CFURL.h>
#include <CoreFoundation/CFBundle.h>
-#include <sys/param.h>
#endif
#include <fstream>
@@ -48,7 +48,7 @@
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
#endif
-#if defined __NetBSD__ || defined __FreeBSD__ || defined __OpenBSD__
+#ifdef BSD4_4
#define stat64 stat // XXX
#endif
diff --git a/Source/Core/Core/Src/HLE/HLE_OS.cpp b/Source/Core/Core/Src/HLE/HLE_OS.cpp
index 9b08e7a9eb..eebff67ece 100644
--- a/Source/Core/Core/Src/HLE/HLE_OS.cpp
+++ b/Source/Core/Core/Src/HLE/HLE_OS.cpp
@@ -90,7 +90,7 @@ void GetStringVA(std::string& _rOutBuffer, u32 strReg)
*pArgument++ = *pString++;
*pArgument++ = *pString;
- *pArgument = NULL;
+ *pArgument = 0;
u64 Parameter;
if (ParameterCounter > 10)
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp
index 8a541bc201..27010a0186 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp
@@ -110,7 +110,7 @@ void Reset(bool _bHard)
if (itr->second)
{
// Force close
- itr->second->Close(NULL, true);
+ itr->second->Close(0, true);
// Hardware should not be deleted unless it is a hard reset
if (_bHard || !itr->second->IsHardware())
delete itr->second;
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
index 758684dd5a..b1d18789a3 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
@@ -288,7 +288,7 @@ void CWII_IPC_HLE_Device_FileIO::DoState(PointerWrap &p)
{
if (m_Mode)
{
- Open(NULL, m_Mode);
+ Open(0, m_Mode);
if (m_pFileHandle)
fseek(m_pFileHandle, m_Seek, SEEK_SET);
}
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
index 5d10198288..dcc7980f83 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
@@ -37,9 +37,9 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305::CWII_IPC_HLE_Device_usb_oh1_57e_305(u32 _De
, m_HostMaxSCOSize(0)
, m_HostNumACLPackets(0)
, m_HostNumSCOPackets(0)
- , m_HCIBuffer(NULL)
+ , m_HCIBuffer(0)
, m_HCIPool(0)
- , m_ACLBuffer(NULL)
+ , m_ACLBuffer(0)
, m_ACLPool(0)
, m_LastCmd(0)
, m_FreqDividerMote(0)
@@ -361,7 +361,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::SendACLPacket(u16 _ConnectionHandle, u
// Invalidate ACL buffer
m_ACLBuffer.m_address = 0;
- m_ACLBuffer.m_buffer = NULL;
+ m_ACLBuffer.m_buffer = 0;
}
else if ((sizeof(UACLHeader) + _Size) > ACL_MAX_SIZE )
{
@@ -411,7 +411,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::PurgeACLPool()
WII_IPC_HLE_Interface::EnqReply(m_ACLBuffer.m_address);
// Invalidate ACL buffer
m_ACLBuffer.m_address = 0;
- m_ACLBuffer.m_buffer = NULL;
+ m_ACLBuffer.m_buffer = 0;
}
}
@@ -548,7 +548,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::AddEventToQueue(const SQueuedEvent& _e
// Invalidate HCI buffer
m_HCIBuffer.m_address = 0;
- m_HCIBuffer.m_buffer = NULL;
+ m_HCIBuffer.m_buffer = 0;
}
else if (_event.m_size > HCI_MAX_SIZE)
{
@@ -593,7 +593,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::PurgeHCIPool()
WII_IPC_HLE_Interface::EnqReply(m_HCIBuffer.m_address);
// Invalidate ACL buffer
m_HCIBuffer.m_address = 0;
- m_HCIBuffer.m_buffer = NULL;
+ m_HCIBuffer.m_buffer = 0;
}
}
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h
index fef983a961..4f561fa19e 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h
@@ -234,7 +234,7 @@ private:
void SignalChannel(u8* _pData, u32 _Size);
void SendConnectionRequest(u16 _SCID, u16 _PSM);
- void SendConfigurationRequest(u16 _SCID, u16 _pMTU = NULL, u16 _pFlushTimeOut = NULL);
+ void SendConfigurationRequest(u16 _SCID, u16 _pMTU = 0, u16 _pFlushTimeOut = 0);
void SendDisconnectRequest(u16 _SCID);
void ReceiveConnectionReq(u8 _Ident, u8* _pData, u32 _Size);
diff --git a/Source/Core/Core/Src/MemTools.cpp b/Source/Core/Core/Src/MemTools.cpp
index 301a4ee445..8e09680902 100644
--- a/Source/Core/Core/Src/MemTools.cpp
+++ b/Source/Core/Core/Src/MemTools.cpp
@@ -16,30 +16,35 @@
// http://code.google.com/p/dolphin-emu/
-#ifndef _WIN32
+#ifdef _WIN32
+#include <windows.h>
+#else
#include <stdio.h>
#include <signal.h>
#include <sys/ucontext.h> // Look in here for the context definition.
-#ifdef __linux__
-#define CREG_RAX(ctx) (ctx)->gregs[REG_RAX]
-#define CREG_RIP(ctx) (ctx)->gregs[REG_RIP]
-#define CREG_EAX(ctx) (ctx)->gregs[REG_EAX]
-#define CREG_EIP(ctx) (ctx)->gregs[REG_EIP]
-#elif defined __APPLE__
+#endif
+
+#ifdef __APPLE__
#define CREG_RAX(ctx) (*(ctx))->__ss.__rax
#define CREG_RIP(ctx) (*(ctx))->__ss.__rip
#define CREG_EAX(ctx) (*(ctx))->__ss.__eax
#define CREG_EIP(ctx) (*(ctx))->__ss.__eip
-#else
+#elif defined __FreeBSD__
#define CREG_RAX(ctx) (ctx)->mc_rax
#define CREG_RIP(ctx) (ctx)->mc_rip
#define CREG_EAX(ctx) (ctx)->mc_eax
#define CREG_EIP(ctx) (ctx)->mc_eip
-#endif
-
-#else
-#include <windows.h>
-
+#elif defined __linux__
+#define CREG_RAX(ctx) (ctx)->gregs[REG_RAX]
+#define CREG_RIP(ctx) (ctx)->gregs[REG_RIP]
+#define CREG_EAX(ctx) (ctx)->gregs[REG_EAX]
+#define CREG_EIP(ctx) (ctx)->gregs[REG_EIP]
+#elif defined __NetBSD__
+#include <sys/siginfo.h>
+#define CREG_RAX(ctx) (ctx)->__gregs[_REG_RAX]
+#define CREG_RIP(ctx) (ctx)->__gregs[_REG_RIP]
+#define CREG_EAX(ctx) (ctx)->__gregs[_REG_EAX]
+#define CREG_EIP(ctx) (ctx)->__gregs[_REG_EIP]
#endif
#include <vector>
@@ -184,8 +189,8 @@ void sigsegv_handler(int signal, siginfo_t *info, void *raw_context)
return;
}
ucontext_t *context = (ucontext_t *)raw_context;
- int si_code = info->si_code;
- if (si_code != SEGV_MAPERR && si_code != SEGV_ACCERR)
+ int sicode = info->si_code;
+ if (sicode != SEGV_MAPERR && sicode != SEGV_ACCERR)
{
// Huh? Return.
return;
diff --git a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
index c6375ade4e..7d6b65fb30 100644
--- a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
+++ b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
@@ -324,7 +324,7 @@ void CMemoryWindow::onSearch(wxCommandEvent& event) {
std::vector<u8> Dest;//May need a better name
u32 size=0;
int pad=rawData.size()%2;//If it's uneven
- unsigned long i=0;
+ unsigned int i=0;
long count=0;
char copy[3]={0};
long newsize=0;
diff --git a/Source/Core/DiscIO/Src/BannerLoader.cpp b/Source/Core/DiscIO/Src/BannerLoader.cpp
index 168dbd31fb..64d3913317 100644
--- a/Source/Core/DiscIO/Src/BannerLoader.cpp
+++ b/Source/Core/DiscIO/Src/BannerLoader.cpp
@@ -27,16 +27,18 @@
#ifdef WIN32
#include <Windows.h>
#else
+#include <sys/param.h>
#include <iconv.h>
#include <errno.h>
#endif
-#ifdef __FreeBSD__
-#define ICONV_CONST const
-#endif
#ifndef ICONV_CONST
+#if defined __FreeBSD__ || __NetBSD__
+#define ICONV_CONST const
+#else
#define ICONV_CONST
#endif
+#endif
namespace DiscIO
{
diff --git a/Source/Core/DolphinWX/Src/MainNoGUI.cpp b/Source/Core/DolphinWX/Src/MainNoGUI.cpp
index 8636c8a8be..0668020b68 100644
--- a/Source/Core/DolphinWX/Src/MainNoGUI.cpp
+++ b/Source/Core/DolphinWX/Src/MainNoGUI.cpp
@@ -146,7 +146,7 @@ void X11_MainLoop()
X11Utils::XRRConfiguration *XRRConfig = new X11Utils::XRRConfiguration(dpy, win);
#endif
- Cursor blankCursor = NULL;
+ Cursor blankCursor = None;
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
{
// make a blank cursor
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
index 6cc3029ff2..1c5a615f8e 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
@@ -33,8 +33,9 @@ PIXELSHADERUID last_pixel_shader_uid;
// are set...
void GetPixelShaderId(PIXELSHADERUID *uid, u32 texturemask, u32 dstAlphaEnable)
{
+ u32 numstages = bpmem.genMode.numtevstages + 1;
u32 projtexcoords = 0;
- for (u32 i = 0; i < (u32)bpmem.genMode.numtevstages + 1; i++)
+ for (u32 i = 0; i < numstages; i++)
{
if (bpmem.tevorders[i/2].getEnable(i & 1))
{
@@ -66,7 +67,7 @@ void GetPixelShaderId(PIXELSHADERUID *uid, u32 texturemask, u32 dstAlphaEnable)
int hdr = 4;
u32 *pcurvalue = &uid->values[hdr];
- for (u32 i = 0; i < (u32)bpmem.genMode.numtevstages + 1; ++i)
+ for (u32 i = 0; i < numstages; ++i)
{
TevStageCombiner::ColorCombiner &cc = bpmem.combiners[i].colorC;
TevStageCombiner::AlphaCombiner &ac = bpmem.combiners[i].alphaC;
@@ -80,7 +81,7 @@ void GetPixelShaderId(PIXELSHADERUID *uid, u32 texturemask, u32 dstAlphaEnable)
pcurvalue += 2;
}
- for (u32 i = 0; i < ((u32)bpmem.genMode.numtevstages+1) / 2; ++i)
+ for (u32 i = 0; i < numstages / 2; ++i)
{
u32 val0, val1;
if (bpmem.tevorders[i].hex & 0x40)
@@ -100,7 +101,7 @@ void GetPixelShaderId(PIXELSHADERUID *uid, u32 texturemask, u32 dstAlphaEnable)
}
}
- if ((bpmem.genMode.numtevstages + 1) & 1) { // odd
+ if (numstages & 1) { // odd
u32 val0;
if (bpmem.tevorders[bpmem.genMode.numtevstages/2].hex & 0x40)
val0 = bpmem.tevorders[bpmem.genMode.numtevstages/2].hex & 0x3ff;