mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Fix some cases of variables being used uninitialized. Also some unused
variables, writeable strings and dangerously shadowed variables. index(), gamma(), exp() and y0() are POSIX functions and using those names can cause namespace confusion. A number of C files were missing the final newline required by ANSI C and some versions of GCC are pedantic enough to complain about this. These changes simply the scons build, allowing us to get rid of filterWarnings which is simply more trouble than it's worth. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5574 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -12,7 +12,6 @@ files = [
|
||||
]
|
||||
|
||||
acenv = env.Clone()
|
||||
acenv.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
|
||||
if acenv['HAVE_OPENAL']:
|
||||
files += [ 'OpenALStream.cpp', 'aldlist.cpp' ]
|
||||
|
@ -93,7 +93,7 @@ public:
|
||||
x.clear();
|
||||
while (number > 0)
|
||||
{
|
||||
unsigned int first;
|
||||
unsigned int first = 0;
|
||||
Do(first);
|
||||
std::string second;
|
||||
Do(second);
|
||||
|
@ -64,4 +64,4 @@ private:
|
||||
int num_entries_;
|
||||
};
|
||||
|
||||
#endif // _LINEAR_DISKCACHE
|
||||
#endif // _LINEAR_DISKCACHE
|
||||
|
@ -49,5 +49,4 @@ if sys.platform == 'win32':
|
||||
files += [ "stdafx.cpp" ]
|
||||
|
||||
env_common = env.Clone()
|
||||
env_common.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
env_common.StaticLibrary(env['local_libs'] + "common", files)
|
||||
|
@ -40,7 +40,7 @@ extern "C" {
|
||||
#include "lstate.h"
|
||||
};
|
||||
|
||||
// TODO Count: 7
|
||||
// TODO Count: 7
|
||||
|
||||
#if defined(DEBUG) || defined(DEBUGFAST)
|
||||
bool Debug = true;
|
||||
@ -1111,7 +1111,7 @@ DEFINE_LUA_FUNCTION(emulua_wait, "")
|
||||
|
||||
// we're only calling this to run user events. (a windows-only example of what that means is the canonical Peek/Translate/Dispatch loop)
|
||||
// hopefully this won't actually advance the emulation state in any non-user-input-driven way when called in this context...
|
||||
CoreTiming::Advance();
|
||||
CoreTiming::Advance();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1167,7 +1167,7 @@ void LuaRescueHook(lua_State* L, lua_Debug *dbg)
|
||||
{
|
||||
//lua_sethook(L, NULL, 0, 0);
|
||||
assert(L->errfunc || L->errorJmp);
|
||||
luaL_error(L, info.panic ? info.panicMessage : "terminated by user");
|
||||
luaL_error(L, info.panic ? info.panicMessage : "terminated by user");
|
||||
}
|
||||
|
||||
info.panic = false;
|
||||
@ -1382,7 +1382,7 @@ DEFINE_LUA_FUNCTION(emulua_frameadvance, "")
|
||||
if(info.speedMode == SPEEDMODE_MAXIMUM)
|
||||
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(true);
|
||||
Frame::SetFrameStopping(false);
|
||||
*PowerPC::GetStatePtr() = PowerPC::CPU_RUNNING;
|
||||
*PowerPC::GetStatePtr() = PowerPC::CPU_RUNNING;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1410,7 +1410,7 @@ DEFINE_LUA_FUNCTION(emulua_redraw, "")
|
||||
|
||||
DEFINE_LUA_FUNCTION(memory_readbyte, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned char value = Memory::Read_U8(address);
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
@ -1418,7 +1418,7 @@ DEFINE_LUA_FUNCTION(memory_readbyte, "address")
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readbytesigned, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
signed char value = (signed char)(Memory::Read_U8(address));
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
@ -1426,7 +1426,7 @@ DEFINE_LUA_FUNCTION(memory_readbytesigned, "address")
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readword, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned short value = Memory::Read_U16(address);
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
@ -1434,7 +1434,7 @@ DEFINE_LUA_FUNCTION(memory_readword, "address")
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readwordsigned, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
signed short value = (signed short)(Memory::Read_U16(address));
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
@ -1442,7 +1442,7 @@ DEFINE_LUA_FUNCTION(memory_readwordsigned, "address")
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readdword, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long value = Memory::Read_U32(address);
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
@ -1450,7 +1450,7 @@ DEFINE_LUA_FUNCTION(memory_readdword, "address")
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readdwordsigned, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
signed long value = (signed long)(Memory::Read_U32(address));
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
@ -1458,7 +1458,7 @@ DEFINE_LUA_FUNCTION(memory_readdwordsigned, "address")
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readqword, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long long value = Memory::Read_U64(address);
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, (lua_Integer)value);
|
||||
@ -1466,7 +1466,7 @@ DEFINE_LUA_FUNCTION(memory_readqword, "address")
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readqwordsigned, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
signed long long value = (signed long long)(Memory::Read_U64(address));
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, (lua_Integer)value);
|
||||
@ -1475,28 +1475,28 @@ DEFINE_LUA_FUNCTION(memory_readqwordsigned, "address")
|
||||
|
||||
DEFINE_LUA_FUNCTION(memory_writebyte, "address,value")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned char value = (unsigned char)(luaL_checkinteger(L,2) & 0xFF);
|
||||
Memory::Write_U8(value, address);
|
||||
return 0;
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_writeword, "address,value")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned short value = (unsigned short)(luaL_checkinteger(L,2) & 0xFFFF);
|
||||
Memory::Write_U16(value, address);
|
||||
return 0;
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_writedword, "address,value")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long value = (unsigned long)(luaL_checkinteger(L,2));
|
||||
Memory::Write_U32(value, address);
|
||||
return 0;
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_writeqword, "address,value")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long value = (unsigned long)(luaL_checkinteger(L,2));
|
||||
Memory::Write_U64(value, address);
|
||||
return 0;
|
||||
@ -1504,7 +1504,7 @@ DEFINE_LUA_FUNCTION(memory_writeqword, "address,value")
|
||||
|
||||
DEFINE_LUA_FUNCTION(memory_readbyterange, "address,length")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
int length = (int)luaL_checkinteger(L,2);
|
||||
|
||||
if(length < 0)
|
||||
@ -1533,7 +1533,7 @@ DEFINE_LUA_FUNCTION(memory_readbyterange, "address,length")
|
||||
|
||||
DEFINE_LUA_FUNCTION(memory_isvalid, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
lua_settop(L,0);
|
||||
lua_pushboolean(L, Memory::IsRAMAddress(address));
|
||||
return 1;
|
||||
@ -2790,7 +2790,7 @@ DEFINE_LUA_FUNCTION(emulua_loadrom, "filename")
|
||||
// Load game specific settings
|
||||
IniFile game_ini;
|
||||
std::string unique_id = StartUp.GetUniqueID();
|
||||
StartUp.m_strGameIni = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + unique_id + ".ini";
|
||||
StartUp.m_strGameIni = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + unique_id + ".ini";
|
||||
if (unique_id.size() == 6 && game_ini.Load(StartUp.m_strGameIni.c_str()))
|
||||
{
|
||||
// General settings
|
||||
|
@ -141,4 +141,4 @@ void JitIL::fsign(UGeckoInstruction inst)
|
||||
PanicAlert("fsign bleh");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,4 @@
|
||||
|
||||
extern const unsigned int frsqrtex_lut[65536];
|
||||
|
||||
#endif //_LUT_frsqrtex_h_
|
||||
#endif //_LUT_frsqrtex_h_
|
||||
|
@ -15,4 +15,4 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
|
@ -30,6 +30,5 @@ files = [
|
||||
]
|
||||
|
||||
acenv = env.Clone()
|
||||
acenv.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
|
||||
acenv.StaticLibrary(env['local_libs'] + 'dspcore', files, LIBS = [ 'common'] )
|
||||
|
@ -13,6 +13,5 @@ files = [
|
||||
]
|
||||
|
||||
acenv = env.Clone()
|
||||
acenv.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
|
||||
acenv.StaticLibrary(env['local_libs'] + 'debugger_ui_util', files)
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <sys/param.h>
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
#include "Common.h"
|
||||
|
@ -238,8 +238,8 @@ ControlState ControllerInterface::InputReference::State( const ControlState igno
|
||||
if ( NULL == device )
|
||||
return 0;
|
||||
|
||||
ControlState state;
|
||||
// this mode thing will be turned into a switch statement
|
||||
ControlState state = 0;
|
||||
|
||||
switch ( mode )
|
||||
{
|
||||
// OR
|
||||
|
@ -171,4 +171,5 @@
|
||||
{ kHIDUsage_KeyboardRightShift, "Right Shift" },
|
||||
{ kHIDUsage_KeyboardRightAlt, "Right Alt" },
|
||||
{ kHIDUsage_KeyboardRightGUI, "Right GUI" },
|
||||
/* 0x4E - 0xFFFF Reserved */
|
||||
/* 0x4E - 0xFFFF Reserved */
|
||||
|
||||
|
@ -39,5 +39,4 @@ if sys.platform == 'linux2':
|
||||
'ControllerInterface/Xlib/Xlib.cpp'
|
||||
]
|
||||
|
||||
icenv.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
icenv.StaticLibrary(env['local_libs'] + "inputcommon", files)
|
||||
|
@ -121,4 +121,4 @@ bool IsConnected(int Controller)
|
||||
|
||||
} // XInput
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -45,5 +45,4 @@ if env_vcommon['HAVE_OPENCL']:
|
||||
'OpenCL/OCLTextureDecoder.cpp',
|
||||
]
|
||||
|
||||
env_vcommon.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
env_vcommon.StaticLibrary(env['local_libs'] + "videocommon", files)
|
||||
|
Reference in New Issue
Block a user