remove unused globals

Also change globals into statics which are only used in one file
This commit is contained in:
degasus 2014-07-08 22:37:58 +02:00
parent 81ed17be53
commit 7e79806efc
32 changed files with 28 additions and 21937 deletions

View File

@ -916,7 +916,7 @@ u32 EncodeVm(ARMReg Vm)
}
// Double/single, Neon
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 @@ const VFPEnc VFPOps[16][2] = {
{{ -1, -1}, {0x3B, 0x30}}, // 14: VABSi
};
const char *VFPOpNames[16] = {
static const char *VFPOpNames[16] = {
"VMLA",
"VNMLA",
"VMLS",

View File

@ -720,7 +720,4 @@ struct VFPEnc {
s16 opc1;
s16 opc2;
};
extern const VFPEnc VFPOps[16][2];
extern const char *VFPOpNames[16];
} // namespace

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, ...)
{

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

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

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" />

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>

View File

@ -31,7 +31,6 @@ namespace HLE_Misc
{
static std::string args;
static u32 argsPtr;
// If you just want to kill a function, one of the three following are usually appropriate.
// According to the PPC ABI, the return value is always in r3.

View File

@ -47,6 +47,7 @@ extern u8 *m_pEXRAM;
extern u8 *m_pL1Cache;
extern u8 *m_pVirtualFakeVMEM;
extern u8 *m_pFakeVMEM;
extern bool bFakeVMEM;
enum
{

View File

@ -22,7 +22,6 @@
#include "Core/HW/GPFifo.h"
#include "Core/HW/Memmap.h"
#include "Core/HW/MMIO.h"
#include "Core/PowerPC/JitInterface.h"
#include "Core/PowerPC/PowerPC.h"
#include "VideoCommon/VideoBackendBase.h"

View File

@ -54,7 +54,7 @@ static const u8 eeprom_data_16D0[] = {
0x77, 0x88, 0x00, 0x00, 0x2B, 0x01, 0xE8, 0x13
};
const ReportFeatures reporting_mode_features[] =
static const ReportFeatures reporting_mode_features[] =
{
//0x30: Core Buttons
{ 2, 0, 0, 0, 4 },

View File

@ -68,8 +68,6 @@ struct ExtensionReg
u8 constant_id[6];
};
extern const ReportFeatures reporting_mode_features[];
void FillRawAccelFromGForceData(wm_accel& raw_accel,
const accel_cal& calib,
const WiimoteEmu::AccelData& accel);

View File

@ -39,24 +39,25 @@ static std::mutex cs_frameSkip;
namespace Movie {
bool g_bFrameStep = false;
static bool g_bFrameStep = false;
static bool g_bFrameStop = false;
bool g_bReadOnly = true;
u32 g_rerecords = 0;
PlayMode g_playMode = MODE_NONE;
static bool g_bReadOnly = true;
static u32 g_rerecords = 0;
static PlayMode g_playMode = MODE_NONE;
u32 g_framesToSkip = 0, g_frameSkipCounter = 0;
static u32 g_framesToSkip = 0, g_frameSkipCounter = 0;
u8 g_numPads = 0;
static u8 g_numPads = 0;
static ControllerState g_padState;
static DTMHeader tmpHeader;
static u8* tmpInput = nullptr;
static size_t tmpInputAllocated = 0;
u64 g_currentByte = 0, g_totalBytes = 0;
static u64 g_currentByte = 0, g_totalBytes = 0;
u64 g_currentFrame = 0, g_totalFrames = 0; // VI
u64 g_currentLagCount = 0, g_totalLagCount = 0; // just stats
u64 g_currentLagCount = 0;
static u64 g_totalLagCount = 0; // just stats
u64 g_currentInputCount = 0, g_totalInputCount = 0; // just stats
u64 g_totalTickCount = 0, g_tickCountAtLastInput = 0; // just stats
static u64 g_totalTickCount = 0, g_tickCountAtLastInput = 0; // just stats
static u64 g_recordingStartTime; // seconds since 1970 that recording started
static bool bSaveConfig = false, bSkipIdle = false, bDualCore = false, bProgressive = false, bDSPHLE = false, bFastDiscSpeed = false;
bool g_bClearSave = false;
@ -74,7 +75,7 @@ static u32 DSPiromHash = 0;
static u32 DSPcoefHash = 0;
static bool g_bRecordingFromSaveState = false;
bool g_bPolled = false;
static bool g_bPolled = false;
static int g_currentSaveVersion = 0;
static std::string tmpStateFilename = File::GetUserPath(D_STATESAVES_IDX) + "dtm.sav";

View File

@ -49,26 +49,14 @@ static_assert(sizeof(ControllerState) == 8, "ControllerState should be 8 bytes")
#pragma pack(pop)
// Global declarations
extern bool g_bFrameStep, g_bPolled, g_bReadOnly, g_bDiscChange, g_bClearSave;
extern PlayMode g_playMode;
extern bool g_bDiscChange, g_bClearSave;
extern u64 g_titleID;
extern u32 g_framesToSkip, g_frameSkipCounter;
extern u8 g_numPads;
extern ControllerState *g_padStates;
extern char g_playingFile[256];
extern std::string g_recordFile;
extern u64 g_currentByte, g_totalBytes;
extern u64 g_currentFrame, g_totalFrames;
extern u64 g_currentLagCount, g_totalLagCount;
extern u64 g_currentLagCount;
extern u64 g_currentInputCount, g_totalInputCount;
extern u64 g_totalTickCount, g_tickCountAtLastInput;
extern std::string g_discChange;
extern u32 g_rerecords;
#pragma pack(push,1)
struct DTMHeader
{

View File

@ -16,7 +16,6 @@
using namespace ArmGen;
JitArmILAsmRoutineManager armil_asm_routines;
void JitArmILAsmRoutineManager::Generate()
{
enterCode = GetCodePtr();

View File

@ -25,4 +25,3 @@ public:
}
};
extern JitArmILAsmRoutineManager armil_asm_routines;

View File

@ -31,7 +31,7 @@
#include "Core/PowerPC/JitArmIL/JitIL_Tables.h"
#endif
bool bFakeVMEM = false;
static bool bFakeVMEM = false;
bool bMMU = false;
namespace JitInterface

View File

@ -35,6 +35,5 @@ namespace JitInterface
void Shutdown();
}
extern bool bFakeVMEM;
extern bool bMMU;

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
// Gekko related unions, structs, ...
#pragma once
extern const unsigned int frsqrtex_lut[65536];

View File

@ -10,7 +10,6 @@ namespace Profiler
{
bool g_ProfileBlocks;
bool g_ProfileInstructions;
void WriteProfileResults(const std::string& filename)
{

View File

@ -58,7 +58,6 @@ struct BlockStat
namespace Profiler
{
extern bool g_ProfileBlocks;
extern bool g_ProfileInstructions;
void WriteProfileResults(const std::string& filename);
}

View File

@ -35,7 +35,7 @@
class wxWindow;
DSPDebuggerLLE* m_DebuggerFrame = nullptr;
static DSPDebuggerLLE* m_DebuggerFrame = nullptr;
BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel)
EVT_CLOSE(DSPDebuggerLLE::OnClose)

View File

@ -74,4 +74,3 @@ private:
//void UnselectAll();
};
extern DSPDebuggerLLE* m_DebuggerFrame;

View File

@ -21,7 +21,7 @@ HINSTANCE hDXGIDll = nullptr;
int dxgi_dll_ref = 0;
typedef HRESULT (WINAPI* D3D11CREATEDEVICEANDSWAPCHAIN)(IDXGIAdapter*, D3D_DRIVER_TYPE, HMODULE, UINT, CONST D3D_FEATURE_LEVEL*, UINT, UINT, CONST DXGI_SWAP_CHAIN_DESC*, IDXGISwapChain**, ID3D11Device**, D3D_FEATURE_LEVEL*, ID3D11DeviceContext**);
D3D11CREATEDEVICE PD3D11CreateDevice = nullptr;
static D3D11CREATEDEVICE PD3D11CreateDevice = nullptr;
D3D11CREATEDEVICEANDSWAPCHAIN PD3D11CreateDeviceAndSwapChain = nullptr;
HINSTANCE hD3DDll = nullptr;
int d3d_dll_ref = 0;
@ -31,7 +31,7 @@ namespace D3D
ID3D11Device* device = nullptr;
ID3D11DeviceContext* context = nullptr;
IDXGISwapChain* swapchain = nullptr;
static IDXGISwapChain* swapchain = nullptr;
D3D_FEATURE_LEVEL featlevel;
D3DTexture2D* backbuf = nullptr;
HWND hWnd;

View File

@ -40,7 +40,6 @@ void Close();
extern ID3D11Device* device;
extern ID3D11DeviceContext* context;
extern IDXGISwapChain* swapchain;
extern HWND hWnd;
extern bool bFrameInProgress;
@ -77,7 +76,6 @@ void SetDebugObjectName(T resource, const char* name)
typedef HRESULT (WINAPI *CREATEDXGIFACTORY)(REFIID, void**);
extern CREATEDXGIFACTORY PCreateDXGIFactory;
typedef HRESULT (WINAPI *D3D11CREATEDEVICE)(IDXGIAdapter*, D3D_DRIVER_TYPE, HMODULE, UINT, CONST D3D_FEATURE_LEVEL*, UINT, UINT, ID3D11Device**, D3D_FEATURE_LEVEL*, ID3D11DeviceContext**);
extern D3D11CREATEDEVICE PD3D11CreateDevice;
typedef HRESULT (WINAPI *D3DREFLECT)(LPCVOID, SIZE_T, REFIID, void**);
extern D3DREFLECT PD3DReflect;

View File

@ -44,7 +44,7 @@ static int et_UpdateInterrupts;
static volatile bool interruptSet;
static volatile bool interruptWaiting;
CPReg cpreg; // shared between gfx and emulator thread
static CPReg cpreg; // shared between gfx and emulator thread
void DoState(PointerWrap &p)
{

View File

@ -41,8 +41,6 @@ namespace SWCommandProcessor
u32 breakpt; // 0x3c
};
extern CPReg cpreg;
// Init
void Init();
void Shutdown();

View File

@ -92,9 +92,6 @@ __forceinline u32 DataReadU32()
return DataRead<u32>();
}
typedef void (*DataReadU32xNfunc)(u32 *buf);
extern DataReadU32xNfunc DataReadU32xFuncs[16];
#if _M_SSE >= 0x301
const __m128i bs_mask = _mm_set_epi32(0x0C0D0E0FL, 0x08090A0BL, 0x04050607L, 0x00010203L);

View File

@ -34,8 +34,9 @@
u8* g_pVideoData = nullptr;
bool g_bRecordFifoData = false;
typedef void (*DataReadU32xNfunc)(u32 *buf);
#if _M_SSE >= 0x301
DataReadU32xNfunc DataReadU32xFuncs_SSSE3[16] = {
static DataReadU32xNfunc DataReadU32xFuncs_SSSE3[16] = {
DataReadU32xN_SSSE3<1>,
DataReadU32xN_SSSE3<2>,
DataReadU32xN_SSSE3<3>,
@ -55,7 +56,7 @@ DataReadU32xNfunc DataReadU32xFuncs_SSSE3[16] = {
};
#endif
DataReadU32xNfunc DataReadU32xFuncs[16] = {
static DataReadU32xNfunc DataReadU32xFuncs[16] = {
DataReadU32xN<1>,
DataReadU32xN<2>,
DataReadU32xN<3>,

View File

@ -51,7 +51,6 @@ static int loop_counter;
// Vertex loaders read these. Although the scale ones should be baked into the shader.
int tcIndex;
int colIndex;
TVtxAttr* pVtxAttr;
int colElements[2];
float posScale;
float tcScale[8];
@ -837,7 +836,6 @@ void VertexLoader::SetupRunVertices(int vtx_attr_group, int primitive, int const
m_VtxAttr.texCoord[6].Frac = g_VtxAttr[vtx_attr_group].g2.Tex6Frac;
m_VtxAttr.texCoord[7].Frac = g_VtxAttr[vtx_attr_group].g2.Tex7Frac;
pVtxAttr = &m_VtxAttr;
posScale = fractionTable[m_VtxAttr.PosFrac];
if (m_NativeFmt->m_components & VB_HAS_UVALL)
for (int i = 0; i < 8; i++)

View File

@ -27,7 +27,6 @@
extern NativeVertexFormat *g_nativeVertexFmt;
extern int tcIndex;
extern int colIndex;
extern TVtxAttr* pVtxAttr;
extern int colElements[2];
extern float posScale;
extern float tcScale[8];