From 22e1aa5bb4a159d6d66a321f978917614aa36331 Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 8 Jul 2014 14:29:26 +0200 Subject: [PATCH] mark all local functions as static --- Source/Core/AudioCommon/DPL2Decoder.cpp | 14 +++---- Source/Core/Common/CDUtils.cpp | 2 +- Source/Core/Common/ColorUtil.cpp | 2 +- Source/Core/Common/Crypto/bn.cpp | 1 + Source/Core/Common/MemoryUtil.cpp | 1 + Source/Core/Common/SysConf.cpp | 2 +- Source/Core/Core/ARDecrypt.cpp | 26 ++++++------ Source/Core/Core/Boot/ElfReader.cpp | 4 +- Source/Core/Core/Core.cpp | 6 +-- Source/Core/Core/CoreTiming.cpp | 8 ++-- Source/Core/Core/DSP/DSPAccelerator.cpp | 2 +- Source/Core/Core/DSP/DSPAnalyzer.cpp | 4 +- Source/Core/Core/DSP/DSPAssembler.cpp | 6 +-- Source/Core/Core/DSP/DSPDisassembler.cpp | 2 - Source/Core/Core/DSP/DSPTables.h | 2 + Source/Core/Core/DSP/Jit/DSPJitBranch.cpp | 12 +++--- .../Core/Core/Debugger/Debugger_SymbolMap.cpp | 4 +- Source/Core/Core/GeckoCode.cpp | 2 +- Source/Core/Core/GeckoCodeConfig.cpp | 2 +- Source/Core/Core/HLE/HLE_Misc.cpp | 1 + Source/Core/Core/HLE/HLE_OS.cpp | 4 +- Source/Core/Core/HW/BBA-TAP/TAP_Unix.cpp | 2 +- Source/Core/Core/HW/DSP.cpp | 2 +- .../Core/Core/HW/DSPHLE/UCodes/ZeldaVoice.cpp | 4 +- Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp | 2 +- Source/Core/Core/HW/DVDInterface.cpp | 4 +- Source/Core/Core/HW/GCMemcardRaw.cpp | 2 +- Source/Core/Core/HW/GCPad.cpp | 2 +- Source/Core/Core/HW/GPFifo.cpp | 2 +- Source/Core/Core/HW/Memmap.cpp | 4 +- Source/Core/Core/HW/MemmapFunctions.cpp | 8 ++-- Source/Core/Core/HW/ProcessorInterface.cpp | 2 +- Source/Core/Core/HW/SI.cpp | 2 +- Source/Core/Core/HW/SI_DeviceGBA.cpp | 4 +- Source/Core/Core/HW/StreamADPCM.cpp | 2 +- Source/Core/Core/HW/SystemTimers.cpp | 20 ++++----- Source/Core/Core/HW/WiimoteEmu/Encryption.cpp | 4 +- Source/Core/Core/HW/WiimoteEmu/UDPTLayer.h | 6 +-- .../Core/Core/HW/WiimoteReal/WiimoteReal.cpp | 10 ++--- .../Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp | 4 +- .../Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp | 2 +- Source/Core/Core/IPC_HLE/WII_Socket.cpp | 2 +- Source/Core/Core/Movie.cpp | 6 +-- Source/Core/Core/PatchEngine.cpp | 2 +- .../Core/PowerPC/Interpreter/Interpreter.cpp | 2 +- .../Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 8 ++-- Source/Core/Core/PowerPC/PPCAnalyst.cpp | 8 ++-- Source/Core/Core/PowerPC/PowerPC.cpp | 2 +- Source/Core/Core/PowerPC/Profiler.cpp | 1 + Source/Core/Core/State.cpp | 10 ++--- Source/Core/Core/Tracer.cpp | 1 + Source/Core/Core/ec_wii.cpp | 2 +- Source/Core/Core/x64MemTools.cpp | 6 +-- Source/Core/DiscIO/FileMonitor.cpp | 1 + Source/Core/DiscIO/VolumeCreator.cpp | 1 + .../DolphinWX/Debugger/DSPDebugWindow.cpp | 1 + .../Core/DolphinWX/Debugger/MemoryWindow.cpp | 2 +- Source/Core/DolphinWX/Frame.cpp | 2 +- Source/Core/DolphinWX/GameListCtrl.cpp | 8 ++-- Source/Core/DolphinWX/Main.cpp | 1 + Source/Core/DolphinWX/MemcardManager.cpp | 2 +- Source/Core/DolphinWX/NetWindow.cpp | 4 +- Source/Core/DolphinWX/VideoConfigDiag.cpp | 2 +- .../ControllerInterface/ExpressionParser.cpp | 2 +- .../ControllerInterface/SDL/SDL.cpp | 2 +- Source/Core/InputCommon/UDPWrapper.cpp | 2 +- .../OGL/GLExtensions/GLExtensions.cpp | 10 ++--- .../VideoBackends/OGL/ProgramShaderCache.cpp | 2 +- Source/Core/VideoBackends/OGL/Render.cpp | 14 +++---- Source/Core/VideoBackends/OGL/main.cpp | 4 +- .../Core/VideoBackends/Software/Clipper.cpp | 6 +-- .../Core/VideoBackends/Software/DebugUtil.cpp | 8 ++-- .../Core/VideoBackends/Software/EfbCopy.cpp | 6 +-- .../VideoBackends/Software/EfbInterface.cpp | 22 +++++----- .../VideoBackends/Software/HwRasterizer.cpp | 8 ++-- .../VideoBackends/Software/OpcodeDecoder.cpp | 8 ++-- .../VideoBackends/Software/Rasterizer.cpp | 6 +-- .../Software/SWCommandProcessor.cpp | 6 +-- .../VideoBackends/Software/SWRenderer.cpp | 2 +- Source/Core/VideoBackends/Software/SWmain.cpp | 2 +- .../VideoBackends/Software/TextureEncoder.cpp | 16 +++---- .../VideoBackends/Software/TransformUnit.cpp | 20 ++++----- Source/Core/VideoCommon/CommandProcessor.cpp | 4 +- Source/Core/VideoCommon/Fifo.h | 3 ++ Source/Core/VideoCommon/MainBase.cpp | 4 +- Source/Core/VideoCommon/OpcodeDecoding.cpp | 7 +--- Source/Core/VideoCommon/PixelEngine.cpp | 2 +- .../VideoCommon/TextureConversionShader.cpp | 42 +++++++++---------- .../Core/VideoCommon/TextureDecoder_x64.cpp | 8 ++-- Source/Core/VideoCommon/VertexLoader.cpp | 18 ++++---- .../VideoCommon/VertexLoader_TextCoord.cpp | 2 +- .../Core/VideoCommon/VertexShaderManager.cpp | 2 +- Source/Core/VideoCommon/XFStructs.cpp | 4 +- 93 files changed, 260 insertions(+), 251 deletions(-) diff --git a/Source/Core/AudioCommon/DPL2Decoder.cpp b/Source/Core/AudioCommon/DPL2Decoder.cpp index 1cddf54600..883584e650 100644 --- a/Source/Core/AudioCommon/DPL2Decoder.cpp +++ b/Source/Core/AudioCommon/DPL2Decoder.cpp @@ -83,7 +83,7 @@ template static T firfilter(const T *buf, int pos, int len, int count, // n window length // w buffer for the window parameters */ -void hamming(int n, float* w) +static void hamming(int n, float* w) { int i; float k = float(2*M_PI/((float)(n-1))); // 2*pi/(N-1) @@ -110,7 +110,7 @@ opt beta constant used only when designing using kaiser windows returns 0 if OK, -1 if fail */ -float* design_fir(unsigned int *n, float* fc, float opt) +static float* design_fir(unsigned int *n, float* fc, float opt) { unsigned int o = *n & 1; // Indicator for odd filter length unsigned int end = ((*n + 1) >> 1) - o; // Loop end @@ -165,7 +165,7 @@ float* design_fir(unsigned int *n, float* fc, float opt) return w; } -void onSeek(void) +static void onSeek(void) { l_fwr = r_fwr = lpr_fwr = lmr_fwr = 0; std::fill(fwrbuf_l.begin(), fwrbuf_l.end(), 0.0f); @@ -181,7 +181,7 @@ void onSeek(void) memset(LFE_buf, 0, sizeof(LFE_buf)); } -void done(void) +static void done(void) { onSeek(); if (filter_coefs_lfe) @@ -191,7 +191,7 @@ void done(void) filter_coefs_lfe = nullptr; } -float* calc_coefficients_125Hz_lowpass(int rate) +static float* calc_coefficients_125Hz_lowpass(int rate) { len125 = 256; float f = 125.0f / (rate / 2); @@ -204,7 +204,7 @@ float* calc_coefficients_125Hz_lowpass(int rate) return coeffs; } -float passive_lock(float x) +static float passive_lock(float x) { static const float MATAGCLOCK = 0.2f; /* AGC range (around 1) where the matrix behaves passively */ const float x1 = x - 1; @@ -212,7 +212,7 @@ float passive_lock(float x) return x1 - x1 / (1 + ax1s * ax1s) + 1; } -void matrix_decode(const float *in, const int k, const int il, +static void matrix_decode(const float *in, const int k, const int il, const int ir, bool decode_rear, const int _dlbuflen, float _l_fwr, float _r_fwr, diff --git a/Source/Core/Common/CDUtils.cpp b/Source/Core/Common/CDUtils.cpp index 4dfdcacd64..e0ccd20dab 100644 --- a/Source/Core/Common/CDUtils.cpp +++ b/Source/Core/Common/CDUtils.cpp @@ -155,7 +155,7 @@ static struct }; // Returns true if a device is a block or char device and not a symbolic link -bool is_device(const std::string& source_name) +static bool is_device(const std::string& source_name) { struct stat buf; if (0 != lstat(source_name.c_str(), &buf)) diff --git a/Source/Core/Common/ColorUtil.cpp b/Source/Core/Common/ColorUtil.cpp index 0930668fe4..f0ff3b32b5 100644 --- a/Source/Core/Common/ColorUtil.cpp +++ b/Source/Core/Common/ColorUtil.cpp @@ -16,7 +16,7 @@ const int lut4to8[] = { 0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77, 0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF }; const int lut3to8[] = { 0x00,0x24,0x48,0x6D,0x91,0xB6,0xDA,0xFF }; -u32 Decode5A3(u16 val) +static u32 Decode5A3(u16 val) { const u32 bg_color = 0x00000000; diff --git a/Source/Core/Common/Crypto/bn.cpp b/Source/Core/Common/Crypto/bn.cpp index 4f7c93e841..425a9aa795 100644 --- a/Source/Core/Common/Crypto/bn.cpp +++ b/Source/Core/Common/Crypto/bn.cpp @@ -6,6 +6,7 @@ #include #include "Common/Common.h" +#include "Common/Crypto/bn.h" static void bn_zero(u8 *d, u32 n) { diff --git a/Source/Core/Common/MemoryUtil.cpp b/Source/Core/Common/MemoryUtil.cpp index bb3ddf58a4..0ae08ced89 100644 --- a/Source/Core/Common/MemoryUtil.cpp +++ b/Source/Core/Common/MemoryUtil.cpp @@ -7,6 +7,7 @@ #include #include "Common/Common.h" +#include "Common/MemoryUtil.h" #ifdef _WIN32 #include diff --git a/Source/Core/Common/SysConf.cpp b/Source/Core/Common/SysConf.cpp index 6cd4f1bce2..46ced20fc3 100644 --- a/Source/Core/Common/SysConf.cpp +++ b/Source/Core/Common/SysConf.cpp @@ -154,7 +154,7 @@ bool SysConf::LoadFromFileInternal(FILE *fh) } // Returns the size of the item in file -unsigned int create_item(SSysConfEntry &item, SysconfType type, const std::string &name, +static unsigned int create_item(SSysConfEntry &item, SysconfType type, const std::string &name, const int data_length, unsigned int offset) { item.offset = offset; diff --git a/Source/Core/Core/ARDecrypt.cpp b/Source/Core/Core/ARDecrypt.cpp index 7867e0511a..46e456ebc0 100644 --- a/Source/Core/Core/ARDecrypt.cpp +++ b/Source/Core/Core/ARDecrypt.cpp @@ -143,7 +143,7 @@ const u32 table7[0x40] = { }; -void generateseeds(u32 *seeds, const u8 *seedtable, u8 doreverse) +static void generateseeds(u32 *seeds, const u8 *seedtable, u8 doreverse) { u32 tmp3; u8 array0[0x38],array1[0x38],array2[0x08]; @@ -208,24 +208,24 @@ void generateseeds(u32 *seeds, const u8 *seedtable, u8 doreverse) } } -void buildseeds() +static void buildseeds() { generateseeds(genseeds,gensubtable,0); } -void getcode(u32 *src, u32 *addr, u32 *val) +static void getcode(u32 *src, u32 *addr, u32 *val) { *addr = Common::swap32(src[0]); *val = Common::swap32(src[1]); } -void setcode(u32 *dst, u32 addr, u32 val) +static void setcode(u32 *dst, u32 addr, u32 val) { dst[0] = Common::swap32(addr); dst[1] = Common::swap32(val); } -u16 gencrc16(u32 *codes, u16 size) +static u16 gencrc16(u32 *codes, u16 size) { u16 ret = 0; @@ -243,13 +243,13 @@ u16 gencrc16(u32 *codes, u16 size) return ret; } -u8 verifycode(u32 *codes, u16 size) +static u8 verifycode(u32 *codes, u16 size) { u16 tmp = gencrc16(codes,size); return (((tmp>>12)^(tmp>>8)^(tmp>>4)^tmp)&0x0F); } -void unscramble1(u32 *addr, u32 *val) +static void unscramble1(u32 *addr, u32 *val) { u32 tmp; @@ -276,7 +276,7 @@ void unscramble1(u32 *addr, u32 *val) *val ^= tmp; } -void unscramble2(u32 *addr, u32 *val) +static void unscramble2(u32 *addr, u32 *val) { u32 tmp; @@ -303,7 +303,7 @@ void unscramble2(u32 *addr, u32 *val) *addr = _rotr((*addr^tmp),4); } -void decryptcode(u32 *seeds, u32 *code) +static void decryptcode(u32 *seeds, u32 *code) { u32 addr,val; u32 tmp,tmp2; @@ -325,7 +325,7 @@ void decryptcode(u32 *seeds, u32 *code) setcode(code,val,addr); } -bool getbitstring(u32 *ctrl, u32 *out, u8 len) +static bool getbitstring(u32 *ctrl, u32 *out, u8 len) { u32 tmp=(ctrl[0]+(ctrl[1]<<2)); @@ -348,7 +348,7 @@ bool getbitstring(u32 *ctrl, u32 *out, u8 len) return true; } -bool batchdecrypt(u32 *codes, u16 size) +static bool batchdecrypt(u32 *codes, u16 size) { u32 tmp,*ptr=codes; u32 tmparray[4] = { 0 },tmparray2[8] = { 0 }; @@ -391,7 +391,7 @@ bool batchdecrypt(u32 *codes, u16 size) // Unfinished (so says Parasyte :p ) } -int GetVal(const char *flt, char chr) +static int GetVal(const char *flt, char chr) { int ret = (int)(strchr(flt,chr) - flt); switch (ret) @@ -410,7 +410,7 @@ int GetVal(const char *flt, char chr) return ret; } -int alphatobin(u32 *dst, std::vector alpha, int size) +static int alphatobin(u32 *dst, std::vector alpha, int size) { int j = 0; int ret = 0; diff --git a/Source/Core/Core/Boot/ElfReader.cpp b/Source/Core/Core/Boot/ElfReader.cpp index 2621f84586..8428d4ef63 100644 --- a/Source/Core/Core/Boot/ElfReader.cpp +++ b/Source/Core/Core/Boot/ElfReader.cpp @@ -11,8 +11,8 @@ #include "Core/HW/Memmap.h" #include "Core/PowerPC/PPCSymbolDB.h" -void bswap(Elf32_Word &w) {w = Common::swap32(w);} -void bswap(Elf32_Half &w) {w = Common::swap16(w);} +static void bswap(Elf32_Word &w) {w = Common::swap32(w);} +static void bswap(Elf32_Half &w) {w = Common::swap16(w);} static void byteswapHeader(Elf32_Ehdr &ELF_H) { diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index b5be916b1e..d23436760d 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -139,7 +139,7 @@ void DisplayMessage(const std::string& message, int time_in_ms) } } -void Callback_DebuggerBreak() +static void Callback_DebuggerBreak() { CCPU::Break(); } @@ -264,7 +264,7 @@ void Stop() // - Hammertime! } // Create the CPU thread, which is a CPU + Video thread in Single Core mode. -void CpuThread() +static void CpuThread() { const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; @@ -310,7 +310,7 @@ void CpuThread() return; } -void FifoPlayerThread() +static void FifoPlayerThread() { const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; diff --git a/Source/Core/Core/CoreTiming.cpp b/Source/Core/Core/CoreTiming.cpp index 73dfd862a7..5ebb4d84c4 100644 --- a/Source/Core/Core/CoreTiming.cpp +++ b/Source/Core/Core/CoreTiming.cpp @@ -62,7 +62,7 @@ int ev_lost; void (*advanceCallback)(int cyclesExecuted) = nullptr; -Event* GetNewEvent() +static Event* GetNewEvent() { if (!eventPool) return new Event; @@ -72,7 +72,7 @@ Event* GetNewEvent() return ev; } -void FreeEvent(Event* ev) +static void FreeEvent(Event* ev) { ev->next = eventPool; eventPool = ev; @@ -136,7 +136,7 @@ void Shutdown() } } -void EventDoState(PointerWrap &p, BaseEvent* ev) +static void EventDoState(PointerWrap &p, BaseEvent* ev) { p.Do(ev->time); @@ -234,7 +234,7 @@ void ClearPendingEvents() } } -void AddEventToQueue(Event* ne) +static void AddEventToQueue(Event* ne) { Event* prev = nullptr; Event** pNext = &first; diff --git a/Source/Core/Core/DSP/DSPAccelerator.cpp b/Source/Core/Core/DSP/DSPAccelerator.cpp index 9bac980a36..c330d404e3 100644 --- a/Source/Core/Core/DSP/DSPAccelerator.cpp +++ b/Source/Core/Core/DSP/DSPAccelerator.cpp @@ -5,11 +5,11 @@ #include "Common/Common.h" #include "Common/MathUtil.h" +#include "Core/DSP/DSPAccelerator.h" #include "Core/DSP/DSPCore.h" #include "Core/DSP/DSPHost.h" #include "Core/DSP/DSPHWInterface.h" #include "Core/DSP/DSPInterpreter.h" - // The hardware adpcm decoder :) static s16 ADPCM_Step(u32& _rSamplePos) { diff --git a/Source/Core/Core/DSP/DSPAnalyzer.cpp b/Source/Core/Core/DSP/DSPAnalyzer.cpp index 919d815e35..14cbbc1f46 100644 --- a/Source/Core/Core/DSP/DSPAnalyzer.cpp +++ b/Source/Core/Core/DSP/DSPAnalyzer.cpp @@ -60,12 +60,12 @@ const u16 idle_skip_sigs[NUM_IDLE_SIGS][MAX_IDLE_SIG_SIZE + 1] = 0, 0 } }; -void Reset() +static void Reset() { memset(code_flags, 0, sizeof(code_flags)); } -void AnalyzeRange(int start_addr, int end_addr) +static void AnalyzeRange(int start_addr, int end_addr) { // First we run an extremely simplified version of a disassembler to find // where all instructions start. diff --git a/Source/Core/Core/DSP/DSPAssembler.cpp b/Source/Core/Core/DSP/DSPAssembler.cpp index 0ac98bfd61..522754f9d2 100644 --- a/Source/Core/Core/DSP/DSPAssembler.cpp +++ b/Source/Core/Core/DSP/DSPAssembler.cpp @@ -160,14 +160,14 @@ void DSPAssembler::ShowError(err_t err_code, const char *extra_info) last_error = err_code; } -char *skip_spaces(char *ptr) +static char *skip_spaces(char *ptr) { while (*ptr == ' ') ptr++; return ptr; } -const char *skip_spaces(const char *ptr) +static const char *skip_spaces(const char *ptr) { while (*ptr == ' ') ptr++; @@ -510,7 +510,7 @@ const opc_t *DSPAssembler::FindOpcode(const char *opcode, u32 par_count, const o } // weird... -u16 get_mask_shifted_down(u16 mask) +static u16 get_mask_shifted_down(u16 mask) { while (!(mask & 1)) mask >>= 1; diff --git a/Source/Core/Core/DSP/DSPDisassembler.cpp b/Source/Core/Core/DSP/DSPDisassembler.cpp index 1827c749f3..7243cfddb6 100644 --- a/Source/Core/Core/DSP/DSPDisassembler.cpp +++ b/Source/Core/Core/DSP/DSPDisassembler.cpp @@ -35,8 +35,6 @@ #include "Core/DSP/DSPDisassembler.h" #include "Core/DSP/DSPTables.h" -extern void nop(const UDSPInstruction opc); - DSPDisassembler::DSPDisassembler(const AssemblerSettings &settings) : settings_(settings) { diff --git a/Source/Core/Core/DSP/DSPTables.h b/Source/Core/Core/DSP/DSPTables.h index 49e3ac9947..04255f66ad 100644 --- a/Source/Core/Core/DSP/DSPTables.h +++ b/Source/Core/Core/DSP/DSPTables.h @@ -54,6 +54,8 @@ enum partype_t #define OPTABLE_SIZE 0xffff + 1 #define EXT_OPTABLE_SIZE 0xff + 1 +void nop(const UDSPInstruction opc); + typedef void (*dspIntFunc)(const UDSPInstruction); typedef void (DSPEmitter::*dspJitFunc)(const UDSPInstruction); diff --git a/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp b/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp index 2086183a5a..abf9e7015b 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp +++ b/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp @@ -117,7 +117,7 @@ static void WriteBlockLink(DSPEmitter& emitter, u16 dest) } } -void r_jcc(const UDSPInstruction opc, DSPEmitter& emitter) +static void r_jcc(const UDSPInstruction opc, DSPEmitter& emitter) { u16 dest = dsp_imem_read(emitter.compilePC + 1); const DSPOPCTemplate *opcode = GetOpTemplate(opc); @@ -141,7 +141,7 @@ void DSPEmitter::jcc(const UDSPInstruction opc) ReJitConditional(opc, *this); } -void r_jmprcc(const UDSPInstruction opc, DSPEmitter& emitter) +static void r_jmprcc(const UDSPInstruction opc, DSPEmitter& emitter) { u8 reg = (opc >> 5) & 0x7; //reg can only be DSP_REG_ARx and DSP_REG_IXx now, @@ -161,7 +161,7 @@ void DSPEmitter::jmprcc(const UDSPInstruction opc) ReJitConditional(opc, *this); } -void r_call(const UDSPInstruction opc, DSPEmitter& emitter) +static void r_call(const UDSPInstruction opc, DSPEmitter& emitter) { emitter.MOV(16, R(DX), Imm16(emitter.compilePC + 2)); emitter.dsp_reg_store_stack(DSP_STACK_C); @@ -188,7 +188,7 @@ void DSPEmitter::call(const UDSPInstruction opc) ReJitConditional(opc, *this); } -void r_callr(const UDSPInstruction opc, DSPEmitter& emitter) +static void r_callr(const UDSPInstruction opc, DSPEmitter& emitter) { u8 reg = (opc >> 5) & 0x7; emitter.MOV(16, R(DX), Imm16(emitter.compilePC + 1)); @@ -210,7 +210,7 @@ void DSPEmitter::callr(const UDSPInstruction opc) ReJitConditional(opc, *this); } -void r_ifcc(const UDSPInstruction opc, DSPEmitter& emitter) +static void r_ifcc(const UDSPInstruction opc, DSPEmitter& emitter) { emitter.MOV(16, M(&g_dsp.pc), Imm16(emitter.compilePC + 1)); } @@ -226,7 +226,7 @@ void DSPEmitter::ifcc(const UDSPInstruction opc) WriteBranchExit(*this); } -void r_ret(const UDSPInstruction opc, DSPEmitter& emitter) +static void r_ret(const UDSPInstruction opc, DSPEmitter& emitter) { emitter.dsp_reg_load_stack(DSP_STACK_C); emitter.MOV(16, M(&g_dsp.pc), R(DX)); diff --git a/Source/Core/Core/Debugger/Debugger_SymbolMap.cpp b/Source/Core/Core/Debugger/Debugger_SymbolMap.cpp index b0dab163a5..28ea593826 100644 --- a/Source/Core/Core/Debugger/Debugger_SymbolMap.cpp +++ b/Source/Core/Core/Debugger/Debugger_SymbolMap.cpp @@ -37,12 +37,12 @@ void AddAutoBreakpoints() } // Returns true if the address is not a valid RAM address or NULL. -bool IsStackBottom(u32 addr) +static bool IsStackBottom(u32 addr) { return !addr || !Memory::IsRAMAddress(addr); } -void WalkTheStack(const std::function& stack_step) +static void WalkTheStack(const std::function& stack_step) { if (!IsStackBottom(PowerPC::ppcState.gpr[1])) { diff --git a/Source/Core/Core/GeckoCode.cpp b/Source/Core/Core/GeckoCode.cpp index df01a15b4f..cfb3da29e3 100644 --- a/Source/Core/Core/GeckoCode.cpp +++ b/Source/Core/Core/GeckoCode.cpp @@ -68,7 +68,7 @@ void SetActiveCodes(const std::vector& gcodes) code_handler_installed = false; } -bool InstallCodeHandler() +static bool InstallCodeHandler() { u32 codelist_location = 0x800028B8; // Debugger on location (0x800022A8 = Debugger off, using codehandleronly.bin) std::string data; diff --git a/Source/Core/Core/GeckoCodeConfig.cpp b/Source/Core/Core/GeckoCodeConfig.cpp index c2a3f11393..5c2a4173c9 100644 --- a/Source/Core/Core/GeckoCodeConfig.cpp +++ b/Source/Core/Core/GeckoCodeConfig.cpp @@ -97,7 +97,7 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector& lines, std::vector& enabledLines, const GeckoCode& gcode) +static void SaveGeckoCode(std::vector& lines, std::vector& enabledLines, const GeckoCode& gcode) { if (gcode.enabled) enabledLines.push_back("$" + gcode.name); diff --git a/Source/Core/Core/HLE/HLE_Misc.cpp b/Source/Core/Core/HLE/HLE_Misc.cpp index 01648f8d88..8d552232d9 100644 --- a/Source/Core/Core/HLE/HLE_Misc.cpp +++ b/Source/Core/Core/HLE/HLE_Misc.cpp @@ -11,6 +11,7 @@ #include "Core/Host.h" #include "Core/Boot/Boot_DOL.h" #include "Core/HLE/HLE.h" +#include "Core/HLE/HLE_Misc.h" #include "Core/HLE/HLE_OS.h" #include "Core/HW/Memmap.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device_DI.h" diff --git a/Source/Core/Core/HLE/HLE_OS.cpp b/Source/Core/Core/HLE/HLE_OS.cpp index 9aef24d1f0..2f08e854f5 100644 --- a/Source/Core/Core/HLE/HLE_OS.cpp +++ b/Source/Core/Core/HLE/HLE_OS.cpp @@ -46,7 +46,7 @@ void HLE_GeneralDebugPrint() NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, ReportMessage.c_str()); } -void HLE_VPrintf() +static void HLE_VPrintf() { std::string ReportMessage; u32 r4 = GPR(4); @@ -66,7 +66,7 @@ void HLE_VPrintf() NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, ReportMessage.c_str()); } // Generalized func for just printing string pointed to by r3. -void HLE_GeneralDebugPrintWithInt() +static void HLE_GeneralDebugPrintWithInt() { std::string ReportMessage; GetStringVA(ReportMessage, 5); diff --git a/Source/Core/Core/HW/BBA-TAP/TAP_Unix.cpp b/Source/Core/Core/HW/BBA-TAP/TAP_Unix.cpp index de4bbe6320..a8d1bfe0ca 100644 --- a/Source/Core/Core/HW/BBA-TAP/TAP_Unix.cpp +++ b/Source/Core/Core/HW/BBA-TAP/TAP_Unix.cpp @@ -106,7 +106,7 @@ bool CEXIETHERNET::SendFrame(u8* frame, u32 size) #endif } -void ReadThreadHandler(CEXIETHERNET* self) +static void ReadThreadHandler(CEXIETHERNET* self) { while (true) { diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp index 2394243396..e5ede8930d 100644 --- a/Source/Core/Core/HW/DSP.cpp +++ b/Source/Core/Core/HW/DSP.cpp @@ -207,7 +207,7 @@ void Update_DSP_WriteRegister(); int et_GenerateDSPInterrupt; -void GenerateDSPInterrupt_Wrapper(u64 userdata, int cyclesLate) +static void GenerateDSPInterrupt_Wrapper(u64 userdata, int cyclesLate) { GenerateDSPInterrupt((DSPInterruptType)(userdata&0xFFFF), (bool)((userdata>>16) & 1)); } diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/ZeldaVoice.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/ZeldaVoice.cpp index b1730672e0..1aa91b9d7c 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/ZeldaVoice.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/ZeldaVoice.cpp @@ -91,7 +91,7 @@ void ZeldaUCode::Resample(ZeldaVoicePB &PB, int size, s16 *in, s32 *out, bool do PB.CurSampleFrac = position & 0xFFFF; } -void UpdateSampleCounters10(ZeldaVoicePB &PB) +static void UpdateSampleCounters10(ZeldaVoicePB &PB) { PB.RemLength = PB.Length - PB.RestartPos; PB.CurAddr = PB.StartAddr + (PB.RestartPos << 1); @@ -149,7 +149,7 @@ clear_buffer: PB.CurAddr += rem_samples << 1; } -void UpdateSampleCounters8(ZeldaVoicePB &PB) +static void UpdateSampleCounters8(ZeldaVoicePB &PB) { PB.RemLength = PB.Length - PB.RestartPos; PB.CurAddr = PB.StartAddr + PB.RestartPos; diff --git a/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp b/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp index 7ca3a73299..f89326a148 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp @@ -75,7 +75,7 @@ Symbol *DSPSymbolDB::GetSymbolFromAddr(u32 addr) return nullptr; } -void DisassembleRange(u16 start, u16 end) +static void DisassembleRange(u16 start, u16 end) { // TODO: ? } diff --git a/Source/Core/Core/HW/DVDInterface.cpp b/Source/Core/Core/HW/DVDInterface.cpp index 7507a632f7..120f7455de 100644 --- a/Source/Core/Core/HW/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVDInterface.cpp @@ -255,7 +255,7 @@ void DoState(PointerWrap &p) p.Do(g_last_read_time); } -void TransferComplete(u64 userdata, int cyclesLate) +static void TransferComplete(u64 userdata, int cyclesLate) { if (m_DICR.TSTART) FinishExecuteRead(); @@ -297,7 +297,7 @@ static u32 ProcessDTKSamples(short *tempPCM, u32 num_samples) return samples_processed; } -void DTKStreamingCallback(u64 userdata, int cyclesLate) +static void DTKStreamingCallback(u64 userdata, int cyclesLate) { // Send audio to the mixer. static const int NUM_SAMPLES = 48000 / 2000 * 7; // 3.5ms of 48kHz samples diff --git a/Source/Core/Core/HW/GCMemcardRaw.cpp b/Source/Core/Core/HW/GCMemcardRaw.cpp index 9302806853..5e99607ab8 100644 --- a/Source/Core/Core/HW/GCMemcardRaw.cpp +++ b/Source/Core/Core/HW/GCMemcardRaw.cpp @@ -7,7 +7,7 @@ #define SIZE_TO_Mb (1024 * 8 * 16) #define MC_HDR_SIZE 0xA000 -void innerFlush(FlushData *data) +static void innerFlush(FlushData *data) { File::IOFile pFile(data->filename, "r+b"); if (!pFile) diff --git a/Source/Core/Core/HW/GCPad.cpp b/Source/Core/Core/HW/GCPad.cpp index 605f48597e..0c4f6660c5 100644 --- a/Source/Core/Core/HW/GCPad.cpp +++ b/Source/Core/Core/HW/GCPad.cpp @@ -5,8 +5,8 @@ #include "Common/Common.h" #include "Core/ConfigManager.h" +#include "Core/HW/GCPad.h" #include "Core/HW/GCPadEmu.h" - #include "InputCommon/GCPadStatus.h" #include "InputCommon/InputConfig.h" #include "InputCommon/ControllerInterface/ControllerInterface.h" diff --git a/Source/Core/Core/HW/GPFifo.cpp b/Source/Core/Core/HW/GPFifo.cpp index 512fea8ab9..ddbb2dcb7a 100644 --- a/Source/Core/Core/HW/GPFifo.cpp +++ b/Source/Core/Core/HW/GPFifo.cpp @@ -155,7 +155,7 @@ void FastWrite64(const u64 _iValue) m_gatherPipeCount += 8; } -void FastWriteEnd() +static void FastWriteEnd() { CheckGatherPipe(); } diff --git a/Source/Core/Core/HW/Memmap.cpp b/Source/Core/Core/HW/Memmap.cpp index 34e1a6be07..ce8bfd1fc1 100644 --- a/Source/Core/Core/HW/Memmap.cpp +++ b/Source/Core/Core/HW/Memmap.cpp @@ -87,7 +87,7 @@ u8 *m_pVirtualFakeVMEM; // MMIO mapping object. MMIO::Mapping* mmio_mapping; -void InitMMIO(MMIO::Mapping* mmio) +static void InitMMIO(MMIO::Mapping* mmio) { g_video_backend->RegisterCPMMIO(mmio, 0xCC000000); PixelEngine::RegisterMMIO(mmio, 0xCC001000); @@ -101,7 +101,7 @@ void InitMMIO(MMIO::Mapping* mmio) AudioInterface::RegisterMMIO(mmio, 0xCC006C00); } -void InitMMIOWii(MMIO::Mapping* mmio) +static void InitMMIOWii(MMIO::Mapping* mmio) { InitMMIO(mmio); diff --git a/Source/Core/Core/HW/MemmapFunctions.cpp b/Source/Core/Core/HW/MemmapFunctions.cpp index faf254ebe7..828f576c67 100644 --- a/Source/Core/Core/HW/MemmapFunctions.cpp +++ b/Source/Core/Core/HW/MemmapFunctions.cpp @@ -630,7 +630,7 @@ typedef struct tlb_entry static tlb_entry tlb[NUM_TLBS][TLB_SIZE/TLB_WAYS][TLB_WAYS]; #endif -u32 LookupTLBPageAddress(const XCheckTLBFlag _Flag, const u32 vpa, u32 *paddr) +static u32 LookupTLBPageAddress(const XCheckTLBFlag _Flag, const u32 vpa, u32 *paddr) { #ifdef FAST_TLB_CACHE tlb_entry *tlbe = tlb[_Flag == FLAG_OPCODE][(vpa>>HW_PAGE_INDEX_SHIFT)&HW_PAGE_INDEX_MASK]; @@ -679,7 +679,7 @@ u32 LookupTLBPageAddress(const XCheckTLBFlag _Flag, const u32 vpa, u32 *paddr) #endif } -void UpdateTLBEntry(const XCheckTLBFlag _Flag, UPTE2 PTE2, const u32 vpa) +static void UpdateTLBEntry(const XCheckTLBFlag _Flag, UPTE2 PTE2, const u32 vpa) { #ifdef FAST_TLB_CACHE tlb_entry *tlbe = tlb[_Flag == FLAG_OPCODE][(vpa>>HW_PAGE_INDEX_SHIFT)&HW_PAGE_INDEX_MASK]; @@ -757,7 +757,7 @@ void InvalidateTLBEntry(u32 vpa) } // Page Address Translation -u32 TranslatePageAddress(const u32 _Address, const XCheckTLBFlag _Flag) +static u32 TranslatePageAddress(const u32 _Address, const XCheckTLBFlag _Flag) { // TLB cache u32 translatedAddress = 0; @@ -851,7 +851,7 @@ u32 TranslatePageAddress(const u32 _Address, const XCheckTLBFlag _Flag) #define BAT_EA_4(v) ((v)&0xf0000000) // Block Address Translation -u32 TranslateBlockAddress(const u32 addr, const XCheckTLBFlag _Flag) +static u32 TranslateBlockAddress(const u32 addr, const XCheckTLBFlag _Flag) { u32 result = 0; UReg_MSR& m_MSR = ((UReg_MSR&)PowerPC::ppcState.msr); diff --git a/Source/Core/Core/HW/ProcessorInterface.cpp b/Source/Core/Core/HW/ProcessorInterface.cpp index 52547fd745..13cdabffd4 100644 --- a/Source/Core/Core/HW/ProcessorInterface.cpp +++ b/Source/Core/Core/HW/ProcessorInterface.cpp @@ -211,7 +211,7 @@ void SetInterrupt(u32 _causemask, bool _bSet) UpdateException(); } -void SetResetButton(bool _bSet) +static void SetResetButton(bool _bSet) { if (_bSet) Common::AtomicAnd(m_InterruptCause, ~INT_CAUSE_RST_BUTTON); diff --git a/Source/Core/Core/HW/SI.cpp b/Source/Core/Core/HW/SI.cpp index 8cfa27d14a..b36d4028fd 100644 --- a/Source/Core/Core/HW/SI.cpp +++ b/Source/Core/Core/HW/SI.cpp @@ -458,7 +458,7 @@ void AddDevice(const SIDevices _device, int _iDeviceNumber) AddDevice(pDevice); } -void SetNoResponse(u32 channel) +static void SetNoResponse(u32 channel) { // raise the NO RESPONSE error switch (channel) diff --git a/Source/Core/Core/HW/SI_DeviceGBA.cpp b/Source/Core/Core/HW/SI_DeviceGBA.cpp index 93a73650bb..57058359bb 100644 --- a/Source/Core/Core/HW/SI_DeviceGBA.cpp +++ b/Source/Core/Core/HW/SI_DeviceGBA.cpp @@ -17,7 +17,7 @@ namespace { volatile bool server_running; } // --- GameBoy Advance "Link Cable" --- -void GBAConnectionWaiter() +static void GBAConnectionWaiter() { server_running = true; @@ -51,7 +51,7 @@ void GBAConnectionWaiter_Shutdown() connectionThread.join(); } -bool GetAvailableSock(sf::SocketTCP& sock_to_fill) +static bool GetAvailableSock(sf::SocketTCP& sock_to_fill) { bool sock_filled = false; diff --git a/Source/Core/Core/HW/StreamADPCM.cpp b/Source/Core/Core/HW/StreamADPCM.cpp index e0412670df..d8e5eda063 100644 --- a/Source/Core/Core/HW/StreamADPCM.cpp +++ b/Source/Core/Core/HW/StreamADPCM.cpp @@ -13,7 +13,7 @@ static s32 histl2; static s32 histr1; static s32 histr2; -s16 ADPDecodeSample(s32 bits, s32 q, s32& hist1, s32& hist2) +static s16 ADPDecodeSample(s32 bits, s32 q, s32& hist1, s32& hist2) { s32 hist = 0; switch (q >> 4) diff --git a/Source/Core/Core/HW/SystemTimers.cpp b/Source/Core/Core/HW/SystemTimers.cpp index 95b4684549..d8b6adab0c 100644 --- a/Source/Core/Core/HW/SystemTimers.cpp +++ b/Source/Core/Core/HW/SystemTimers.cpp @@ -139,13 +139,13 @@ u32 GetTicksPerSecond() return CPU_CORE_CLOCK; } -u32 ConvertMillisecondsToTicks(u32 _Milliseconds) +static u32 ConvertMillisecondsToTicks(u32 _Milliseconds) { return GetTicksPerSecond() / 1000 * _Milliseconds; } // DSP/CPU timeslicing. -void DSPCallback(u64 userdata, int cyclesLate) +static void DSPCallback(u64 userdata, int cyclesLate) { //splits up the cycle budget in case lle is used //for hle, just gives all of the slice to hle @@ -153,7 +153,7 @@ void DSPCallback(u64 userdata, int cyclesLate) CoreTiming::ScheduleEvent(DSP::GetDSPEmulator()->DSP_UpdateRate() - cyclesLate, et_DSP); } -void AudioDMACallback(u64 userdata, int cyclesLate) +static void AudioDMACallback(u64 userdata, int cyclesLate) { int fields = VideoInterface::GetNumFields(); int period = CPU_CORE_CLOCK / (AudioInterface::GetAIDSampleRate() * 4 / 32 * fields); @@ -161,7 +161,7 @@ void AudioDMACallback(u64 userdata, int cyclesLate) CoreTiming::ScheduleEvent(period - cyclesLate, et_AudioDMA); } -void IPC_HLE_UpdateCallback(u64 userdata, int cyclesLate) +static void IPC_HLE_UpdateCallback(u64 userdata, int cyclesLate) { if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) { @@ -170,25 +170,25 @@ void IPC_HLE_UpdateCallback(u64 userdata, int cyclesLate) } } -void VICallback(u64 userdata, int cyclesLate) +static void VICallback(u64 userdata, int cyclesLate) { VideoInterface::Update(); CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerLine() - cyclesLate, et_VI); } -void SICallback(u64 userdata, int cyclesLate) +static void SICallback(u64 userdata, int cyclesLate) { SerialInterface::UpdateDevices(); CoreTiming::ScheduleEvent(SerialInterface::GetTicksToNextSIPoll() - cyclesLate, et_SI); } -void CPCallback(u64 userdata, int cyclesLate) +static void CPCallback(u64 userdata, int cyclesLate) { CommandProcessor::Update(); CoreTiming::ScheduleEvent(CP_PERIOD - cyclesLate, et_CP); } -void DecrementerCallback(u64 userdata, int cyclesLate) +static void DecrementerCallback(u64 userdata, int cyclesLate) { PowerPC::ppcState.spr[SPR_DEC] = 0xFFFFFFFF; Common::AtomicOr(PowerPC::ppcState.Exceptions, EXCEPTION_DECREMENTER); @@ -224,7 +224,7 @@ u64 GetFakeTimeBase() return CoreTiming::GetFakeTBStartValue() + ((CoreTiming::GetTicks() - CoreTiming::GetFakeTBStartTicks()) / TIMER_RATIO); } -void PatchEngineCallback(u64 userdata, int cyclesLate) +static void PatchEngineCallback(u64 userdata, int cyclesLate) { // Patch mem and run the Action Replay PatchEngine::ApplyFramePatches(); @@ -232,7 +232,7 @@ void PatchEngineCallback(u64 userdata, int cyclesLate) CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame() - cyclesLate, et_PatchEngine); } -void ThrottleCallback(u64 last_time, int cyclesLate) +static void ThrottleCallback(u64 last_time, int cyclesLate) { u32 time = Common::Timer::GetTimeMs(); diff --git a/Source/Core/Core/HW/WiimoteEmu/Encryption.cpp b/Source/Core/Core/HW/WiimoteEmu/Encryption.cpp index 89454b48d1..f63aa0d578 100644 --- a/Source/Core/Core/HW/WiimoteEmu/Encryption.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/Encryption.cpp @@ -192,7 +192,7 @@ static inline u8 ror8(const u8 a, const u8 b) } -void genkey(const u8* const rand, const u8 idx, u8* const key) +static void genkey(const u8* const rand, const u8 idx, u8* const key) { const u8* const ans = ans_tbl[idx]; u8 t0[10]; @@ -209,7 +209,7 @@ void genkey(const u8* const rand, const u8 idx, u8* const key) } -void gentabs(const u8* const rand, const u8* const key, const u8 idx, u8* const ft, u8* const sb) +static void gentabs(const u8* const rand, const u8* const key, const u8 idx, u8* const ft, u8* const sb) { ft[0] = sboxes[idx][key[4]] ^ sboxes[(idx+1)%8][rand[3]]; ft[1] = sboxes[idx][key[2]] ^ sboxes[(idx+1)%8][rand[5]]; diff --git a/Source/Core/Core/HW/WiimoteEmu/UDPTLayer.h b/Source/Core/Core/HW/WiimoteEmu/UDPTLayer.h index 003cc90395..52ff2b7f79 100644 --- a/Source/Core/Core/HW/WiimoteEmu/UDPTLayer.h +++ b/Source/Core/Core/HW/WiimoteEmu/UDPTLayer.h @@ -11,7 +11,7 @@ namespace UDPTLayer { - void GetButtons(UDPWrapper * m , wm_core * butt) + static void GetButtons(UDPWrapper * m , wm_core * butt) { if (!(m->inst)) return; if (!(m->updButt)) return; @@ -29,7 +29,7 @@ namespace UDPTLayer *butt |= (mask & UDPWM_BR) ? WiimoteEmu::Wiimote::PAD_RIGHT : 0; } - void GetAcceleration(UDPWrapper * m , WiimoteEmu::AccelData * const data) + static void GetAcceleration(UDPWrapper * m , WiimoteEmu::AccelData * const data) { if (!(m->inst)) return; if (!(m->updAccel)) return; @@ -40,7 +40,7 @@ namespace UDPTLayer data->z = z; } - void GetIR( UDPWrapper * m, float * x, float * y, float * z) + static void GetIR( UDPWrapper * m, float * x, float * y, float * z) { if (!(m->inst)) return; if (!(m->updIR)) return; diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp index f2736e0105..74546e9548 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp @@ -254,7 +254,7 @@ bool Wiimote::Write() return false; } -bool IsDataReport(const Report& rpt) +static bool IsDataReport(const Report& rpt) { return rpt.size() >= 2 && rpt[1] >= WM_REPORT_CORE; } @@ -373,7 +373,7 @@ void Wiimote::EmuPause() NOTICE_LOG(WIIMOTE, "Pausing Wiimote data reporting."); } -unsigned int CalculateConnectedWiimotes() +static unsigned int CalculateConnectedWiimotes() { unsigned int connected_wiimotes = 0; for (unsigned int i = 0; i < MAX_WIIMOTES; ++i) @@ -383,7 +383,7 @@ unsigned int CalculateConnectedWiimotes() return connected_wiimotes; } -unsigned int CalculateWantedWiimotes() +static unsigned int CalculateWantedWiimotes() { // Figure out how many real Wiimotes are required unsigned int wanted_wiimotes = 0; @@ -394,7 +394,7 @@ unsigned int CalculateWantedWiimotes() return wanted_wiimotes; } -unsigned int CalculateWantedBB() +static unsigned int CalculateWantedBB() { unsigned int wanted_bb = 0; if (WIIMOTE_SRC_REAL & g_wiimote_sources[WIIMOTE_BALANCE_BOARD] && !g_wiimotes[WIIMOTE_BALANCE_BOARD]) @@ -431,7 +431,7 @@ void WiimoteScanner::StopScanning() } } -void CheckForDisconnectedWiimotes() +static void CheckForDisconnectedWiimotes() { std::lock_guard lk(g_refresh_lock); diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp index 0ca568bb1b..68a5689f34 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp @@ -308,13 +308,13 @@ s32 CWII_IPC_HLE_Device_net_kd_request::NWC24MakeUserID(u64* nwc24_id, u32 holly return WC24_OK; } -void SaveMacAddress(u8* mac) +static void SaveMacAddress(u8* mac) { SConfig::GetInstance().m_WirelessMac = MacAddressToString(mac); SConfig::GetInstance().SaveSettings(); } -void GetMacAddress(u8* mac) +static void GetMacAddress(u8* mac) { // Parse MAC address from config, and generate a new one if it doesn't // exist or can't be parsed. diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp index 928b7660c4..6f58591960 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp @@ -700,7 +700,7 @@ static u32 ParseCont(u8* pCont) } -int ParseAttribList(u8* pAttribIDList, u16& _startID, u16& _endID) +static int ParseAttribList(u8* pAttribIDList, u16& _startID, u16& _endID) { u32 attribOffset = 0; CBigEndianBuffer attribList(pAttribIDList); diff --git a/Source/Core/Core/IPC_HLE/WII_Socket.cpp b/Source/Core/Core/IPC_HLE/WII_Socket.cpp index 3dc34d3bf2..5418fb57b3 100644 --- a/Source/Core/Core/IPC_HLE/WII_Socket.cpp +++ b/Source/Core/Core/IPC_HLE/WII_Socket.cpp @@ -34,7 +34,7 @@ char* WiiSockMan::DecodeError(s32 ErrorCode) #endif } -s32 TranslateErrorCode(s32 native_error, bool isRW) +static s32 TranslateErrorCode(s32 native_error, bool isRW) { switch (native_error) { diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index ff3c921ca0..29eb3308ce 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -82,7 +82,7 @@ std::string g_InputDisplay[8]; ManipFunction mfunc = nullptr; -void EnsureTmpInputSize(size_t bound) +static void EnsureTmpInputSize(size_t bound) { if (tmpInputAllocated >= bound) return; @@ -525,7 +525,7 @@ static std::string Analog1DToString(u8 v, const std::string& prefix) } } -void SetInputDisplayString(ControllerState padState, int controllerID) +static void SetInputDisplayString(ControllerState padState, int controllerID) { g_InputDisplay[controllerID] = StringFromFormat("P%d:", controllerID + 1); @@ -558,7 +558,7 @@ void SetInputDisplayString(ControllerState padState, int controllerID) g_InputDisplay[controllerID].append("\n"); } -void SetWiiInputDisplayString(int remoteID, u8* const coreData, u8* const accelData, u8* const irData) +static void SetWiiInputDisplayString(int remoteID, u8* const coreData, u8* const accelData, u8* const irData) { int controllerID = remoteID + 4; diff --git a/Source/Core/Core/PatchEngine.cpp b/Source/Core/Core/PatchEngine.cpp index 652f58a044..8de5c5db51 100644 --- a/Source/Core/Core/PatchEngine.cpp +++ b/Source/Core/Core/PatchEngine.cpp @@ -174,7 +174,7 @@ void LoadPatches() LoadSpeedhacks("Speedhacks", merged); } -void ApplyPatches(const std::vector &patches) +static void ApplyPatches(const std::vector &patches) { for (const Patch& patch : patches) { diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp index 6b0c7db93c..e5247f12be 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp @@ -67,7 +67,7 @@ static void patches() int startTrace = 0; -void Trace(UGeckoInstruction& instCode) +static void Trace(UGeckoInstruction& instCode) { std::string regs = ""; for (int i = 0; i < 32; i++) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 389a6368f3..67c5e96921 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -170,10 +170,10 @@ void Jit64::ComputeRC(const Gen::OpArg & arg) } } -u32 Add(u32 a, u32 b) {return a + b;} -u32 Or (u32 a, u32 b) {return a | b;} -u32 And(u32 a, u32 b) {return a & b;} -u32 Xor(u32 a, u32 b) {return a ^ b;} +static u32 Add(u32 a, u32 b) {return a + b;} +static u32 Or (u32 a, u32 b) {return a | b;} +static u32 And(u32 a, u32 b) {return a & b;} +static u32 Xor(u32 a, u32 b) {return a ^ b;} void Jit64::regimmop(int d, int a, bool binary, u32 value, Operation doop, void (XEmitter::*op)(int, const Gen::OpArg&, const Gen::OpArg&), bool Rc, bool carry) { diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index 040f9fe25a..f8b403042c 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -192,7 +192,7 @@ bool AnalyzeFunction(u32 startAddr, Symbol &func, int max_size) // Second pass analysis, done after the first pass is done for all functions // so we have more information to work with -void AnalyzeFunction2(Symbol *func) +static void AnalyzeFunction2(Symbol *func) { u32 flags = func->flags; @@ -214,7 +214,7 @@ void AnalyzeFunction2(Symbol *func) } // IMPORTANT - CURRENTLY ASSUMES THAT A IS A COMPARE -bool CanSwapAdjacentOps(const CodeOp &a, const CodeOp &b) +static bool CanSwapAdjacentOps(const CodeOp &a, const CodeOp &b) { const GekkoOPInfo *b_info = b.opinfo; int b_flags = b_info->flags; @@ -273,7 +273,7 @@ bool CanSwapAdjacentOps(const CodeOp &a, const CodeOp &b) // called by another function. Therefore, let's scan the // entire space for bl operations and find what functions // get called. -void FindFunctionsFromBranches(u32 startAddr, u32 endAddr, SymbolDB *func_db) +static void FindFunctionsFromBranches(u32 startAddr, u32 endAddr, SymbolDB *func_db) { for (u32 addr = startAddr; addr < endAddr; addr+=4) { @@ -304,7 +304,7 @@ void FindFunctionsFromBranches(u32 startAddr, u32 endAddr, SymbolDB *func_db) } } -void FindFunctionsAfterBLR(PPCSymbolDB *func_db) +static void FindFunctionsAfterBLR(PPCSymbolDB *func_db) { vector funcAddrs; diff --git a/Source/Core/Core/PowerPC/PowerPC.cpp b/Source/Core/Core/PowerPC/PowerPC.cpp index db4e755de4..b80d2c57c1 100644 --- a/Source/Core/Core/PowerPC/PowerPC.cpp +++ b/Source/Core/Core/PowerPC/PowerPC.cpp @@ -74,7 +74,7 @@ void DoState(PointerWrap &p) JitInterface::DoState(p); } -void ResetRegisters() +static void ResetRegisters() { memset(ppcState.ps, 0, sizeof(ppcState.ps)); memset(ppcState.gpr, 0, sizeof(ppcState.gpr)); diff --git a/Source/Core/Core/PowerPC/Profiler.cpp b/Source/Core/Core/PowerPC/Profiler.cpp index 3ab1fde237..1102c94346 100644 --- a/Source/Core/Core/PowerPC/Profiler.cpp +++ b/Source/Core/Core/PowerPC/Profiler.cpp @@ -4,6 +4,7 @@ #include #include "Core/PowerPC/JitInterface.h" +#include "Core/PowerPC/Profiler.h" namespace Profiler { diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index a4619ad752..08fad24001 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -79,7 +79,7 @@ void EnableCompression(bool compression) g_use_compression = compression; } -void DoState(PointerWrap &p) +static void DoState(PointerWrap &p) { u32 version = STATE_VERSION; { @@ -159,7 +159,7 @@ void VerifyBuffer(std::vector& buffer) } // return state number not in map -int GetEmptySlot(std::map m) +static int GetEmptySlot(std::map m) { for (int i = 1; i <= (int)NUM_STATES; i++) { @@ -180,7 +180,7 @@ int GetEmptySlot(std::map m) static std::string MakeStateFilename(int number); // read state timestamps -std::map GetSavedStates() +static std::map GetSavedStates() { StateHeader header; std::map m; @@ -209,7 +209,7 @@ struct CompressAndDumpState_args bool wait; }; -void CompressAndDumpState(CompressAndDumpState_args save_args) +static void CompressAndDumpState(CompressAndDumpState_args save_args) { std::lock_guard lk(*save_args.buffer_mutex); if (!save_args.wait) @@ -356,7 +356,7 @@ bool ReadHeader(const std::string& filename, StateHeader& header) return true; } -void LoadFileStateData(const std::string& filename, std::vector& ret_data) +static void LoadFileStateData(const std::string& filename, std::vector& ret_data) { Flush(); File::IOFile f(filename, "rb"); diff --git a/Source/Core/Core/Tracer.cpp b/Source/Core/Core/Tracer.cpp index 787b66f58d..0a6e1068b1 100644 --- a/Source/Core/Core/Tracer.cpp +++ b/Source/Core/Core/Tracer.cpp @@ -7,6 +7,7 @@ #include "Common/Common.h" #include "Common/FileUtil.h" +#include "Core/Core.h" #include "Core/Host.h" #include "Core/Tracer.h" #include "Core/PowerPC/PowerPC.h" diff --git a/Source/Core/Core/ec_wii.cpp b/Source/Core/Core/ec_wii.cpp index 62013b0a2f..c1204c9905 100644 --- a/Source/Core/Core/ec_wii.cpp +++ b/Source/Core/Core/ec_wii.cpp @@ -123,7 +123,7 @@ void make_blanksig_ec_cert(u8 *cert_out, const char *signer, const char *name, c // remote_public_key is a pointer to the remote party's public key (0x3c bytes) // NG_priv is the device-unique private key to use // if NG_priv is nullptr, default builtin will be used -void get_shared_secret(u8* shared_secret_out, u8* remote_public_key, u8* NG_priv) +static void get_shared_secret(u8* shared_secret_out, u8* remote_public_key, u8* NG_priv) { if (NG_priv==nullptr) { diff --git a/Source/Core/Core/x64MemTools.cpp b/Source/Core/Core/x64MemTools.cpp index af0530dee7..e132b15cf0 100644 --- a/Source/Core/Core/x64MemTools.cpp +++ b/Source/Core/Core/x64MemTools.cpp @@ -25,7 +25,7 @@ namespace EMM #if (defined __APPLE__ || defined __linux__ || defined __FreeBSD__) && !defined(ANDROID) #include -void print_trace(const char * msg) +static void print_trace(const char * msg) { void *array[100]; size_t size; @@ -41,7 +41,7 @@ void print_trace(const char * msg) } #endif -bool DoFault(u64 bad_address, SContext *ctx) +static bool DoFault(u64 bad_address, SContext *ctx) { if (!JitInterface::IsInCodeSpace((u8*) ctx->CTX_PC)) { @@ -269,7 +269,7 @@ void InstallExceptionHandler() #elif !defined(ANDROID) -void sigsegv_handler(int sig, siginfo_t *info, void *raw_context) +static void sigsegv_handler(int sig, siginfo_t *info, void *raw_context) { #ifndef _M_GENERIC if (sig != SIGSEGV) diff --git a/Source/Core/DiscIO/FileMonitor.cpp b/Source/Core/DiscIO/FileMonitor.cpp index 04ea595a41..dba7c9ff74 100644 --- a/Source/Core/DiscIO/FileMonitor.cpp +++ b/Source/Core/DiscIO/FileMonitor.cpp @@ -17,6 +17,7 @@ #include "Core/Core.h" #include "Core/Boot/Boot.h" +#include "DiscIO/FileMonitor.h" #include "DiscIO/Filesystem.h" #include "DiscIO/Volume.h" #include "DiscIO/VolumeCreator.h" diff --git a/Source/Core/DiscIO/VolumeCreator.cpp b/Source/Core/DiscIO/VolumeCreator.cpp index 71b41e19e7..0180326aab 100644 --- a/Source/Core/DiscIO/VolumeCreator.cpp +++ b/Source/Core/DiscIO/VolumeCreator.cpp @@ -14,6 +14,7 @@ #include "DiscIO/Blob.h" #include "DiscIO/Volume.h" +#include "DiscIO/VolumeCreator.h" #include "DiscIO/VolumeDirectory.h" #include "DiscIO/VolumeGC.h" #include "DiscIO/VolumeWad.h" diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 56b729e999..857f681e20 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -23,6 +23,7 @@ #include "Common/Common.h" #include "Common/StringUtil.h" #include "Common/SymbolDB.h" +#include "Core/Host.h" #include "Core/DSP/DSPCore.h" #include "Core/HW/DSPLLE/DSPDebugInterface.h" #include "Core/HW/DSPLLE/DSPSymbols.h" diff --git a/Source/Core/DolphinWX/Debugger/MemoryWindow.cpp b/Source/Core/DolphinWX/Debugger/MemoryWindow.cpp index aa26ecc926..8621cb6f5b 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/MemoryWindow.cpp @@ -241,7 +241,7 @@ void CMemoryWindow::OnHostMessage(wxCommandEvent& event) } } -void DumpArray(const std::string& filename, const u8* data, size_t length) +static void DumpArray(const std::string& filename, const u8* data, size_t length) { if (data) { diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 5ef06153c8..b258c2f2af 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -829,7 +829,7 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event)) } } -bool IsHotkey(wxKeyEvent &event, int Id) +static bool IsHotkey(wxKeyEvent &event, int Id) { return (event.GetKeyCode() != WXK_NONE && event.GetKeyCode() == SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkey[Id] && diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index a5a1aebfca..e9e7764cb2 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -183,7 +183,7 @@ static int CompareGameListItems(const GameListItem* iso1, const GameListItem* is return 0; } -bool operator < (const GameListItem &one, const GameListItem &other) +static bool operator < (const GameListItem &one, const GameListItem &other) { return CompareGameListItems(&one, &other) < 0; } @@ -394,7 +394,7 @@ void CGameListCtrl::Update() SetFocus(); } -wxString NiceSizeFormat(u64 _size) +static wxString NiceSizeFormat(u64 _size) { // Return a pretty filesize string from byte count. // e.g. 1134278 -> "1.08 MiB" @@ -472,7 +472,7 @@ void CGameListCtrl::InsertItemInReportView(long _Index) SetItemData(_Index, ItemIndex); } -wxColour blend50(const wxColour& c1, const wxColour& c2) +static wxColour blend50(const wxColour& c1, const wxColour& c2) { unsigned char r,g,b,a; r = c1.Red()/2 + c2.Red()/2; @@ -658,7 +658,7 @@ const GameListItem *CGameListCtrl::GetISO(size_t index) const } CGameListCtrl *caller; -int wxCALLBACK wxListCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData) +static int wxCALLBACK wxListCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData) { // return 1 if item1 > item2 // return -1 if item1 < item2 diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index 0559e9b7bf..5ebb055ccc 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -39,6 +39,7 @@ #include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/CoreParameter.h" +#include "Core/Host.h" #include "Core/Movie.h" #include "Core/HW/Wiimote.h" diff --git a/Source/Core/DolphinWX/MemcardManager.cpp b/Source/Core/DolphinWX/MemcardManager.cpp index f0a9a5fc26..af423b6485 100644 --- a/Source/Core/DolphinWX/MemcardManager.cpp +++ b/Source/Core/DolphinWX/MemcardManager.cpp @@ -54,7 +54,7 @@ const u8 hdr[] = { 0x00,0x00,0x00,0x00 }; -wxBitmap wxBitmapFromMemoryRGBA(const unsigned char* data, u32 width, u32 height) +static wxBitmap wxBitmapFromMemoryRGBA(const unsigned char* data, u32 width, u32 height) { u32 stride = (4*width); diff --git a/Source/Core/DolphinWX/NetWindow.cpp b/Source/Core/DolphinWX/NetWindow.cpp index 4860d0b501..495f6c00e7 100644 --- a/Source/Core/DolphinWX/NetWindow.cpp +++ b/Source/Core/DolphinWX/NetWindow.cpp @@ -59,7 +59,7 @@ static NetPlayClient* netplay_client = nullptr; extern CFrame* main_frame; NetPlayDiag *NetPlayDiag::npd = nullptr; -std::string BuildGameName(const GameListItem& game) +static std::string BuildGameName(const GameListItem& game) { // Lang needs to be consistent auto const lang = 0; @@ -74,7 +74,7 @@ std::string BuildGameName(const GameListItem& game) return name + " (" + game.GetUniqueID() + ")"; } -void FillWithGameNames(wxListBox* game_lbox, const CGameListCtrl& game_list) +static void FillWithGameNames(wxListBox* game_lbox, const CGameListCtrl& game_list) { for (u32 i = 0 ; auto game = game_list.GetISO(i); ++i) game_lbox->Append(StrToWxStr(BuildGameName(*game))); diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp index 8a95239295..2490a5c286 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp @@ -150,7 +150,7 @@ wxString shader_errors_desc = wxTRANSLATE("Usually if shader compilation fails, // Search for available resolutions - TODO: Move to Common? -wxArrayString GetListOfResolutions() +static wxArrayString GetListOfResolutions() { wxArrayString retlist; retlist.Add("Auto"); diff --git a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp index c41e82b699..2261a5df98 100644 --- a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp @@ -535,7 +535,7 @@ Expression::~Expression() delete node; } -ExpressionParseStatus ParseExpressionInner(std::string str, ControlFinder &finder, Expression **expr_out) +static ExpressionParseStatus ParseExpressionInner(std::string str, ControlFinder &finder, Expression **expr_out) { ExpressionParseStatus status; Expression *expr; diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index 4b738d4dbf..c43cd255e8 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -18,7 +18,7 @@ namespace ciface namespace SDL { -std::string GetJoystickName(int index) +static std::string GetJoystickName(int index) { #if SDL_VERSION_ATLEAST(2, 0, 0) return SDL_JoystickNameForIndex(index); diff --git a/Source/Core/InputCommon/UDPWrapper.cpp b/Source/Core/InputCommon/UDPWrapper.cpp index eeba3bbafd..5d34cd7624 100644 --- a/Source/Core/InputCommon/UDPWrapper.cpp +++ b/Source/Core/InputCommon/UDPWrapper.cpp @@ -8,7 +8,7 @@ #include "InputCommon/UDPWrapper.h" -const std::string DefaultPort(const int index) +static const std::string DefaultPort(const int index) { static std::string s; s = "443"; diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp index d7ba6292c9..5a62de6e65 100644 --- a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp +++ b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp @@ -1583,7 +1583,7 @@ namespace GLExtensions bool InitFunctionPointers(); // Initializes the extension list the old way - void InitExtensionList21() + static void InitExtensionList21() { const char* extensions = (const char*)glGetString(GL_EXTENSIONS); std::string tmp(extensions); @@ -1593,7 +1593,7 @@ namespace GLExtensions m_extension_list[tmp] = true; } - void InitExtensionList() + static void InitExtensionList() { m_extension_list.clear(); if (_isES3) @@ -1730,7 +1730,7 @@ namespace GLExtensions for (GLint i = 0; i < NumExtension; ++i) m_extension_list[std::string((const char*)glGetStringi(GL_EXTENSIONS, i))] = true; } - void InitVersion() + static void InitVersion() { GLint major, minor; glGetIntegerv(GL_MAJOR_VERSION, &major); @@ -1743,7 +1743,7 @@ namespace GLExtensions _GLVersion = 330; // Get all the fun things } - void* GetFuncAddress(std::string name, void **func) + static void* GetFuncAddress(std::string name, void **func) { *func = GLInterface->GetFuncAddress(name); if (*func == nullptr) @@ -1792,7 +1792,7 @@ namespace GLExtensions } // Private initialization functions - bool HasFeatures(const std::string& extensions) + static bool HasFeatures(const std::string& extensions) { bool result = true; std::string tmp; diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp index c4c8f7c888..cafa560485 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp @@ -39,7 +39,7 @@ UidChecker ProgramShaderCache::vertex_uid_chec static char s_glsl_header[1024] = ""; -std::string GetGLSLVersionString() +static std::string GetGLSLVersionString() { GLSL_VERSION v = g_ogl_config.eSupportedGLSLVersion; switch(v) diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index f2567c0c8b..5cdc8d031f 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -112,7 +112,7 @@ static bool s_efbCacheValid[2][EFB_CACHE_WIDTH * EFB_CACHE_HEIGHT]; static bool s_efbCacheIsCleared = false; static std::vector s_efbCache[2][EFB_CACHE_WIDTH * EFB_CACHE_HEIGHT]; // 2 for PEEK_Z and PEEK_COLOR -int GetNumMSAASamples(int MSAAMode) +static int GetNumMSAASamples(int MSAAMode) { int samples; switch (MSAAMode) @@ -145,7 +145,7 @@ int GetNumMSAASamples(int MSAAMode) return g_ogl_config.max_samples; } -void ApplySSAASettings() { +static void ApplySSAASettings() { // GLES3 doesn't support SSAA if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL) { @@ -163,7 +163,7 @@ void ApplySSAASettings() { } } -void GLAPIENTRY ErrorCallback( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* message, const void* userParam) +static void GLAPIENTRY ErrorCallback( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* message, const void* userParam) { const char *s_source; const char *s_type; @@ -198,16 +198,16 @@ void GLAPIENTRY ErrorCallback( GLenum source, GLenum type, GLuint id, GLenum sev } // Two small Fallbacks to avoid GL_ARB_ES2_compatibility -void GLAPIENTRY DepthRangef(GLfloat neardepth, GLfloat fardepth) +static void GLAPIENTRY DepthRangef(GLfloat neardepth, GLfloat fardepth) { glDepthRange(neardepth, fardepth); } -void GLAPIENTRY ClearDepthf(GLfloat depthval) +static void GLAPIENTRY ClearDepthf(GLfloat depthval) { glClearDepth(depthval); } -void InitDriverInfo() +static void InitDriverInfo() { std::string svendor = std::string(g_ogl_config.gl_vendor); std::string srenderer = std::string(g_ogl_config.gl_renderer); @@ -1299,7 +1299,7 @@ void Renderer::SetBlendMode(bool forceUpdate) s_blendMode = newval; } -void DumpFrame(const std::vector& data, int w, int h) +static void DumpFrame(const std::vector& data, int w, int h) { #if defined(HAVE_LIBAV) || defined(_WIN32) if (g_ActiveConfig.bDumpFrames && !data.empty()) diff --git a/Source/Core/VideoBackends/OGL/main.cpp b/Source/Core/VideoBackends/OGL/main.cpp index c4db8d94e9..fb4079a9c8 100644 --- a/Source/Core/VideoBackends/OGL/main.cpp +++ b/Source/Core/VideoBackends/OGL/main.cpp @@ -103,7 +103,7 @@ std::string VideoBackend::GetDisplayName() const return "OpenGL"; } -void GetShaders(std::vector &shaders) +static void GetShaders(std::vector &shaders) { std::set already_found; @@ -138,7 +138,7 @@ void GetShaders(std::vector &shaders) std::sort(shaders.begin(), shaders.end()); } -void InitBackendInfo() +static void InitBackendInfo() { g_Config.backend_info.APIType = API_OPENGL; g_Config.backend_info.bUseRGBATextures = true; diff --git a/Source/Core/VideoBackends/Software/Clipper.cpp b/Source/Core/VideoBackends/Software/Clipper.cpp index 9cd41958c7..4bdbe85230 100644 --- a/Source/Core/VideoBackends/Software/Clipper.cpp +++ b/Source/Core/VideoBackends/Software/Clipper.cpp @@ -169,7 +169,7 @@ namespace Clipper } \ } - void ClipTriangle(int *indices, int &numIndices) + static void ClipTriangle(int *indices, int &numIndices) { int mask = 0; @@ -218,7 +218,7 @@ namespace Clipper } } - void ClipLine(int *indices) + static void ClipLine(int *indices) { int mask = 0; int clip_mask[2] = { 0, 0 }; @@ -310,7 +310,7 @@ namespace Clipper } } - void CopyVertex(OutputVertexData *dst, OutputVertexData *src, float dx, float dy, unsigned int sOffset) + static void CopyVertex(OutputVertexData *dst, OutputVertexData *src, float dx, float dy, unsigned int sOffset) { dst->screenPosition.x = src->screenPosition.x + dx; dst->screenPosition.y = src->screenPosition.y + dy; diff --git a/Source/Core/VideoBackends/Software/DebugUtil.cpp b/Source/Core/VideoBackends/Software/DebugUtil.cpp index 8157567268..bd59779e86 100644 --- a/Source/Core/VideoBackends/Software/DebugUtil.cpp +++ b/Source/Core/VideoBackends/Software/DebugUtil.cpp @@ -51,7 +51,7 @@ void Shutdown() } } -void SaveTexture(const std::string& filename, u32 texmap, s32 mip) +static void SaveTexture(const std::string& filename, u32 texmap, s32 mip) { FourTexUnits& texUnit = bpmem.tex[(texmap >> 2) & 1]; u8 subTexmap = texmap & 3; @@ -82,7 +82,7 @@ void GetTextureRGBA(u8 *dst, u32 texmap, s32 mip, u32 width, u32 height) } } -s32 GetMaxTextureLod(u32 texmap) +static s32 GetMaxTextureLod(u32 texmap) { FourTexUnits& texUnit = bpmem.tex[(texmap >> 2) & 1]; u8 subTexmap = texmap & 3; @@ -130,7 +130,7 @@ void DumpActiveTextures() } } -void DumpEfb(const std::string& filename) +static void DumpEfb(const std::string& filename) { u8 *data = new u8[EFB_WIDTH * EFB_HEIGHT * 4]; u8 *writePtr = data; @@ -153,7 +153,7 @@ void DumpEfb(const std::string& filename) delete[] data; } -void DumpDepth(const std::string& filename) +static void DumpDepth(const std::string& filename) { u8 *data = new u8[EFB_WIDTH * EFB_HEIGHT * 4]; u8 *writePtr = data; diff --git a/Source/Core/VideoBackends/Software/EfbCopy.cpp b/Source/Core/VideoBackends/Software/EfbCopy.cpp index 6018e2b3ce..9629670a3f 100644 --- a/Source/Core/VideoBackends/Software/EfbCopy.cpp +++ b/Source/Core/VideoBackends/Software/EfbCopy.cpp @@ -25,7 +25,7 @@ static const float s_gammaLUT[] = namespace EfbCopy { - void CopyToXfb(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma) + static void CopyToXfb(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma) { GLInterface->Update(); // update the render window position and the backbuffer size @@ -61,7 +61,7 @@ namespace EfbCopy } } - void CopyToRam() + static void CopyToRam() { if (!g_SWVideoConfig.bHwRasterizer) { @@ -71,7 +71,7 @@ namespace EfbCopy } } - void ClearEfb() + static void ClearEfb() { u32 clearColor = (bpmem.clearcolorAR & 0xff) << 24 | bpmem.clearcolorGB << 8 | (bpmem.clearcolorAR & 0xff00) >> 8; diff --git a/Source/Core/VideoBackends/Software/EfbInterface.cpp b/Source/Core/VideoBackends/Software/EfbInterface.cpp index 8187345d89..fd985f8662 100644 --- a/Source/Core/VideoBackends/Software/EfbInterface.cpp +++ b/Source/Core/VideoBackends/Software/EfbInterface.cpp @@ -35,7 +35,7 @@ namespace EfbInterface p.DoArray(efb, EFB_WIDTH*EFB_HEIGHT*6); } - void SetPixelAlphaOnly(u32 offset, u8 a) + static void SetPixelAlphaOnly(u32 offset, u8 a) { switch (bpmem.zcontrol.pixel_format) { @@ -58,7 +58,7 @@ namespace EfbInterface } } - void SetPixelColorOnly(u32 offset, u8 *rgb) + static void SetPixelColorOnly(u32 offset, u8 *rgb) { switch (bpmem.zcontrol.pixel_format) { @@ -98,7 +98,7 @@ namespace EfbInterface } } - void SetPixelAlphaColor(u32 offset, u8 *color) + static void SetPixelAlphaColor(u32 offset, u8 *color) { switch (bpmem.zcontrol.pixel_format) { @@ -139,7 +139,7 @@ namespace EfbInterface } } - void GetPixelColor(u32 offset, u8 *color) + static void GetPixelColor(u32 offset, u8 *color) { switch (bpmem.zcontrol.pixel_format) { @@ -175,7 +175,7 @@ namespace EfbInterface } } - void SetPixelDepth(u32 offset, u32 depth) + static void SetPixelDepth(u32 offset, u32 depth) { switch (bpmem.zcontrol.pixel_format) { @@ -203,7 +203,7 @@ namespace EfbInterface } } - u32 GetPixelDepth(u32 offset) + static u32 GetPixelDepth(u32 offset) { u32 depth = 0; @@ -229,7 +229,7 @@ namespace EfbInterface return depth; } - u32 GetSourceFactor(u8 *srcClr, u8 *dstClr, BlendMode::BlendFactor mode) + static u32 GetSourceFactor(u8 *srcClr, u8 *dstClr, BlendMode::BlendFactor mode) { switch (mode) { @@ -270,7 +270,7 @@ namespace EfbInterface return 0; } - u32 GetDestinationFactor(u8 *srcClr, u8 *dstClr, BlendMode::BlendFactor mode) + static u32 GetDestinationFactor(u8 *srcClr, u8 *dstClr, BlendMode::BlendFactor mode) { switch (mode) { @@ -311,7 +311,7 @@ namespace EfbInterface return 0; } - void BlendColor(u8 *srcClr, u8 *dstClr) + static void BlendColor(u8 *srcClr, u8 *dstClr) { u32 srcFactor = GetSourceFactor(srcClr, dstClr, bpmem.blendmode.srcfactor); u32 dstFactor = GetDestinationFactor(srcClr, dstClr, bpmem.blendmode.dstfactor); @@ -333,7 +333,7 @@ namespace EfbInterface } } - void LogicBlend(u32 srcClr, u32 &dstClr, BlendMode::LogicOp op) + static void LogicBlend(u32 srcClr, u32 &dstClr, BlendMode::LogicOp op) { switch (op) { @@ -388,7 +388,7 @@ namespace EfbInterface } } - void SubtractBlend(u8 *srcClr, u8 *dstClr) + static void SubtractBlend(u8 *srcClr, u8 *dstClr) { for (int i = 0; i < 4; i++) { diff --git a/Source/Core/VideoBackends/Software/HwRasterizer.cpp b/Source/Core/VideoBackends/Software/HwRasterizer.cpp index 1a85b34263..9515e8d8af 100644 --- a/Source/Core/VideoBackends/Software/HwRasterizer.cpp +++ b/Source/Core/VideoBackends/Software/HwRasterizer.cpp @@ -35,7 +35,7 @@ namespace HwRasterizer // Clear shader static GLint clear_apos = -1, clear_ucol = -1; - void CreateShaders() + static void CreateShaders() { // Color Vertices static const char *fragcolText = @@ -155,7 +155,7 @@ namespace HwRasterizer GL_REPORT_ERRORD(); } static float width, height; - void LoadTexture() + static void LoadTexture() { FourTexUnits &texUnit = bpmem.tex[0]; u32 imageAddr = texUnit.texImage3[0].image_base; @@ -199,7 +199,7 @@ namespace HwRasterizer glDisable(GL_BLEND); } - void DrawColorVertex(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2) + static void DrawColorVertex(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2) { float x0 = (v0->screenPosition.x / efbHalfWidth) - 1.0f; float y0 = 1.0f - (v0->screenPosition.y / efbHalfHeight); @@ -249,7 +249,7 @@ namespace HwRasterizer GL_REPORT_ERRORD(); } - void DrawTextureVertex(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2) + static void DrawTextureVertex(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2) { float x0 = (v0->screenPosition.x / efbHalfWidth) - 1.0f; float y0 = 1.0f - (v0->screenPosition.y / efbHalfHeight); diff --git a/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp b/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp index 52bd632e15..524a960d3e 100644 --- a/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp +++ b/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp @@ -43,7 +43,7 @@ void DoState(PointerWrap &p) ResetDecoding(); } -void DecodePrimitiveStream(u32 iBufferSize) +static void DecodePrimitiveStream(u32 iBufferSize) { u32 vertexSize = vertexLoader.GetVertexSize(); @@ -77,7 +77,7 @@ void DecodePrimitiveStream(u32 iBufferSize) } } -void ReadXFData(u32 iBufferSize) +static void ReadXFData(u32 iBufferSize) { _assert_msg_(VIDEO, iBufferSize >= (u32)(streamSize * 4), "Underflow during standard opcode decoding"); @@ -90,7 +90,7 @@ void ReadXFData(u32 iBufferSize) ResetDecoding(); } -void ExecuteDisplayList(u32 addr, u32 count) +static void ExecuteDisplayList(u32 addr, u32 count) { u8 *videoDataSave = g_pVideoData; @@ -114,7 +114,7 @@ void ExecuteDisplayList(u32 addr, u32 count) g_pVideoData = videoDataSave; } -void DecodeStandard(u32 bufferSize) +static void DecodeStandard(u32 bufferSize) { _assert_msg_(VIDEO, CommandRunnable(bufferSize), "Underflow during standard opcode decoding"); diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp index 915757f766..90fe84ffee 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.cpp +++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp @@ -183,7 +183,7 @@ inline void Draw(s32 x, s32 y, s32 xi, s32 yi) tev.Draw(); } -void InitTriangle(float X1, float Y1, s32 xi, s32 yi) +static void InitTriangle(float X1, float Y1, s32 xi, s32 yi) { vertex0X = xi; vertex0Y = yi; @@ -195,7 +195,7 @@ void InitTriangle(float X1, float Y1, s32 xi, s32 yi) vertexOffsetY = ((float)yi - Y1) + adjust; } -void InitSlope(Slope *slope, float f1, float f2, float f3, float DX31, float DX12, float DY12, float DY31) +static void InitSlope(Slope *slope, float f1, float f2, float f3, float DX31, float DX12, float DY12, float DY31) { float DF31 = f3 - f1; float DF21 = f2 - f1; @@ -253,7 +253,7 @@ inline void CalculateLOD(s32 &lod, bool &linear, u32 texmap, u32 texcoord) lod = CLAMP(lod, (s32)tm1.min_lod, (s32)tm1.max_lod); } -void BuildBlock(s32 blockX, s32 blockY) +static void BuildBlock(s32 blockX, s32 blockY) { for (s32 yi = 0; yi < BLOCK_SIZE; yi++) { diff --git a/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp b/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp index d310a5584d..ed8115f1ab 100644 --- a/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp +++ b/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp @@ -66,7 +66,7 @@ inline u16 ReadLow (u32 _reg) {return (u16)(_reg & 0xFFFF);} inline u16 ReadHigh (u32 _reg) {return (u16)(_reg >> 16);} -void UpdateInterrupts_Wrapper(u64 userdata, int cyclesLate) +static void UpdateInterrupts_Wrapper(u64 userdata, int cyclesLate) { UpdateInterrupts(userdata); } @@ -219,7 +219,7 @@ void UpdateInterruptsFromVideoBackend(u64 userdata) CoreTiming::ScheduleEvent_Threadsafe(0, et_UpdateInterrupts, userdata); } -void ReadFifo() +static void ReadFifo() { bool canRead = cpreg.readptr != cpreg.writeptr && writePos < (int)maxCommandBufferWrite; bool atBreakpoint = AtBreakpoint(); @@ -256,7 +256,7 @@ void ReadFifo() } } -void SetStatus() +static void SetStatus() { // overflow check if (cpreg.rwdistance > cpreg.hiwatermark) diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index ef6c491449..5bd44782a7 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -52,7 +52,7 @@ void SWRenderer::Shutdown() } } -void CreateShaders() +static void CreateShaders() { static const char *fragShaderText = "#ifdef GL_ES\n" diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index 6fe4cf4dcb..8abfa81c65 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -62,7 +62,7 @@ std::string VideoSoftware::GetName() const return _trans("Software Renderer"); } -void *DllDebugger(void *_hParent, bool Show) +static void *DllDebugger(void *_hParent, bool Show) { return nullptr; } diff --git a/Source/Core/VideoBackends/Software/TextureEncoder.cpp b/Source/Core/VideoBackends/Software/TextureEncoder.cpp index 5913125a08..8351d39a29 100644 --- a/Source/Core/VideoBackends/Software/TextureEncoder.cpp +++ b/Source/Core/VideoBackends/Software/TextureEncoder.cpp @@ -196,7 +196,7 @@ inline void boxfilterRGB_to_xx8(u8 *src, u8 &x1, u8 &x2, int comp1, int comp2) x2 = x16_2 >> 2; } -void SetBlockDimensions(int blkWidthLog2, int blkHeightLog2, u16 &sBlkCount, u16 &tBlkCount, u16 &sBlkSize, u16 &tBlkSize) +static void SetBlockDimensions(int blkWidthLog2, int blkHeightLog2, u16 &sBlkCount, u16 &tBlkCount, u16 &sBlkSize, u16 &tBlkSize) { // if half_scale is 1 then the size is cut in half u32 width = bpmem.copyTexSrcWH.x >> bpmem.triggerEFBCopy.half_scale; @@ -209,7 +209,7 @@ void SetBlockDimensions(int blkWidthLog2, int blkHeightLog2, u16 &sBlkCount, u16 tBlkSize = 1 << blkHeightLog2; } -void SetSpans(int sBlkSize, int tBlkSize, s32 &tSpan, s32 &sBlkSpan, s32 &tBlkSpan, s32 &writeStride) +static void SetSpans(int sBlkSize, int tBlkSize, s32 &tSpan, s32 &sBlkSpan, s32 &tBlkSpan, s32 &writeStride) { // width is 1 less than the number of pixels of width u32 width = bpmem.copyTexSrcWH.x >> bpmem.triggerEFBCopy.half_scale; @@ -253,7 +253,7 @@ void SetSpans(int sBlkSize, int tBlkSize, s32 &tSpan, s32 &sBlkSpan, s32 &tBlkSp dstBlockStart += writeStride; \ } \ -void EncodeRGBA6(u8 *dst, u8 *src, u32 format) +static void EncodeRGBA6(u8 *dst, u8 *src, u32 format) { u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize; s32 tSpan, sBlkSpan, tBlkSpan, writeStride; @@ -490,7 +490,7 @@ void EncodeRGBA6(u8 *dst, u8 *src, u32 format) } -void EncodeRGBA6halfscale(u8 *dst, u8 *src, u32 format) +static void EncodeRGBA6halfscale(u8 *dst, u8 *src, u32 format) { u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize; s32 tSpan, sBlkSpan, tBlkSpan, writeStride; @@ -725,7 +725,7 @@ void EncodeRGBA6halfscale(u8 *dst, u8 *src, u32 format) } } -void EncodeRGB8(u8 *dst, u8 *src, u32 format) +static void EncodeRGB8(u8 *dst, u8 *src, u32 format) { u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize; s32 tSpan, sBlkSpan, tBlkSpan, writeStride; @@ -939,7 +939,7 @@ void EncodeRGB8(u8 *dst, u8 *src, u32 format) } } -void EncodeRGB8halfscale(u8 *dst, u8 *src, u32 format) +static void EncodeRGB8halfscale(u8 *dst, u8 *src, u32 format) { u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize; s32 tSpan, sBlkSpan, tBlkSpan, writeStride; @@ -1170,7 +1170,7 @@ void EncodeRGB8halfscale(u8 *dst, u8 *src, u32 format) } } -void EncodeZ24(u8 *dst, u8 *src, u32 format) +static void EncodeZ24(u8 *dst, u8 *src, u32 format) { u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize; s32 tSpan, sBlkSpan, tBlkSpan, writeStride; @@ -1274,7 +1274,7 @@ void EncodeZ24(u8 *dst, u8 *src, u32 format) } } -void EncodeZ24halfscale(u8 *dst, u8 *src, u32 format) +static void EncodeZ24halfscale(u8 *dst, u8 *src, u32 format) { u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize; s32 tSpan, sBlkSpan, tBlkSpan, writeStride; diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp index f79c57be00..e0907d7543 100644 --- a/Source/Core/VideoBackends/Software/TransformUnit.cpp +++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp @@ -19,42 +19,42 @@ namespace TransformUnit { -void MultiplyVec2Mat24(const Vec3 &vec, const float *mat, Vec3 &result) +static void MultiplyVec2Mat24(const Vec3 &vec, const float *mat, Vec3 &result) { result.x = mat[0] * vec.x + mat[1] * vec.y + mat[2] + mat[3]; result.y = mat[4] * vec.x + mat[5] * vec.y + mat[6] + mat[7]; result.z = 1.0f; } -void MultiplyVec2Mat34(const Vec3 &vec, const float *mat, Vec3 &result) +static void MultiplyVec2Mat34(const Vec3 &vec, const float *mat, Vec3 &result) { result.x = mat[0] * vec.x + mat[1] * vec.y + mat[2] + mat[3]; result.y = mat[4] * vec.x + mat[5] * vec.y + mat[6] + mat[7]; result.z = mat[8] * vec.x + mat[9] * vec.y + mat[10] + mat[11]; } -void MultiplyVec3Mat33(const Vec3 &vec, const float *mat, Vec3 &result) +static void MultiplyVec3Mat33(const Vec3 &vec, const float *mat, Vec3 &result) { result.x = mat[0] * vec.x + mat[1] * vec.y + mat[2] * vec.z; result.y = mat[3] * vec.x + mat[4] * vec.y + mat[5] * vec.z; result.z = mat[6] * vec.x + mat[7] * vec.y + mat[8] * vec.z; } -void MultiplyVec3Mat24(const Vec3 &vec, const float *mat, Vec3 &result) +static void MultiplyVec3Mat24(const Vec3 &vec, const float *mat, Vec3 &result) { result.x = mat[0] * vec.x + mat[1] * vec.y + mat[2] * vec.z + mat[3]; result.y = mat[4] * vec.x + mat[5] * vec.y + mat[6] * vec.z + mat[7]; result.z = 1.0f; } -void MultiplyVec3Mat34(const Vec3 &vec, const float *mat, Vec3 &result) +static void MultiplyVec3Mat34(const Vec3 &vec, const float *mat, Vec3 &result) { result.x = mat[0] * vec.x + mat[1] * vec.y + mat[2] * vec.z + mat[3]; result.y = mat[4] * vec.x + mat[5] * vec.y + mat[6] * vec.z + mat[7]; result.z = mat[8] * vec.x + mat[9] * vec.y + mat[10] * vec.z + mat[11]; } -void MultipleVec3Perspective(const Vec3 &vec, const float *proj, Vec4 &result) +static void MultipleVec3Perspective(const Vec3 &vec, const float *proj, Vec4 &result) { result.x = proj[0] * vec.x + proj[1] * vec.z; result.y = proj[2] * vec.y + proj[3] * vec.z; @@ -63,7 +63,7 @@ void MultipleVec3Perspective(const Vec3 &vec, const float *proj, Vec4 &result) result.w = -vec.z; } -void MultipleVec3Ortho(const Vec3 &vec, const float *proj, Vec4 &result) +static void MultipleVec3Ortho(const Vec3 &vec, const float *proj, Vec4 &result) { result.x = proj[0] * vec.x + proj[1]; result.y = proj[2] * vec.y + proj[3]; @@ -104,7 +104,7 @@ void TransformNormal(const InputVertexData *src, bool nbt, OutputVertexData *dst } } -void TransformTexCoordRegular(const TexMtxInfo &texinfo, int coordNum, bool specialCase, const InputVertexData *srcVertex, OutputVertexData *dstVertex) +static void TransformTexCoordRegular(const TexMtxInfo &texinfo, int coordNum, bool specialCase, const InputVertexData *srcVertex, OutputVertexData *dstVertex) { const Vec3 *src; switch (texinfo.sourcerow) @@ -208,7 +208,7 @@ inline float SafeDivide(float n, float d) return (d==0) ? (n>0?1:0) : n/d; } -void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, Vec3 &lightCol) +static void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, Vec3 &lightCol) { const LightPointer *light = (const LightPointer*)&xfmem.lights[lightNum]; @@ -293,7 +293,7 @@ void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChann } } -void LightAlpha(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, float &lightCol) +static void LightAlpha(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, float &lightCol) { const LightPointer *light = (const LightPointer*)&xfmem.lights[lightNum]; diff --git a/Source/Core/VideoCommon/CommandProcessor.cpp b/Source/Core/VideoCommon/CommandProcessor.cpp index 22af52cfad..c27681ac3c 100644 --- a/Source/Core/VideoCommon/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/CommandProcessor.cpp @@ -48,12 +48,12 @@ volatile bool interruptFinishWaiting = false; volatile u32 VITicks = CommandProcessor::m_cpClockOrigin; -bool IsOnThread() +static bool IsOnThread() { return SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread; } -void UpdateInterrupts_Wrapper(u64 userdata, int cyclesLate) +static void UpdateInterrupts_Wrapper(u64 userdata, int cyclesLate) { UpdateInterrupts(userdata); } diff --git a/Source/Core/VideoCommon/Fifo.h b/Source/Core/VideoCommon/Fifo.h index 9045c562c4..1254a27a72 100644 --- a/Source/Core/VideoCommon/Fifo.h +++ b/Source/Core/VideoCommon/Fifo.h @@ -17,6 +17,9 @@ extern volatile bool g_bSkipCurrentFrame; void Fifo_Init(); void Fifo_Shutdown(); +u8* GetVideoBufferStartPtr(); +u8* GetVideoBufferEndPtr(); + void Fifo_DoState(PointerWrap &f); void Fifo_PauseAndLock(bool doLock, bool unpauseOnUnlock); diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp index f3c916e047..f9ccc47375 100644 --- a/Source/Core/VideoCommon/MainBase.cpp +++ b/Source/Core/VideoCommon/MainBase.cpp @@ -66,7 +66,7 @@ void VideoBackendHardware::Video_SetRendering(bool bEnabled) } // Run from the graphics thread (from Fifo.cpp) -void VideoFifo_CheckSwapRequest() +static void VideoFifo_CheckSwapRequest() { if (g_ActiveConfig.bUseXFB) { @@ -177,7 +177,7 @@ static bool QueryResultIsReady() return !s_perf_query_requested || s_FifoShuttingDown; } -void VideoFifo_CheckPerfQueryRequest() +static void VideoFifo_CheckPerfQueryRequest() { if (s_perf_query_requested) { diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp index 5370c35750..8b42a20367 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp @@ -74,9 +74,6 @@ DataReadU32xNfunc DataReadU32xFuncs[16] = { DataReadU32xN<16> }; -extern u8* GetVideoBufferStartPtr(); -extern u8* GetVideoBufferEndPtr(); - static void Decode(); void InterpretDisplayList(u32 address, u32 size) @@ -107,7 +104,7 @@ void InterpretDisplayList(u32 address, u32 size) g_pVideoData = old_pVideoData; } -u32 FifoCommandRunnable(u32 &command_size) +static u32 FifoCommandRunnable(u32 &command_size) { u32 cycleTime = 0; u32 buffer_size = (u32)(GetVideoBufferEndPtr() - g_pVideoData); @@ -267,7 +264,7 @@ u32 FifoCommandRunnable(u32 &command_size) return cycleTime; } -u32 FifoCommandRunnable() +static u32 FifoCommandRunnable() { u32 command_size = 0; return FifoCommandRunnable(command_size); diff --git a/Source/Core/VideoCommon/PixelEngine.cpp b/Source/Core/VideoCommon/PixelEngine.cpp index 531ef21df6..85d4ed34f8 100644 --- a/Source/Core/VideoCommon/PixelEngine.cpp +++ b/Source/Core/VideoCommon/PixelEngine.cpp @@ -252,7 +252,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) } } -bool AllowIdleSkipping() +static bool AllowIdleSkipping() { return !SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread || (!m_Control.PETokenEnable && !m_Control.PEFinishEnable); } diff --git a/Source/Core/VideoCommon/TextureConversionShader.cpp b/Source/Core/VideoCommon/TextureConversionShader.cpp index fc9d33635a..10b8114c8d 100644 --- a/Source/Core/VideoCommon/TextureConversionShader.cpp +++ b/Source/Core/VideoCommon/TextureConversionShader.cpp @@ -57,7 +57,7 @@ u16 GetEncodedSampleCount(u32 format) // block dimensions : widthStride, heightStride // texture dims : width, height, x offset, y offset -void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType) +static void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType) { // left, top, of source rectangle within source texture // width of the destination rectangle, scale_factor (1 or 2) @@ -118,14 +118,14 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType) WRITE(p, " float sample_offset = float(position.w) / float(%d);\n", EFB_WIDTH); } -void WriteSampleColor(char*& p, const char* colorComp, const char* dest, int xoffset, API_TYPE ApiType) +static void WriteSampleColor(char*& p, const char* colorComp, const char* dest, int xoffset, API_TYPE ApiType) { WRITE(p, " %s = texture(samp0, uv0 + float2(%d, 0) * sample_offset).%s;\n", dest, xoffset, colorComp ); } -void WriteColorToIntensity(char*& p, const char* src, const char* dest) +static void WriteColorToIntensity(char*& p, const char* src, const char* dest) { if (!IntensityConstantAdded) { @@ -136,18 +136,18 @@ void WriteColorToIntensity(char*& p, const char* src, const char* dest) // don't add IntensityConst.a yet, because doing it later is faster and uses less instructions, due to vectorization } -void WriteToBitDepth(char*& p, u8 depth, const char* src, const char* dest) +static void WriteToBitDepth(char*& p, u8 depth, const char* src, const char* dest) { WRITE(p, " %s = floor(%s * 255.0 / exp2(8.0 - %d.0));\n", dest, src, depth); } -void WriteEncoderEnd(char*& p, API_TYPE ApiType) +static void WriteEncoderEnd(char*& p, API_TYPE ApiType) { WRITE(p, "}\n"); IntensityConstantAdded = false; } -void WriteI8Encoder(char*& p, API_TYPE ApiType) +static void WriteI8Encoder(char*& p, API_TYPE ApiType) { WriteSwizzler(p, GX_TF_I8, ApiType); WRITE(p, " float3 texSample;\n"); @@ -169,7 +169,7 @@ void WriteI8Encoder(char*& p, API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteI4Encoder(char*& p, API_TYPE ApiType) +static void WriteI4Encoder(char*& p, API_TYPE ApiType) { WriteSwizzler(p, GX_TF_I4, ApiType); WRITE(p, " float3 texSample;\n"); @@ -210,7 +210,7 @@ void WriteI4Encoder(char*& p, API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteIA8Encoder(char*& p,API_TYPE ApiType) +static void WriteIA8Encoder(char*& p,API_TYPE ApiType) { WriteSwizzler(p, GX_TF_IA8, ApiType); WRITE(p, " float4 texSample;\n"); @@ -228,7 +228,7 @@ void WriteIA8Encoder(char*& p,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteIA4Encoder(char*& p,API_TYPE ApiType) +static void WriteIA4Encoder(char*& p,API_TYPE ApiType) { WriteSwizzler(p, GX_TF_IA4, ApiType); WRITE(p, " float4 texSample;\n"); @@ -260,7 +260,7 @@ void WriteIA4Encoder(char*& p,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteRGB565Encoder(char*& p,API_TYPE ApiType) +static void WriteRGB565Encoder(char*& p,API_TYPE ApiType) { WriteSwizzler(p, GX_TF_RGB565, ApiType); @@ -283,7 +283,7 @@ void WriteRGB565Encoder(char*& p,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteRGB5A3Encoder(char*& p,API_TYPE ApiType) +static void WriteRGB5A3Encoder(char*& p,API_TYPE ApiType) { WriteSwizzler(p, GX_TF_RGB5A3, ApiType); @@ -349,7 +349,7 @@ void WriteRGB5A3Encoder(char*& p,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteRGBA4443Encoder(char*& p,API_TYPE ApiType) +static void WriteRGBA4443Encoder(char*& p,API_TYPE ApiType) { WriteSwizzler(p, GX_TF_RGB5A3, ApiType); @@ -373,7 +373,7 @@ void WriteRGBA4443Encoder(char*& p,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteRGBA8Encoder(char*& p,API_TYPE ApiType) +static void WriteRGBA8Encoder(char*& p,API_TYPE ApiType) { WriteSwizzler(p, GX_TF_RGBA8, ApiType); @@ -398,7 +398,7 @@ void WriteRGBA8Encoder(char*& p,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteC4Encoder(char*& p, const char* comp,API_TYPE ApiType) +static void WriteC4Encoder(char*& p, const char* comp,API_TYPE ApiType) { WriteSwizzler(p, GX_CTF_R4, ApiType); WRITE(p, " float4 color0;\n"); @@ -420,7 +420,7 @@ void WriteC4Encoder(char*& p, const char* comp,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteC8Encoder(char*& p, const char* comp,API_TYPE ApiType) +static void WriteC8Encoder(char*& p, const char* comp,API_TYPE ApiType) { WriteSwizzler(p, GX_CTF_R8, ApiType); @@ -432,7 +432,7 @@ void WriteC8Encoder(char*& p, const char* comp,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteCC4Encoder(char*& p, const char* comp,API_TYPE ApiType) +static void WriteCC4Encoder(char*& p, const char* comp,API_TYPE ApiType) { WriteSwizzler(p, GX_CTF_RA4, ApiType); WRITE(p, " float2 texSample;\n"); @@ -462,7 +462,7 @@ void WriteCC4Encoder(char*& p, const char* comp,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteCC8Encoder(char*& p, const char* comp, API_TYPE ApiType) +static void WriteCC8Encoder(char*& p, const char* comp, API_TYPE ApiType) { WriteSwizzler(p, GX_CTF_RA8, ApiType); @@ -472,7 +472,7 @@ void WriteCC8Encoder(char*& p, const char* comp, API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteZ8Encoder(char*& p, const char* multiplier,API_TYPE ApiType) +static void WriteZ8Encoder(char*& p, const char* multiplier,API_TYPE ApiType) { WriteSwizzler(p, GX_CTF_Z8M, ApiType); @@ -493,7 +493,7 @@ void WriteZ8Encoder(char*& p, const char* multiplier,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteZ16Encoder(char*& p,API_TYPE ApiType) +static void WriteZ16Encoder(char*& p,API_TYPE ApiType) { WriteSwizzler(p, GX_TF_Z16, ApiType); @@ -525,7 +525,7 @@ void WriteZ16Encoder(char*& p,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteZ16LEncoder(char*& p,API_TYPE ApiType) +static void WriteZ16LEncoder(char*& p,API_TYPE ApiType) { WriteSwizzler(p, GX_CTF_Z16L, ApiType); @@ -561,7 +561,7 @@ void WriteZ16LEncoder(char*& p,API_TYPE ApiType) WriteEncoderEnd(p, ApiType); } -void WriteZ24Encoder(char*& p, API_TYPE ApiType) +static void WriteZ24Encoder(char*& p, API_TYPE ApiType) { WriteSwizzler(p, GX_TF_Z24X8, ApiType); diff --git a/Source/Core/VideoCommon/TextureDecoder_x64.cpp b/Source/Core/VideoCommon/TextureDecoder_x64.cpp index 727b66848f..45bd06f06d 100644 --- a/Source/Core/VideoCommon/TextureDecoder_x64.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_x64.cpp @@ -521,7 +521,7 @@ inline u32 makeRGBA(int r, int g, int b, int a) return (a<<24)|(b<<16)|(g<<8)|r; } -void decodeDXTBlock(u32 *dst, const DXTBlock *src, int pitch) +static void decodeDXTBlock(u32 *dst, const DXTBlock *src, int pitch) { // S3TC Decoder (Note: GCN decodes differently from PC so we can't use native support) // Needs more speed. @@ -564,7 +564,7 @@ void decodeDXTBlock(u32 *dst, const DXTBlock *src, int pitch) } } -void decodeDXTBlockRGBA(u32 *dst, const DXTBlock *src, int pitch) +static void decodeDXTBlockRGBA(u32 *dst, const DXTBlock *src, int pitch) { // S3TC Decoder (Note: GCN decodes differently from PC so we can't use native support) // Needs more speed. @@ -689,7 +689,7 @@ inline void SetOpenMPThreadCount(int width, int height) //TODO: to save memory, don't blindly convert everything to argb8888 //also ARGB order needs to be swapped later, to accommodate modern hardware better //need to add DXT support too -PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt) +static PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt) { SetOpenMPThreadCount(width, height); @@ -956,7 +956,7 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh // TODO: complete SSE2 optimization of less often used texture formats. // TODO: refactor algorithms using _mm_loadl_epi64 unaligned loads to prefer 128-bit aligned loads. -PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int height, int texformat, int tlutaddr, int tlutfmt) +static PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int height, int texformat, int tlutaddr, int tlutfmt) { SetOpenMPThreadCount(width, height); diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index bdf58899e4..e248a83604 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -84,13 +84,13 @@ static const float fractionTable[32] = { using namespace Gen; -void LOADERDECL PosMtx_ReadDirect_UByte() +static void LOADERDECL PosMtx_ReadDirect_UByte() { s_curposmtx = DataReadU8() & 0x3f; PRIM_LOG("posmtx: %d, ", s_curposmtx); } -void LOADERDECL PosMtx_Write() +static void LOADERDECL PosMtx_Write() { DataWrite(s_curposmtx); DataWrite(0); @@ -101,7 +101,7 @@ void LOADERDECL PosMtx_Write() s_curposmtx = (u8) MatrixIndexA.PosNormalMtxIdx; } -void LOADERDECL UpdateBoundingBoxPrepare() +static void LOADERDECL UpdateBoundingBoxPrepare() { if (!PixelEngine::bbox_active) return; @@ -112,7 +112,7 @@ void LOADERDECL UpdateBoundingBoxPrepare() VertexManager::s_pCurBufferPointer = (u8*)s_bbox_vertex_buffer; } -inline bool UpdateBoundingBoxVars() +static inline bool UpdateBoundingBoxVars() { switch (s_bbox_primitive) { @@ -198,7 +198,7 @@ inline bool UpdateBoundingBoxVars() } } -void LOADERDECL UpdateBoundingBox() +static void LOADERDECL UpdateBoundingBox() { if (!PixelEngine::bbox_active) return; @@ -431,25 +431,25 @@ void LOADERDECL UpdateBoundingBox() PixelEngine::bbox[3] = (bottom > PixelEngine::bbox[3]) ? bottom : PixelEngine::bbox[3]; } -void LOADERDECL TexMtx_ReadDirect_UByte() +static void LOADERDECL TexMtx_ReadDirect_UByte() { s_curtexmtx[s_texmtxread] = DataReadU8() & 0x3f; PRIM_LOG("texmtx%d: %d, ", s_texmtxread, s_curtexmtx[s_texmtxread]); s_texmtxread++; } -void LOADERDECL TexMtx_Write_Float() +static void LOADERDECL TexMtx_Write_Float() { DataWrite(float(s_curtexmtx[s_texmtxwrite++])); } -void LOADERDECL TexMtx_Write_Float2() +static void LOADERDECL TexMtx_Write_Float2() { DataWrite(0.f); DataWrite(float(s_curtexmtx[s_texmtxwrite++])); } -void LOADERDECL TexMtx_Write_Float4() +static void LOADERDECL TexMtx_Write_Float4() { DataWrite(0.f); DataWrite(0.f); diff --git a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp index b7a6a3ec7b..032ef1d90f 100644 --- a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp +++ b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp @@ -37,7 +37,7 @@ __forceinline void LOG_TEX<2>() extern int tcIndex; extern float tcScale[8]; -void LOADERDECL TexCoord_Read_Dummy() +static void LOADERDECL TexCoord_Read_Dummy() { tcIndex++; } diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index b09ff4d32a..2507acfbb7 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -53,7 +53,7 @@ static ProjectionHack g_ProjHack1; static ProjectionHack g_ProjHack2; } // Namespace -float PHackValue(std::string sValue) +static float PHackValue(std::string sValue) { float f = 0; bool fp = false; diff --git a/Source/Core/VideoCommon/XFStructs.cpp b/Source/Core/VideoCommon/XFStructs.cpp index fb20c3d289..235c76bea6 100644 --- a/Source/Core/VideoCommon/XFStructs.cpp +++ b/Source/Core/VideoCommon/XFStructs.cpp @@ -11,13 +11,13 @@ #include "VideoCommon/VideoCommon.h" #include "VideoCommon/XFMemory.h" -void XFMemWritten(u32 transferSize, u32 baseAddress) +static void XFMemWritten(u32 transferSize, u32 baseAddress) { VertexManager::Flush(); VertexShaderManager::InvalidateXFRange(baseAddress, baseAddress + transferSize); } -void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData) +static void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData) { u32 address = baseAddress; u32 dataIndex = 0;