Attempted fix for several GCC warnings.
This commit is contained in:
parent
da75907942
commit
aaddc98b46
|
@ -677,6 +677,11 @@ void cLuaState::Push(void * a_Ptr)
|
||||||
{
|
{
|
||||||
ASSERT(IsValid());
|
ASSERT(IsValid());
|
||||||
|
|
||||||
|
// Investigate the cause of this - what is the callstack?
|
||||||
|
LOGWARNING("Lua engine encountered an error - attempting to push a plain pointer");
|
||||||
|
LogStackTrace();
|
||||||
|
ASSERT(!"A plain pointer should never be pushed on Lua stack");
|
||||||
|
|
||||||
lua_pushnil(m_LuaState);
|
lua_pushnil(m_LuaState);
|
||||||
m_NumCurrentFunctionArgs += 1;
|
m_NumCurrentFunctionArgs += 1;
|
||||||
}
|
}
|
||||||
|
@ -1265,6 +1270,8 @@ void cLuaState::LogStack(const char * a_Header)
|
||||||
|
|
||||||
void cLuaState::LogStack(lua_State * a_LuaState, const char * a_Header)
|
void cLuaState::LogStack(lua_State * a_LuaState, const char * a_Header)
|
||||||
{
|
{
|
||||||
|
UNUSED(a_Header); // The param seems unused when compiling for release, so the compiler warns
|
||||||
|
|
||||||
LOGD((a_Header != NULL) ? a_Header : "Lua C API Stack contents:");
|
LOGD((a_Header != NULL) ? a_Header : "Lua C API Stack contents:");
|
||||||
for (int i = lua_gettop(a_LuaState); i > 0; i--)
|
for (int i = lua_gettop(a_LuaState); i > 0; i--)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1321,7 +1321,9 @@ static int tolua_cPluginManager_ForEachCommand(lua_State * tolua_S)
|
||||||
private:
|
private:
|
||||||
virtual bool Command(const AString & a_Command, const cPlugin * a_Plugin, const AString & a_Permission, const AString & a_HelpString) override
|
virtual bool Command(const AString & a_Command, const cPlugin * a_Plugin, const AString & a_Permission, const AString & a_HelpString) override
|
||||||
{
|
{
|
||||||
lua_rawgeti( LuaState, LUA_REGISTRYINDEX, FuncRef); /* Push function reference */
|
UNUSED(a_Plugin);
|
||||||
|
|
||||||
|
lua_rawgeti(LuaState, LUA_REGISTRYINDEX, FuncRef); /* Push function reference */
|
||||||
tolua_pushcppstring(LuaState, a_Command);
|
tolua_pushcppstring(LuaState, a_Command);
|
||||||
tolua_pushcppstring(LuaState, a_Permission);
|
tolua_pushcppstring(LuaState, a_Permission);
|
||||||
tolua_pushcppstring(LuaState, a_HelpString);
|
tolua_pushcppstring(LuaState, a_HelpString);
|
||||||
|
@ -1396,7 +1398,10 @@ static int tolua_cPluginManager_ForEachConsoleCommand(lua_State * tolua_S)
|
||||||
private:
|
private:
|
||||||
virtual bool Command(const AString & a_Command, const cPlugin * a_Plugin, const AString & a_Permission, const AString & a_HelpString) override
|
virtual bool Command(const AString & a_Command, const cPlugin * a_Plugin, const AString & a_Permission, const AString & a_HelpString) override
|
||||||
{
|
{
|
||||||
lua_rawgeti( LuaState, LUA_REGISTRYINDEX, FuncRef); /* Push function reference */
|
UNUSED(a_Plugin);
|
||||||
|
UNUSED(a_Permission);
|
||||||
|
|
||||||
|
lua_rawgeti(LuaState, LUA_REGISTRYINDEX, FuncRef); /* Push function reference */
|
||||||
tolua_pushcppstring(LuaState, a_Command);
|
tolua_pushcppstring(LuaState, a_Command);
|
||||||
tolua_pushcppstring(LuaState, a_HelpString);
|
tolua_pushcppstring(LuaState, a_HelpString);
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength )
|
||||||
initialize(19650218UL);
|
initialize(19650218UL);
|
||||||
int i = 1;
|
int i = 1;
|
||||||
uint32 j = 0;
|
uint32 j = 0;
|
||||||
int k = ( N > seedLength ? N : seedLength );
|
int k = ( (uint32)N > seedLength ? (uint32)N : seedLength );
|
||||||
for( ; k; --k )
|
for( ; k; --k )
|
||||||
{
|
{
|
||||||
state[i] =
|
state[i] =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user