Merge pull request #579 from degasus/statics

Mark unexported global variables and functions as statics.
This commit is contained in:
Pierre Bourdon
2014-07-11 16:37:42 +02:00
169 changed files with 596 additions and 22553 deletions
+2
View File
@@ -197,6 +197,8 @@ if(NOT MSVC)
check_and_add_flag(LOGICAL_OP -Wlogical-op)
check_and_add_flag(SHADOW -Wshadow)
check_and_add_flag(INIT_SELF -Winit-self)
check_and_add_flag(MISSING_DECLARATIONS -Wmissing-declarations)
check_and_add_flag(MISSING_VARIABLE_DECLARATIONS -Wmissing-variable-declarations)
endif(NOT MSVC)
# gcc uses some optimizations which might break stuff without this flag
+19 -19
View File
@@ -23,18 +23,18 @@
#define M_SQRT1_2 0.70710678118654752440
#endif
int olddelay = -1;
unsigned int oldfreq = 0;
unsigned int dlbuflen;
int cyc_pos;
float l_fwr, r_fwr, lpr_fwr, lmr_fwr;
std::vector<float> fwrbuf_l, fwrbuf_r;
float adapt_l_gain, adapt_r_gain, adapt_lpr_gain, adapt_lmr_gain;
std::vector<float> lf, rf, lr, rr, cf, cr;
float LFE_buf[256];
unsigned int lfe_pos;
float *filter_coefs_lfe;
unsigned int len125;
static int olddelay = -1;
static unsigned int oldfreq = 0;
static unsigned int dlbuflen;
static int cyc_pos;
static float l_fwr, r_fwr, lpr_fwr, lmr_fwr;
static std::vector<float> fwrbuf_l, fwrbuf_r;
static float adapt_l_gain, adapt_r_gain, adapt_lpr_gain, adapt_lmr_gain;
static std::vector<float> lf, rf, lr, rr, cf, cr;
static float LFE_buf[256];
static unsigned int lfe_pos;
static float *filter_coefs_lfe;
static unsigned int len125;
template<class T,class _ftype_t> static _ftype_t dotproduct(int count,const T *buf,const _ftype_t *coefficients)
{
@@ -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,
+2 -2
View File
@@ -916,7 +916,7 @@ u32 EncodeVm(ARMReg Vm)
}
// Double/single, Neon
extern const VFPEnc VFPOps[16][2] = {
static const VFPEnc VFPOps[16][2] = {
{{0xE0, 0xA0}, { -1, -1}}, // 0: VMLA
{{0xE1, 0xA4}, { -1, -1}}, // 1: VNMLA
{{0xE0, 0xA4}, { -1, -1}}, // 2: VMLS
@@ -934,7 +934,7 @@ extern const VFPEnc VFPOps[16][2] = {
{{ -1, -1}, {0x3B, 0x30}}, // 14: VABSi
};
const char *VFPOpNames[16] = {
static const char *VFPOpNames[16] = {
"VMLA",
"VNMLA",
"VMLS",
-3
View File
@@ -720,7 +720,4 @@ struct VFPEnc {
s16 opc1;
s16 opc2;
};
extern const VFPEnc VFPOps[16][2];
extern const char *VFPOpNames[16];
} // namespace
+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)
{
+2 -2
View File
@@ -411,8 +411,8 @@ void StackTrace(HANDLE hThread, const char* lpszMessage, FILE *file, DWORD eip,
if (hThread != GetCurrentThread())
ResumeThread(hThread);
}
char g_uefbuf[2048];
#define UEFBUFSIZE 2048
static char g_uefbuf[UEFBUFSIZE];
void etfprintf(FILE *file, const char *format, ...)
{
-2
View File
@@ -36,8 +36,6 @@ void StackTrace(HANDLE, char const* msg, FILE *file, DWORD eip, DWORD esp, DWORD
// functions by Masken
void etfprintf(FILE *file, const char *format, ...);
void etfprint(FILE *file, const std::string &text);
#define UEFBUFSIZE 2048
extern char g_uefbuf[UEFBUFSIZE];
#else // not WIN32
+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
@@ -22,7 +22,7 @@ typedef std::string (*StringTranslator)(const char* text);
void RegisterMsgAlertHandler(MsgAlertHandler handler);
void RegisterStringTranslator(StringTranslator translator);
extern bool MsgAlert(bool yes_no, int Style, const char* format, ...)
bool MsgAlert(bool yes_no, int Style, const char* format, ...)
#ifdef __GNUC__
__attribute__((format(printf, 3, 4)))
#endif
+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;
+15 -15
View File
@@ -18,9 +18,9 @@ namespace ActionReplay
{
// Alphanumeric filter for text<->bin conversion
const char *filter = "0123456789ABCDEFGHJKMNPQRTUVWXYZILOS";
static const char *filter = "0123456789ABCDEFGHJKMNPQRTUVWXYZILOS";
u32 genseeds[0x20];
static u32 genseeds[0x20];
const u8 gentable0[0x38] = {
0x39, 0x31, 0x29, 0x21, 0x19, 0x11, 0x09, 0x01,
@@ -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)
{
-1
View File
@@ -148,7 +148,6 @@ set(SRCS ActionReplay.cpp
IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp
IPC_HLE/WII_IPC_HLE_WiiMote.cpp
IPC_HLE/WiiMote_HID_Attr.cpp
PowerPC/LUT_frsqrtex.cpp
PowerPC/PowerPC.cpp
PowerPC/PPCAnalyst.cpp
PowerPC/PPCCache.cpp
+12 -12
View File
@@ -66,9 +66,9 @@ namespace Core
{
// Declarations and definitions
Common::Timer Timer;
volatile u32 DrawnFrame = 0;
u32 DrawnVideo = 0;
static Common::Timer Timer;
static volatile u32 DrawnFrame = 0;
static u32 DrawnVideo = 0;
// Function forwarding
const char *Callback_ISOName(void);
@@ -77,12 +77,12 @@ void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _
// Function declarations
void EmuThread();
bool g_bStopping = false;
bool g_bHwInit = false;
bool g_bStarted = false;
void *g_pWindowHandle = nullptr;
std::string g_stateFileName;
std::thread g_EmuThread;
static bool g_bStopping = false;
static bool g_bHwInit = false;
static bool g_bStarted = false;
static void *g_pWindowHandle = nullptr;
static std::string g_stateFileName;
static std::thread g_EmuThread;
static StoppedCallbackFunc s_onStoppedCb = nullptr;
static std::thread g_cpu_thread;
@@ -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;
+3
View File
@@ -17,6 +17,9 @@
#include "Common/CommonTypes.h"
#include "Core/CoreParameter.h"
// TODO: ugly, remove
extern bool g_aspect_wide;
namespace Core
{
+1 -3
View File
@@ -223,7 +223,6 @@
<ClCompile Include="PowerPC\JitCommon\JitCache.cpp" />
<ClCompile Include="PowerPC\JitCommon\Jit_Util.cpp" />
<ClCompile Include="PowerPC\JitInterface.cpp" />
<ClCompile Include="PowerPC\LUT_frsqrtex.cpp" />
<ClCompile Include="PowerPC\PowerPC.cpp" />
<ClCompile Include="PowerPC\PPCAnalyst.cpp" />
<ClCompile Include="PowerPC\PPCCache.cpp" />
@@ -409,7 +408,6 @@
<ClInclude Include="PowerPC\JitCommon\JitCache.h" />
<ClInclude Include="PowerPC\JitCommon\Jit_Util.h" />
<ClInclude Include="PowerPC\JitInterface.h" />
<ClInclude Include="PowerPC\LUT_frsqrtex.h" />
<ClInclude Include="PowerPC\PowerPC.h" />
<ClInclude Include="PowerPC\PPCAnalyst.h" />
<ClInclude Include="PowerPC\PPCCache.h" />
@@ -466,4 +464,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
-6
View File
@@ -602,9 +602,6 @@
<ClCompile Include="PowerPC\JitInterface.cpp">
<Filter>PowerPC</Filter>
</ClCompile>
<ClCompile Include="PowerPC\LUT_frsqrtex.cpp">
<Filter>PowerPC</Filter>
</ClCompile>
<ClCompile Include="PowerPC\PowerPC.cpp">
<Filter>PowerPC</Filter>
</ClCompile>
@@ -1161,9 +1158,6 @@
<ClInclude Include="PowerPC\JitInterface.h">
<Filter>PowerPC</Filter>
</ClInclude>
<ClInclude Include="PowerPC\LUT_frsqrtex.h">
<Filter>PowerPC</Filter>
</ClInclude>
<ClInclude Include="PowerPC\PowerPC.h">
<Filter>PowerPC</Filter>
</ClInclude>
+16 -16
View File
@@ -27,7 +27,7 @@ struct EventType
std::string name;
};
std::vector<EventType> event_types;
static std::vector<EventType> event_types;
struct BaseEvent
{
@@ -41,28 +41,28 @@ typedef LinkedListItem<BaseEvent> Event;
// STATE_TO_SAVE
static Event *first;
static std::mutex tsWriteLock;
Common::FifoQueue<BaseEvent, false> tsQueue;
static Common::FifoQueue<BaseEvent, false> tsQueue;
// event pools
Event *eventPool = nullptr;
static Event *eventPool = nullptr;
int slicelength;
int maxSliceLength = MAX_SLICE_LENGTH;
static int maxSliceLength = MAX_SLICE_LENGTH;
s64 globalTimer;
s64 idledCycles;
static s64 globalTimer;
static s64 idledCycles;
u32 fakeDecStartValue;
u64 fakeDecStartTicks;
u64 fakeTBStartValue;
u64 fakeTBStartTicks;
static u32 fakeDecStartValue;
static u64 fakeDecStartTicks;
static u64 fakeTBStartValue;
static u64 fakeTBStartTicks;
int ev_lost;
static int ev_lost;
void (*advanceCallback)(int cyclesExecuted) = nullptr;
static 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;

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