VC6 doesn't seem to want to accept default parameter value for templated functions like this. Poor solution: just put in the default in the actual function call.

This commit is contained in:
Charles Lohr
2005-03-14 00:07:56 +00:00
parent a95cb42339
commit e8729a82d0
3 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -71,7 +71,7 @@ int LuaFunc_##func( lua_State *L ) { \
REQ_ARGS( #func, 1 ); \
REQ_ARG( #func, 1, string ); \
CString str; \
LuaHelpers::PopStack( str ); \
LuaHelpers::PopStack( str, NULL ); \
LUA_RETURN( call, L ); \
} \
LuaFunction( func ); /* register it */
@@ -83,8 +83,8 @@ int LuaFunc_##func( lua_State *L ) { \
REQ_ARG( #func, 2, string ); \
CString str1; \
CString str2; \
LuaHelpers::PopStack( str2 ); \
LuaHelpers::PopStack( str1 ); \
LuaHelpers::PopStack( str2, NULL ); \
LuaHelpers::PopStack( str1, NULL ); \
LUA_RETURN( call, L ); \
} \
LuaFunction( func ); /* register it */
+3 -3
View File
@@ -141,7 +141,7 @@ void LuaManager::SetGlobal( const CString &sName )
static int LuaPanic( lua_State *L )
{
CString sErr;
LuaHelpers::PopStack( sErr );
LuaHelpers::PopStack( sErr, NULL );
RageException::Throw( "%s", sErr.c_str() );
}
@@ -270,7 +270,7 @@ bool LuaManager::RunScript( const CString &sScript, const CString &sName, CStrin
if( ret )
{
LuaHelpers::PopStack( sError );
LuaHelpers::PopStack( sError, NULL );
return false;
}
}
@@ -280,7 +280,7 @@ bool LuaManager::RunScript( const CString &sScript, const CString &sName, CStrin
int ret = lua_pcall( L, 0, iReturnValues, 0 );
if( ret )
{
LuaHelpers::PopStack( sError );
LuaHelpers::PopStack( sError, NULL );
return false;
}
}
+1 -1
View File
@@ -861,7 +861,7 @@ int LuaFunc_GetPreference( lua_State *L )
REQ_ARG( "GetPreference", 1, string );
CString sName;
LuaHelpers::PopStack( sName );
LuaHelpers::PopStack( sName, NULL );
IPreference *pPref = PREFSMAN->GetPreferenceByName( sName );
if( pPref == NULL )