mark all local functions as static

This commit is contained in:
degasus
2014-07-11 16:07:23 +02:00
parent 3ff1c538ee
commit 22e1aa5bb4
93 changed files with 260 additions and 251 deletions
+7 -7
View File
@@ -83,7 +83,7 @@ template<class T> 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,
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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;
+1
View File
@@ -6,6 +6,7 @@
#include <string.h>
#include "Common/Common.h"
#include "Common/Crypto/bn.h"
static void bn_zero(u8 *d, u32 n)
{
+1
View File
@@ -7,6 +7,7 @@
#include <string>
#include "Common/Common.h"
#include "Common/MemoryUtil.h"
#ifdef _WIN32
#include <windows.h>
+1 -1
View File
@@ -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;
+13 -13
View File
@@ -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<std::string> alpha, int size)
static int alphatobin(u32 *dst, std::vector<std::string> alpha, int size)
{
int j = 0;
int ret = 0;
+2 -2
View File
@@ -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)
{
+3 -3
View File
@@ -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;
+4 -4
View File
@@ -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;
+1 -1
View File
@@ -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)
{
+2 -2
View File
@@ -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.
+3 -3
View File
@@ -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;
-2
View File
@@ -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)
{
+2
View File
@@ -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);
+6 -6
View File
@@ -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<r_jcc>(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<r_jmprcc>(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<r_call>(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<r_callr>(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));
@@ -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<void(u32)>& stack_step)
static void WalkTheStack(const std::function<void(u32)>& stack_step)
{
if (!IsStackBottom(PowerPC::ppcState.gpr[1]))
{
+1 -1
View File
@@ -68,7 +68,7 @@ void SetActiveCodes(const std::vector<GeckoCode>& 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;
+1 -1
View File
@@ -97,7 +97,7 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector<Ge
}
// used by the SaveGeckoCodes function
void SaveGeckoCode(std::vector<std::string>& lines, std::vector<std::string>& enabledLines, const GeckoCode& gcode)
static void SaveGeckoCode(std::vector<std::string>& lines, std::vector<std::string>& enabledLines, const GeckoCode& gcode)
{
if (gcode.enabled)
enabledLines.push_back("$" + gcode.name);
+1
View File
@@ -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"

Some files were not shown because too many files have changed in this diff Show More