From beba3b7f5bc20a8990a2b31569605586c31f43b5 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sun, 7 Mar 2010 22:48:37 +0000 Subject: [PATCH] Removed more compiler warnings in linux. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5170 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp | 4 ++-- Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp | 6 ++++-- Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp | 4 ++-- Source/Core/DiscIO/Src/VolumeWad.cpp | 2 +- Source/Core/DolphinWX/Src/LogWindow.cpp | 5 +++-- Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp | 2 +- Source/Core/DolphinWX/Src/NetWindow.cpp | 2 +- Source/Core/VideoCommon/Src/VertexLoader.h | 2 +- Source/Plugins/Plugin_GCPad/Src/ConfigBox.cpp | 2 +- Source/Plugins/Plugin_GCPad/Src/ConfigJoypad.cpp | 2 +- Source/Plugins/Plugin_GCPad/Src/Rumble.cpp | 2 -- Source/Plugins/Plugin_VideoOGL/Src/DLCache.cpp | 4 ++-- Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp | 4 ++++ Source/Plugins/Plugin_VideoSoftware/Src/Clipper.h | 5 ----- Source/Plugins/Plugin_VideoSoftware/Src/DebugUtil.cpp | 4 ++-- Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h | 2 +- Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp | 4 ++++ Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.h | 4 ---- Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp | 2 +- Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp | 2 +- Source/Plugins/Plugin_Wiimote/Src/ConfigRecordingDlg.cpp | 2 +- Source/Plugins/Plugin_Wiimote/Src/Rumble.cpp | 2 -- 22 files changed, 33 insertions(+), 35 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp b/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp index 5e9b2879a6..7d525a5c6d 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp @@ -34,7 +34,7 @@ using namespace Gen; -static int temp32; +//static int temp32; // unused? //TODO - make an option //#if _DEBUG @@ -43,7 +43,7 @@ static bool enableDebug = false; // bool enableDebug = false; //#endif -static bool enableStatistics = false; +//static bool enableStatistics = false; //unused? //GLOBAL STATIC ALLOCATIONS x86 //EAX - ubiquitous scratch register - EVERYBODY scratches this diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp index f5011716f0..bd0bf4338b 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp @@ -36,14 +36,16 @@ const u8 GC_ALIGNED16(pbswapShuffle2x4[16]) = {3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11, 12, 13, 14, 15}; -static u64 GC_ALIGNED16(temp64); +//static u64 GC_ALIGNED16(temp64); // unused? // TODO(ector): Improve 64-bit version +#if 0 static void WriteDual32(u64 value, u32 address) { Memory::Write_U32((u32)(value >> 32), address); Memory::Write_U32((u32)value, address + 4); } +#endif // The big problem is likely instructions that set the quantizers in the same block. // We will have to break block after quantizers are written to. @@ -66,12 +68,12 @@ void Jit64::psq_st(UGeckoInstruction inst) int s = inst.RS; // Fp numbers const UGQR gqr(rSPR(SPR_GQR0 + inst.I)); +#if 0 u16 store_gqr = gqr.Hex & 0xFFFF; const EQuantizeType stType = static_cast(gqr.ST_TYPE); int stScale = gqr.ST_SCALE; -#if 0 // Is this specialization still worth it? Let's keep it for now. It's probably // not very risky since a game most likely wouldn't use the same code to process // floats as integers (but you never know....). diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp index 7c6578910e..da692c3b47 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp @@ -35,7 +35,7 @@ using namespace Gen; -static int temp32; +//static int temp32; // unused? //TODO - make an option //#if _DEBUG @@ -44,7 +44,7 @@ static bool enableDebug = false; // bool enableDebug = false; //#endif -static bool enableStatistics = false; +//static bool enableStatistics = false; // unused? //GLOBAL STATIC ALLOCATIONS x86 //EAX - ubiquitous scratch register - EVERYBODY scratches this diff --git a/Source/Core/DiscIO/Src/VolumeWad.cpp b/Source/Core/DiscIO/Src/VolumeWad.cpp index 26e645693a..1777fd009b 100644 --- a/Source/Core/DiscIO/Src/VolumeWad.cpp +++ b/Source/Core/DiscIO/Src/VolumeWad.cpp @@ -119,7 +119,7 @@ std::string CVolumeWAD::GetName() const // Remove the null bytes due to 16bit char length std::string out_temp; - for (int i = 0; i < sizeof(temp); i+=2) + for (unsigned int i = 0; i < sizeof(temp); i+=2) { // Replace null chars with a single space per null section if (temp[i] == '\0' && i > 0) diff --git a/Source/Core/DolphinWX/Src/LogWindow.cpp b/Source/Core/DolphinWX/Src/LogWindow.cpp index 51a518622e..512333a95b 100644 --- a/Source/Core/DolphinWX/Src/LogWindow.cpp +++ b/Source/Core/DolphinWX/Src/LogWindow.cpp @@ -50,8 +50,9 @@ END_EVENT_TABLE() CLogWindow::CLogWindow(CFrame *parent, wxWindowID id, const wxString &, const wxPoint &position, const wxSize& size, long style) : wxPanel(parent, id, position, size, style) - , Parent(parent), m_LogSection(1), m_Log(NULL), m_cmdline(NULL), m_FontChoice(NULL) - , m_LogAccess(true) + , Parent(parent) , m_LogAccess(true) + , m_Log(NULL), m_cmdline(NULL), m_FontChoice(NULL) + , m_LogSection(1) , m_SJISConv(wxFONTENCODING_SHIFT_JIS) { m_LogManager = LogManager::GetInstance(); diff --git a/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp b/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp index 8650ac12ed..fd9ff073f0 100644 --- a/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp +++ b/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp @@ -359,7 +359,7 @@ void CWiiSaveCrypted::ExportWiiSaveFiles() if (__name.length() > 0x44) { - PanicAlert("% is too long for the filename, max chars is 45", __name.c_str()); + PanicAlert("%s is too long for the filename, max chars is 45", __name.c_str()); b_valid = false; return; } diff --git a/Source/Core/DolphinWX/Src/NetWindow.cpp b/Source/Core/DolphinWX/Src/NetWindow.cpp index cce0b6fef3..aa728b79f9 100644 --- a/Source/Core/DolphinWX/Src/NetWindow.cpp +++ b/Source/Core/DolphinWX/Src/NetWindow.cpp @@ -367,7 +367,7 @@ void NetPlay::UpdateNetWindow(bool update_infos, wxString infos) { m_critical.Enter(); //m_Game_str->SetLabel(wxString::Format(wxT(" Game : %s"), m_selectedGame.c_str())); - m_Game_str->SetLabel(wxString::FromUTF8( ( wxT( "Game %s"), m_selectedGame.c_str() ))); + m_Game_str->SetLabel(wxString::FromAscii(std::string("Game " + m_selectedGame).c_str())); m_critical.Leave(); } } diff --git a/Source/Core/VideoCommon/Src/VertexLoader.h b/Source/Core/VideoCommon/Src/VertexLoader.h index 993e6ac88e..8c72954530 100644 --- a/Source/Core/VideoCommon/Src/VertexLoader.h +++ b/Source/Core/VideoCommon/Src/VertexLoader.h @@ -69,7 +69,7 @@ public: private: size_t CalculateHash() { size_t h = -1; - for (int i = 0; i < sizeof(vid) / sizeof(vid[0]); ++i) { + for (unsigned int i = 0; i < sizeof(vid) / sizeof(vid[0]); ++i) { h = h * 137 + vid[i]; } return h; diff --git a/Source/Plugins/Plugin_GCPad/Src/ConfigBox.cpp b/Source/Plugins/Plugin_GCPad/Src/ConfigBox.cpp index 77bdbdb755..ddc072b01b 100644 --- a/Source/Plugins/Plugin_GCPad/Src/ConfigBox.cpp +++ b/Source/Plugins/Plugin_GCPad/Src/ConfigBox.cpp @@ -482,7 +482,7 @@ void GCPadConfigDialog::CreateGUIControls() }; // Configuration controls sizes - static const int TxtW = 50, TxtH = 20, BtW = 70, BtH = 20; + static const int BtW = 70, BtH = 20; // A small type font wxFont m_SmallFont(7, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); diff --git a/Source/Plugins/Plugin_GCPad/Src/ConfigJoypad.cpp b/Source/Plugins/Plugin_GCPad/Src/ConfigJoypad.cpp index 074ada733c..4dfe2d7c33 100644 --- a/Source/Plugins/Plugin_GCPad/Src/ConfigJoypad.cpp +++ b/Source/Plugins/Plugin_GCPad/Src/ConfigJoypad.cpp @@ -231,7 +231,7 @@ void GCPadConfigDialog::DoGetButtons(int _GetId) void GCPadConfigDialog::Convert2Box(int &x) { // Border adjustment - int BoxW_ = BoxW - 2; int BoxH_ = BoxH - 2; + int BoxW_ = BoxW - 2; // Convert values x = (BoxW_ / 2) + (x * BoxW_ / (32767 * 2)); } diff --git a/Source/Plugins/Plugin_GCPad/Src/Rumble.cpp b/Source/Plugins/Plugin_GCPad/Src/Rumble.cpp index e1dd20468d..de232afe8c 100644 --- a/Source/Plugins/Plugin_GCPad/Src/Rumble.cpp +++ b/Source/Plugins/Plugin_GCPad/Src/Rumble.cpp @@ -377,8 +377,6 @@ bool PAD_Init_Rumble(u8 _numPAD, SDL_Joystick *SDL_Device) // -------------- void PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength) { - int Strenght = 0; - #ifdef SDL_RUMBLE if (GCMapping[_numPAD].rumble) // rumble activated { diff --git a/Source/Plugins/Plugin_VideoOGL/Src/DLCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/DLCache.cpp index 5c3fc856d3..9ee0da3529 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/DLCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/DLCache.cpp @@ -124,9 +124,9 @@ bool AnalyzeAndRunDisplayList(u32 address, int size, CachedDisplayList *dl) { int num_xf_reg = 0; int num_cp_reg = 0; - int num_bp_reg = 0; + //int num_bp_reg = 0; // unused? int num_index_xf = 0; - int num_draw_call = 0; + //int num_draw_call = 0; // unused? u8 *old_datareader = g_pVideoData; g_pVideoData = Memory_GetPtr(address); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp index 4011c4b5e9..0507503267 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp @@ -59,6 +59,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace Clipper { + float m_ViewOffset[3]; + OutputVertexData ClippedVertices[18]; + OutputVertexData *Vertices[21]; + void Init() { for (int i = 0; i < 18; ++i) diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.h b/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.h index 7edf0ead9c..476b224783 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.h +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.h @@ -35,11 +35,6 @@ namespace Clipper bool CullTest(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2, bool &backface); void PerspectiveDivide(OutputVertexData *vertex); - - static float m_ViewOffset[3]; - - static OutputVertexData ClippedVertices[18]; - static OutputVertexData *Vertices[21]; } diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/DebugUtil.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/DebugUtil.cpp index eda50520bd..95a73d6721 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/DebugUtil.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/DebugUtil.cpp @@ -124,7 +124,7 @@ void DumpEfb(const char* filename) *(writePtr++) = sample[3]; } - bool result = SaveTGA(filename, EFB_WIDTH, EFB_HEIGHT, data); + SaveTGA(filename, EFB_WIDTH, EFB_HEIGHT, data); delete []data; } @@ -144,7 +144,7 @@ void DumpDepth(const char* filename) *(writePtr++) = 255; } - bool result = SaveTGA(filename, EFB_WIDTH, EFB_HEIGHT, data); + SaveTGA(filename, EFB_WIDTH, EFB_HEIGHT, data); delete []data; } diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h index 6b849f331e..f7f82a0475 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h @@ -149,7 +149,7 @@ bool OpenGL_ReportFBOError(const char *function, const char *file, int line); #if defined(_DEBUG) || defined(DEBUGFAST) #define GL_REPORT_ERRORD() OpenGL_ReportGLError(__FUNCTION__, __FILE__, __LINE__) #else -#define GL_REPORT_ERRORD() GL_NO_ERROR +#define GL_REPORT_ERRORD() #endif #endif // GLTEST ?? diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp index 9a0f3fb44f..cf85d494ac 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp @@ -32,6 +32,10 @@ namespace Rasterizer { +Slope ZSlope; +Slope WSlope; +Slope ColorSlopes[2][4]; +Slope TexSlopes[8][3]; s32 scissorLeft = 0; s32 scissorTop = 0; diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.h b/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.h index 3d7026fbe0..33c152703e 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.h +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.h @@ -40,10 +40,6 @@ namespace Rasterizer float GetValue(s32 x, s32 y) { return f0 + (dfdx * (x - x0)) + (dfdy * (y - y0)); } }; - static Slope ZSlope; - static Slope WSlope; - static Slope ColorSlopes[2][4]; - static Slope TexSlopes[8][3]; } #endif diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp index 226679fb86..e7001a537b 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp @@ -98,7 +98,7 @@ void Sample(float s, float t, float lod, u8 texmap, u8 *sample) u8 *imageSrc = g_VideoInitialize.pGetMemoryPointer(imageBase); bool linear = false; - if (lod > 0 && tm0.min_filter > 4 || lod <= 0 && tm0.mag_filter) + if ((lod > 0 && tm0.min_filter > 4) || (lod <= 0 && tm0.mag_filter)) linear = true; if (linear) diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp index c3faef67f9..a0249ac612 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp @@ -245,7 +245,7 @@ void WiimotePadConfigDialog::DoGetButtons(int _GetId) void WiimotePadConfigDialog::Convert2Box(int &x) { // Border adjustment - int BoxW_ = BoxW - 2; int BoxH_ = BoxH - 2; + int BoxW_ = BoxW - 2; // Convert values x = (BoxW_ / 2) + (x * BoxW_ / (32767 * 2)); } diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigRecordingDlg.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigRecordingDlg.cpp index 4d87ead5dd..69d7955b19 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ConfigRecordingDlg.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigRecordingDlg.cpp @@ -139,8 +139,8 @@ void WiimoteRecordingConfigDialog::RecordingChanged(wxCommandEvent& event) void WiimoteRecordingConfigDialog::UpdateRecordingGUI(int Slot) { // Disable all recording buttons - bool ActiveRecording = !(m_bWaitForRecording || m_bRecording); #ifdef _WIN32 + bool ActiveRecording = !(m_bWaitForRecording || m_bRecording); for(int i = IDB_RECORD + 1; i < (IDB_RECORD + RECORDING_ROWS + 1); i++) if(ControlsCreated) m_PageRecording->FindItem(i)->Enable(ActiveRecording); #endif diff --git a/Source/Plugins/Plugin_Wiimote/Src/Rumble.cpp b/Source/Plugins/Plugin_Wiimote/Src/Rumble.cpp index 6d4195fb91..48158f7738 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/Rumble.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/Rumble.cpp @@ -373,8 +373,6 @@ bool PAD_Init_Rumble(u8 _numPAD, SDL_Joystick *SDL_Device) // -------------- void PAD_Rumble(u8 _numPAD, unsigned int _uType) { - int Strenght = 0; - #ifdef SDL_RUMBLE if (WiiMapping[_numPAD].Rumble) // rumble activated {