[Scummvm-cvs-logs] SF.net SVN: scummvm:[53236] scummvm/trunk/engines/sword25
sev at users.sourceforge.net
sev at users.sourceforge.net
Wed Oct 13 00:43:36 CEST 2010
Revision: 53236
http://scummvm.svn.sourceforge.net/scummvm/?rev=53236&view=rev
Author: sev
Date: 2010-10-12 22:43:36 +0000 (Tue, 12 Oct 2010)
Log Message:
-----------
SWORD25: Fix couple more warnings
Modified Paths:
--------------
scummvm/trunk/engines/sword25/kernel/common.h
scummvm/trunk/engines/sword25/kernel/kernel.cpp
scummvm/trunk/engines/sword25/package/packagemanager_script.cpp
scummvm/trunk/engines/sword25/script/lua_extensions.cpp
scummvm/trunk/engines/sword25/script/luabindhelper.cpp
scummvm/trunk/engines/sword25/script/luascript.cpp
scummvm/trunk/engines/sword25/sword25.cpp
Modified: scummvm/trunk/engines/sword25/kernel/common.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/common.h 2010-10-12 22:43:05 UTC (rev 53235)
+++ scummvm/trunk/engines/sword25/kernel/common.h 2010-10-12 22:43:36 UTC (rev 53236)
@@ -54,6 +54,8 @@
#include "sword25/kernel/memleaks.h"
#include "sword25/kernel/log.h"
+#include "common/debug.h"
+
#define BS_ASSERT(EXP) assert(EXP)
#endif
Modified: scummvm/trunk/engines/sword25/kernel/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/kernel.cpp 2010-10-12 22:43:05 UTC (rev 53235)
+++ scummvm/trunk/engines/sword25/kernel/kernel.cpp 2010-10-12 22:43:36 UTC (rev 53236)
@@ -180,12 +180,12 @@
for (unsigned int i = 0; i < BS_SERVICE_COUNT; i++)
if (BS_SERVICE_TABLE[i].SuperclassIdentifier == _Identifier &&
BS_SERVICE_TABLE[i].ServiceIdentifier == ServiceIdentifier) {
- BS_Service *NewService = BS_SERVICE_TABLE[i].CreateMethod(_pKernel);
+ BS_Service *NewService_ = BS_SERVICE_TABLE[i].CreateMethod(_pKernel);
- if (NewService) {
+ if (NewService_) {
DisconnectService();
BS_LOGLN("Service '%s' created from superclass '%s'.", ServiceIdentifier.c_str(), _Identifier.c_str());
- _ActiveService = NewService;
+ _ActiveService = NewService_;
_ActiveServiceName = BS_SERVICE_TABLE[i].ServiceIdentifier;
return _ActiveService;
} else {
Modified: scummvm/trunk/engines/sword25/package/packagemanager_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/package/packagemanager_script.cpp 2010-10-12 22:43:05 UTC (rev 53235)
+++ scummvm/trunk/engines/sword25/package/packagemanager_script.cpp 2010-10-12 22:43:36 UTC (rev 53236)
@@ -195,9 +195,9 @@
BS_PackageManager *pPM = GetPM();
unsigned int FileSize;
- void *FileData = pPM->GetFile(luaL_checkstring(L, 1), &FileSize);
+ char *FileData = (char *)pPM->GetFile(luaL_checkstring(L, 1), &FileSize);
if (FileData) {
- lua_pushlstring(L, static_cast<char *>(FileData), FileSize);
+ lua_pushlstring(L, FileData, FileSize);
delete FileData;
return 1;
Modified: scummvm/trunk/engines/sword25/script/lua_extensions.cpp
===================================================================
--- scummvm/trunk/engines/sword25/script/lua_extensions.cpp 2010-10-12 22:43:05 UTC (rev 53235)
+++ scummvm/trunk/engines/sword25/script/lua_extensions.cpp 2010-10-12 22:43:36 UTC (rev 53236)
@@ -66,8 +66,8 @@
// -----------------------------------------------------------------------------
static const luaL_reg GLOBAL_FUNCTIONS[] = {
- "warning", Warning,
- 0, 0,
+ {"warning", Warning},
+ {0, 0}
};
// -----------------------------------------------------------------------------
Modified: scummvm/trunk/engines/sword25/script/luabindhelper.cpp
===================================================================
--- scummvm/trunk/engines/sword25/script/luabindhelper.cpp 2010-10-12 22:43:05 UTC (rev 53235)
+++ scummvm/trunk/engines/sword25/script/luabindhelper.cpp 2010-10-12 22:43:36 UTC (rev 53236)
@@ -110,9 +110,7 @@
lua_gettable(L, LUA_GLOBALSINDEX);
RegisterPermanent(L, Functions->name);
}
- }
- // If the table name is not empty, the functions are added to the given table
- else {
+ } else { // If the table name is not empty, the functions are added to the given table
// Ensure that the library table exists
if (!_CreateTable(L, LibName)) return false;
@@ -329,11 +327,13 @@
while (PartBegin) {
const char *PartEnd = strchr(PartBegin, '.');
- if (!PartEnd) PartEnd = PartBegin + strlen(PartBegin);
+ if (!PartEnd)
+ PartEnd = PartBegin + strlen(PartBegin);
Common::String SubTableName(PartBegin, PartEnd - PartBegin);
// Tables with an empty string as the name are not allowed
- if (SubTableName.size() == 0) return false;
+ if (SubTableName.size() == 0)
+ return false;
// Verify that the table with the name already exists
// The first round will be searched in the global namespace, with later passages
@@ -344,7 +344,8 @@
} else {
lua_pushstring(L, SubTableName.c_str());
lua_gettable(L, -2);
- if (!lua_isnil(L, -1)) lua_remove(L, -2);
+ if (!lua_isnil(L, -1))
+ lua_remove(L, -2);
}
// If it doesn't exist, create table
Modified: scummvm/trunk/engines/sword25/script/luascript.cpp
===================================================================
--- scummvm/trunk/engines/sword25/script/luascript.cpp 2010-10-12 22:43:05 UTC (rev 53235)
+++ scummvm/trunk/engines/sword25/script/luascript.cpp 2010-10-12 22:43:36 UTC (rev 53236)
@@ -75,7 +75,8 @@
BS_LuaScriptEngine::~BS_LuaScriptEngine() {
// Lua de-initialisation
- if (m_State) lua_close(m_State);
+ if (m_State)
+ lua_close(m_State);
}
// -----------------------------------------------------------------------------
@@ -149,6 +150,7 @@
#ifdef DEBUG
int __startStackDepth = lua_gettop(m_State);
#endif
+ debug(0, "ExecuteFile(%s)", FileName.c_str());
// Get a pointer to the package manager
BS_PackageManager *pPackage = static_cast<BS_PackageManager *>(BS_Kernel::GetInstance()->GetService("package"));
@@ -219,6 +221,8 @@
// -----------------------------------------------------------------------------
bool BS_LuaScriptEngine::ExecuteBuffer(const char *Data, unsigned int Size, const Common::String &Name) const {
+ debug(0, "ExecuteBuffer()");
+
// Compile buffer
if (luaL_loadbuffer(m_State, Data, Size, Name.c_str()) != 0) {
BS_LOG_ERRORLN("Couldn't compile \"%s\":\n%s", Name.c_str(), lua_tostring(m_State, -1));
@@ -250,6 +254,8 @@
// -----------------------------------------------------------------------------
void BS_LuaScriptEngine::SetCommandLine(const Common::StringArray &CommandLineParameters) {
+ debug(0, "SetCommandLine()");
+
lua_newtable(m_State);
for (size_t i = 0; i < CommandLineParameters.size(); ++i) {
Modified: scummvm/trunk/engines/sword25/sword25.cpp
===================================================================
--- scummvm/trunk/engines/sword25/sword25.cpp 2010-10-12 22:43:05 UTC (rev 53235)
+++ scummvm/trunk/engines/sword25/sword25.cpp 2010-10-12 22:43:36 UTC (rev 53236)
@@ -90,7 +90,7 @@
if (format != g_system->getScreenFormat())
return Common::kUnsupportedColorMode;
- // Kernel initialisation
+ // Kernel initialization
if (!BS_Kernel::GetInstance()->GetInitSuccess()) {
BS_LOG_ERRORLN("Kernel initialization failed.");
return Common::kUnknownError;
@@ -105,15 +105,17 @@
// Packages laden oder das aktuelle Verzeichnis mounten, wenn das \xFCber Kommandozeile angefordert wurde.
if (find(CommandParameters.begin(), CommandParameters.end(), MOUNT_DIR_PARAMETER) != CommandParameters.end()) {
- if (!PackageManagerPtr->LoadDirectoryAsPackage(".", "/")) return Common::kUnknownError;
+ if (!PackageManagerPtr->LoadDirectoryAsPackage(".", "/"))
+ return Common::kUnknownError;
} else {
- if (!LoadPackages()) return Common::kUnknownError;
+ if (!LoadPackages())
+ return Common::kUnknownError;
}
// Einen Pointer auf den Skript-Engine holen.
BS_ScriptEngine *ScriptPtr = static_cast<BS_ScriptEngine *>(BS_Kernel::GetInstance()->GetService("script"));
if (!ScriptPtr) {
- BS_LOG_ERRORLN("Skript intialization failed.");
+ BS_LOG_ERRORLN("Script intialization failed.");
return Common::kUnknownError;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list