From 24fdf942a4d08545121f9977ff6f8352a4a1d1de Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Thu, 29 Jul 2010 13:29:15 +0000 Subject: [PATCH] Use .cpp suffix when detecting libraries. On some systems, g++ is required to correctly link with C++ libraries like wxw. Tell OS X that the user is doing something when using the wiimote so that the screensaver doesn't come on when playing a Wii game. Replace unnecessary floating point with integer math. Remove unnecessary 's. Correct a few type nits. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5995 8ced0084-cf51-0410-be5f-012b33b47a6e --- Externals/WiiUse/Src/io_osx.m | 3 +++ SconsTests/utils.py | 4 ++-- SconsTests/wxconfig.py | 1 - Source/Core/Common/Src/MemArena.cpp | 1 - Source/Core/Core/Src/CoreParameter.cpp | 7 +++---- Source/Core/Core/Src/HW/Memmap.cpp | 2 +- Source/Core/Core/Src/HW/MemmapFunctions.cpp | 6 +++--- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 2 +- Source/Core/DolphinWX/Src/Frame.cpp | 4 ++-- Source/Core/DolphinWX/Src/GameListCtrl.cpp | 6 +++--- Source/Core/DolphinWX/Src/HotkeyDlg.cpp | 4 ++-- Source/Core/VideoCommon/Src/OpenCL/OCLTextureDecoder.cpp | 1 - Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h | 1 - Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h | 1 - 14 files changed, 20 insertions(+), 23 deletions(-) diff --git a/Externals/WiiUse/Src/io_osx.m b/Externals/WiiUse/Src/io_osx.m index a127ec69d0..0796ffca0e 100644 --- a/Externals/WiiUse/Src/io_osx.m +++ b/Externals/WiiUse/Src/io_osx.m @@ -31,6 +31,7 @@ * @brief Handles device I/O for OS X. */ +#import #define BLUETOOTH_VERSION_USE_CURRENT #import #import @@ -113,6 +114,8 @@ volatile int reader, writer, outstanding, watermark; } CFRunLoopStop(CFRunLoopGetCurrent()); + + UpdateSystemActivity(UsrActivity); } - (void) l2capChannelClosed: (IOBluetoothL2CAPChannel *) l2capChannel diff --git a/SconsTests/utils.py b/SconsTests/utils.py index 8c5c45c770..926516d247 100644 --- a/SconsTests/utils.py +++ b/SconsTests/utils.py @@ -17,7 +17,7 @@ def CheckLib(context, name): int main(int argc, char **argv) { return 0; } - \n""", '.c') + \n""", '.cpp') if not ret: context.env.Replace(LIBS = lastLIBS) @@ -72,7 +72,7 @@ def CheckPortaudio(context, version): printf("%d", Pa_GetVersion()); return 0; } - \n""", '.c')[1] + \n""", '.cpp')[1] if found: ret = (version <= found) diff --git a/SconsTests/wxconfig.py b/SconsTests/wxconfig.py index 287eb65ea9..71c654122e 100644 --- a/SconsTests/wxconfig.py +++ b/SconsTests/wxconfig.py @@ -7,7 +7,6 @@ # import os, os.path import re -import sys import glob import string diff --git a/Source/Core/Common/Src/MemArena.cpp b/Source/Core/Common/Src/MemArena.cpp index 38e9f7ef50..9b2c95261e 100644 --- a/Source/Core/Common/Src/MemArena.cpp +++ b/Source/Core/Common/Src/MemArena.cpp @@ -22,7 +22,6 @@ #ifdef _WIN32 #include #else -#include #include #include #include diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp index ad2303dcac..4d2f8fef28 100644 --- a/Source/Core/Core/Src/CoreParameter.cpp +++ b/Source/Core/Core/Src/CoreParameter.cpp @@ -47,8 +47,7 @@ SCoreStartupParameter::SCoreStartupParameter() bLockThreads(false), bEnableCheats(false), bRunCompareServer(false), bRunCompareClient(false), - iTLBHack(0), SelectedLanguage(0), - bWii(false), bMMU(false), + bMMU(false), iTLBHack(0), SelectedLanguage(0), bWii(false), bConfirmStop(false), bHideCursor(false), bAutoHideCursor(false), bUsePanicHandlers(true), iRenderWindowXPos(0), iRenderWindowYPos(0), @@ -70,10 +69,10 @@ void SCoreStartupParameter::LoadDefaults() bDSPThread = true; bLockThreads = true; bEnableFPRF = false; - bWii = false; - SelectedLanguage = 0; bMMU = false; iTLBHack = 0; + SelectedLanguage = 0; + bWii = false; iPosX = 100; iPosY = 100; diff --git a/Source/Core/Core/Src/HW/Memmap.cpp b/Source/Core/Core/Src/HW/Memmap.cpp index d512e0fe5a..64d985e3a1 100644 --- a/Source/Core/Core/Src/HW/Memmap.cpp +++ b/Source/Core/Core/Src/HW/Memmap.cpp @@ -423,7 +423,7 @@ u32 Read_Opcode_JIT(u32 _Address) #ifdef FAST_ICACHE if (bMMU && !bFakeVMEM && (_Address >> 28) == 0x7) { - _Address = Memory::TranslateAddress(_Address, Memory::XCheckTLBFlag::FLAG_OPCODE); + _Address = Memory::TranslateAddress(_Address, FLAG_OPCODE); if (_Address == 0) { return 0; diff --git a/Source/Core/Core/Src/HW/MemmapFunctions.cpp b/Source/Core/Core/Src/HW/MemmapFunctions.cpp index 6d91f35a93..afc0848a03 100644 --- a/Source/Core/Core/Src/HW/MemmapFunctions.cpp +++ b/Source/Core/Core/Src/HW/MemmapFunctions.cpp @@ -327,7 +327,7 @@ u32 Read_Opcode(u32 _Address) if (Core::g_CoreStartupParameter.bMMU && (_Address >> 28) == 0x7) { // TODO: Check for MSR instruction address translation flag before translating - u32 tlb_addr = Memory::TranslateAddress(_Address, Memory::XCheckTLBFlag::FLAG_OPCODE); + u32 tlb_addr = Memory::TranslateAddress(_Address, FLAG_OPCODE); if (tlb_addr == 0) { GenerateISIException(_Address); @@ -692,7 +692,7 @@ u32 LookupTLBPageAddress(const XCheckTLBFlag _Flag, const u32 vpa, u32 *paddr) u32 _Address = vpa; if (_Flag == FLAG_OPCODE) { - for (int i = (PowerPC::ppcState.itlb_last); i > (PowerPC::ppcState.itlb_last - 128); i--) + for (u32 i = (PowerPC::ppcState.itlb_last); i > (PowerPC::ppcState.itlb_last - 128); i--) { if ((_Address & ~0xfff) == (PowerPC::ppcState.itlb_va[i & 127])) { @@ -705,7 +705,7 @@ u32 LookupTLBPageAddress(const XCheckTLBFlag _Flag, const u32 vpa, u32 *paddr) } else { - for (int i = (PowerPC::ppcState.dtlb_last); i > (PowerPC::ppcState.dtlb_last - 128); i--) + for (u32 i = (PowerPC::ppcState.dtlb_last); i > (PowerPC::ppcState.dtlb_last - 128); i--) { if ((_Address & ~0xfff) == (PowerPC::ppcState.dtlb_va[i & 127])) { diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 81dd8c642d..0597892401 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -430,7 +430,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc if (Core::g_CoreStartupParameter.bMMU && (em_address >> 28) == 0x7) { - if (!Memory::TranslateAddress(em_address, Memory::XCheckTLBFlag::FLAG_OPCODE)) + if (!Memory::TranslateAddress(em_address, Memory::FLAG_OPCODE)) { // Memory exception occurred during instruction fetch memory_exception = true; diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 679b50c141..a42a4afe41 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -372,8 +372,8 @@ CFrame::CFrame(wxFrame* parent, // Create timer #if wxUSE_TIMER - int TimesPerSecond = 10; // We don't need more than this - m_timer.Start( floor((double)(1000 / TimesPerSecond)) ); + const int TimesPerSecond = 10; // We don't need more than this + m_timer.Start(1000 / TimesPerSecond); #endif // Create toolbar bitmaps diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index b65c48555d..ef46599e13 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -1278,10 +1278,10 @@ void CGameListCtrl::AutomaticColumnWidth() + 5); // some pad to keep the horizontal scrollbar away :) // We hide the Company column if the window is too small - if (0.5*resizable > 200) + if (resizable / 2 > 200) { - SetColumnWidth(COLUMN_TITLE, 0.5*resizable); - SetColumnWidth(COLUMN_NOTES, 0.5*resizable); + SetColumnWidth(COLUMN_TITLE, resizable / 2); + SetColumnWidth(COLUMN_NOTES, resizable / 2); } else { diff --git a/Source/Core/DolphinWX/Src/HotkeyDlg.cpp b/Source/Core/DolphinWX/Src/HotkeyDlg.cpp index 0770db0856..67e9c2b7d9 100644 --- a/Source/Core/DolphinWX/Src/HotkeyDlg.cpp +++ b/Source/Core/DolphinWX/Src/HotkeyDlg.cpp @@ -123,8 +123,8 @@ void HotkeyConfigDialog::SetButtonText(int id, const wxString &keystr, const wxS void HotkeyConfigDialog::DoGetButtons(int _GetId) { // Values used in this function - int Seconds = 4; // Seconds to wait for - int TimesPerSecond = 40; // How often to run the check + const int Seconds = 4; // Seconds to wait for + const int TimesPerSecond = 40; // How often to run the check // If the Id has changed or the timer is not running we should start one if( GetButtonWaitingID != _GetId || !m_ButtonMappingTimer->IsRunning() ) diff --git a/Source/Core/VideoCommon/Src/OpenCL/OCLTextureDecoder.cpp b/Source/Core/VideoCommon/Src/OpenCL/OCLTextureDecoder.cpp index b7827f430f..3a93a27ea6 100644 --- a/Source/Core/VideoCommon/Src/OpenCL/OCLTextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/OpenCL/OCLTextureDecoder.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include //#define DEBUG_OPENCL diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h index 380430c24f..303b921efd 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h @@ -67,7 +67,6 @@ #ifndef _WIN32 -#include #include typedef struct { diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h index df486264bd..8410aaa004 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h @@ -66,7 +66,6 @@ #ifndef _WIN32 -#include #include typedef struct {