Cleanup for coding style

Add strict mode to check_style_guide script
This commit is contained in:
Alexander Bock
2017-11-08 10:35:39 -06:00
parent d94408224c
commit b50b52d351
387 changed files with 1907 additions and 2132 deletions

View File

@@ -79,7 +79,7 @@ void ScriptEngine::initializeLuaState(lua_State* state) {
LDEBUG("Create openspace base library");
lua_newtable(state);
lua_setglobal(state, OpenSpaceLibraryName.c_str());
LDEBUG("Add OpenSpace modules");
for (LuaLibrary& lib : _registeredLibraries) {
registerLuaLibrary(state, lib);
@@ -170,10 +170,10 @@ bool ScriptEngine::runScript(const std::string& script) {
LERRORC(e.component, e.message);
return false;
}
return true;
}
bool ScriptEngine::runScriptFile(const std::string& filename) {
if (filename.empty()) {
LWARNING("Filename was empty");
@@ -183,7 +183,7 @@ bool ScriptEngine::runScriptFile(const std::string& filename) {
LERROR("Script with name '" << filename << "' did not exist");
return false;
}
try {
ghoul::lua::runScriptFile(_state, filename);
}
@@ -195,7 +195,7 @@ bool ScriptEngine::runScriptFile(const std::string& filename) {
LERRORC(e.component, e.message);
return false;
}
return true;
}
@@ -208,7 +208,7 @@ bool ScriptEngine::runScriptFile(const std::string& filename) {
break;
}
}
std::vector<scripting::LuaLibrary::Function>::const_iterator funcit;
//library was found
if (libit != _registeredLibraries.cend()){
@@ -222,19 +222,19 @@ bool ScriptEngine::runScriptFile(const std::string& filename) {
}
}
}
return false;
}*/
/*void ScriptEngine::cacheScript(const std::string &library, const std::string &function, const std::string &script){
_cachedScriptsMutex.lock();
_cachedScripts[library][function] = script;
_cachedScriptsMutex.unlock();
}
std::vector<std::string> ScriptEngine::cachedScripts(){
_cachedScriptsMutex.lock();
std::vector<std::string> retVal;
std::map<std::string, std::map<std::string, std::string>>::const_iterator outerIt;
std::map<std::string, std::string>::const_iterator innerIt;
@@ -247,15 +247,15 @@ std::vector<std::string> ScriptEngine::cachedScripts(){
retVal.push_back(innerIt->second);
}
}
_cachedScriptsMutex.unlock();
return retVal;
}*/
/*
bool ScriptEngine::parseLibraryAndFunctionNames(std::string &library, std::string &function, const std::string &script){
//"deconstruct the script to find library and function name
//assuming a script looks like: "openspace.library.function()"
//or openspace.funcion()
@@ -264,7 +264,7 @@ bool ScriptEngine::parseLibraryAndFunctionNames(std::string &library, std::strin
function.clear();
//find first "."
std::size_t pos = script.find(".");
if (pos != std::string::npos){
//strip "openspace."
sub = script.substr(pos + 1, script.size());
@@ -402,7 +402,7 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library, bo
}
}
}
void ScriptEngine::addBaseLibrary() {
LuaLibrary lib = {
"",
@@ -517,7 +517,7 @@ LuaLibrary lib = {
};
addLibrary(lib);
}
void ScriptEngine::remapPrintFunction() {
//ghoul::lua::logStack(_state);
// lua_getglobal(_state, _luaGlobalNamespace.c_str());
@@ -754,7 +754,7 @@ void ScriptEngine::queueScript(const std::string &script, ScriptEngine::RemoteSc
if (script.empty()) {
return;
}
_mutex.lock();
_queuedScripts.insert(_queuedScripts.begin(), std::make_pair(script, remoteScripting));
_mutex.unlock();