From 0f8c24e04d60aa1642a5fe7346941ccd7697977e Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 17 Jul 2014 22:26:53 +0100 Subject: Fixed issues relating to saplings and leaves - Removed cBlockInfo::RequiresSpecialTool * Fixes #1195 * Fixes #1201 --- src/Bindings/DeprecatedBindings.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/DeprecatedBindings.cpp b/src/Bindings/DeprecatedBindings.cpp index d51ba2da3..5bba1ea7a 100644 --- a/src/Bindings/DeprecatedBindings.cpp +++ b/src/Bindings/DeprecatedBindings.cpp @@ -175,32 +175,6 @@ static int tolua_get_AllToLua_g_BlockIsSnowable(lua_State* tolua_S) -/* get function: g_BlockRequiresSpecialTool */ -#ifndef TOLUA_DISABLE_tolua_get_AllToLua_g_BlockRequiresSpecialTool -static int tolua_get_AllToLua_g_BlockRequiresSpecialTool(lua_State* tolua_S) -{ - int BlockType; - #ifndef TOLUA_RELEASE - { - tolua_Error tolua_err; - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); - } - #endif - BlockType = (int)tolua_tonumber(tolua_S, 2, 0); - if ((BlockType < 0) || (BlockType > E_BLOCK_MAX_TYPE_ID)) - { - tolua_error(tolua_S, "array indexing out of range.", NULL); - } - tolua_pushboolean(tolua_S, cBlockInfo::RequiresSpecialTool((BLOCKTYPE)BlockType)); - return 1; -} -#endif //#ifndef TOLUA_DISABLE - - - - - /* get function: g_BlockIsSolid */ #ifndef TOLUA_DISABLE_tolua_get_AllToLua_g_BlockIsSolid static int tolua_get_AllToLua_g_BlockIsSolid(lua_State* tolua_S) @@ -263,7 +237,6 @@ void DeprecatedBindings::Bind(lua_State * tolua_S) tolua_array(tolua_S, "g_BlockOneHitDig", tolua_get_AllToLua_g_BlockOneHitDig, NULL); tolua_array(tolua_S, "g_BlockPistonBreakable", tolua_get_AllToLua_g_BlockPistonBreakable, NULL); tolua_array(tolua_S, "g_BlockIsSnowable", tolua_get_AllToLua_g_BlockIsSnowable, NULL); - tolua_array(tolua_S, "g_BlockRequiresSpecialTool", tolua_get_AllToLua_g_BlockRequiresSpecialTool, NULL); tolua_array(tolua_S, "g_BlockIsSolid", tolua_get_AllToLua_g_BlockIsSolid, NULL); tolua_array(tolua_S, "g_BlockFullyOccupiesVoxel", tolua_get_AllToLua_g_BlockFullyOccupiesVoxel, NULL); -- cgit v1.2.3 From 84fef3c1569b941e747c471b06b290876baa131e Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 18 Jul 2014 14:08:49 -0700 Subject: src/CMakeLists.txt: Replaced glob with list of files On MSVC, CMake will traverse all the CMakeLists and add their source and header files to one conglomerate SOURCE list. --- src/Bindings/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/Bindings/CMakeLists.txt (limited to 'src/Bindings') diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt new file mode 100644 index 000000000..fd6223469 --- /dev/null +++ b/src/Bindings/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required (VERSION 2.6) +project (MCServer) + +include_directories ("${PROJECT_SOURCE_DIR}/../") + +SET (SRCS + Bindings.cpp + DeprecatedBindings.cpp + LuaChunkStay.cpp + LuaState.cpp + LuaWindow.cpp + ManualBindings.cpp + Plugin.cpp + PluginLua.cpp + PluginManager.cpp + WebPlugin.cpp +) + +SET (HDRS + Bindings.h + DeprecatedBindings.h + LuaChunkStay.h + LuaFunctions.h + LuaState.h + LuaWindow.h + ManualBindings.h + Plugin.h + PluginLua.h + PluginManager.h + WebPlugin.h + tolua++.h +) -- cgit v1.2.3 From 832530469360020d5cc1bd0a4142c3450d4cd8f9 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 18 Jul 2014 15:27:50 -0700 Subject: CMake: Add Bindings library from subdirectory --- src/Bindings/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Bindings') diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt index fd6223469..da6a6919a 100644 --- a/src/Bindings/CMakeLists.txt +++ b/src/Bindings/CMakeLists.txt @@ -30,3 +30,9 @@ SET (HDRS WebPlugin.h tolua++.h ) + +if(NOT MSVC) + add_library(Bindings ${SRCS} ${HDRS}) + + target_link_libraries(Bindings lua sqlite tolualib polarssl) +endif() -- cgit v1.2.3 From 135dc333c131a9bde32609351e2b495c80b49f53 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 18 Jul 2014 16:04:07 -0700 Subject: CMakeLists: Moved Bindings-specific code to subdir --- src/Bindings/CMakeLists.txt | 111 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) (limited to 'src/Bindings') diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt index da6a6919a..723487ff0 100644 --- a/src/Bindings/CMakeLists.txt +++ b/src/Bindings/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 2.6) project (MCServer) include_directories ("${PROJECT_SOURCE_DIR}/../") +include_directories (".") SET (SRCS Bindings.cpp @@ -31,6 +32,116 @@ SET (HDRS tolua++.h ) +# List all the files that are generated as part of the Bindings build process +set (BINDING_OUTPUTS + ${CMAKE_CURRENT_SOURCE_DIR}/Bindings.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Bindings.h + ${CMAKE_CURRENT_SOURCE_DIR}/LuaState_Call.inc +) + +set(BINDING_DEPENDECIES + tolua + ../Bindings/virtual_method_hooks.lua + ../Bindings/AllToLua.pkg + ../Bindings/gen_LuaState_Call.lua + ../Bindings/LuaFunctions.h + ../Bindings/LuaState_Call.inc + ../Bindings/LuaWindow.h + ../Bindings/Plugin.h + ../Bindings/PluginLua.h + ../Bindings/PluginManager.h + ../Bindings/WebPlugin.h + ../BiomeDef.h + ../BlockArea.h + ../BlockEntities/BlockEntity.h + ../BlockEntities/BlockEntityWithItems.h + ../BlockEntities/ChestEntity.h + ../BlockEntities/DispenserEntity.h + ../BlockEntities/DropSpenserEntity.h + ../BlockEntities/DropperEntity.h + ../BlockEntities/FurnaceEntity.h + ../BlockEntities/HopperEntity.h + ../BlockEntities/JukeboxEntity.h + ../BlockEntities/NoteEntity.h + ../BlockEntities/SignEntity.h + ../BlockEntities/MobHeadEntity.h + ../BlockEntities/FlowerPotEntity.h + ../BlockID.h + ../BoundingBox.h + ../ChatColor.h + ../ChunkDef.h + ../ClientHandle.h + ../CraftingRecipes.h + ../Cuboid.h + ../Defines.h + ../Enchantments.h + ../Entities/EntityEffect.h + ../Entities/Entity.h + ../Entities/Floater.h + ../Entities/Pawn.h + ../Entities/Painting.h + ../Entities/Pickup.h + ../Entities/Player.h + ../Entities/ProjectileEntity.h + ../Entities/ArrowEntity.h + ../Entities/ThrownEggEntity.h + ../Entities/ThrownEnderPearlEntity.h + ../Entities/ExpBottleEntity.h + ../Entities/ThrownSnowballEntity.h + ../Entities/FireChargeEntity.h + ../Entities/FireworkEntity.h + ../Entities/GhastFireballEntity.h + ../Entities/TNTEntity.h + ../Entities/ExpOrb.h + ../Entities/HangingEntity.h + ../Entities/ItemFrame.h + ../Generating/ChunkDesc.h + ../Group.h + ../Inventory.h + ../Item.h + ../ItemGrid.h + ../Mobs/Monster.h + ../OSSupport/File.h + ../Root.h + ../Server.h + ../StringUtils.h + ../Tracer.h + ../UI/Window.h + ../Vector3.h + ../WebAdmin.h + ../World.h +) + +if (WIN32) + ADD_CUSTOM_COMMAND( + OUTPUT ${BINDING_OUTPUTS} + + # Copy the Lua DLL into the Bindings folder, so that tolua can run from there: + COMMAND ${CMAKE_COMMAND} -E copy_if_different ../../MCServer/lua51.dll ./lua51.dll + + # Regenerate bindings: + COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + + # add any new generation dependencies here + DEPENDS ${BINDING_DEPENDECIES} + ) +else () + ADD_CUSTOM_COMMAND( + # add any new generated bindings here + OUTPUT ${BINDING_OUTPUTS} + + # Regenerate bindings: + COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + + # add any new generation dependencies here + DEPENDS ${BINDING_DEPENDECIES} + ) +endif () +set_source_files_properties(Bindings/Bindings.cpp PROPERTIES GENERATED TRUE) +set_source_files_properties(Bindings/Bindings.h PROPERTIES GENERATED TRUE) + if(NOT MSVC) add_library(Bindings ${SRCS} ${HDRS}) -- cgit v1.2.3 From 0960e6ae8ffe329ecd78b2f0f433fcb9e817a696 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 18 Jul 2014 19:25:15 -0700 Subject: Moved Windows custom command to src/CMakeLists.txt --- src/Bindings/CMakeLists.txt | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt index 723487ff0..4726eea23 100644 --- a/src/Bindings/CMakeLists.txt +++ b/src/Bindings/CMakeLists.txt @@ -112,21 +112,7 @@ set(BINDING_DEPENDECIES ../World.h ) -if (WIN32) - ADD_CUSTOM_COMMAND( - OUTPUT ${BINDING_OUTPUTS} - - # Copy the Lua DLL into the Bindings folder, so that tolua can run from there: - COMMAND ${CMAKE_COMMAND} -E copy_if_different ../../MCServer/lua51.dll ./lua51.dll - - # Regenerate bindings: - COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - - # add any new generation dependencies here - DEPENDS ${BINDING_DEPENDECIES} - ) -else () +if (NOT WIN32) ADD_CUSTOM_COMMAND( # add any new generated bindings here OUTPUT ${BINDING_OUTPUTS} -- cgit v1.2.3 From c7b7938c04eb5bd801274f93465afdb2f63053c0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 19 Jul 2014 09:57:03 +0200 Subject: Renamed AllToLua_lua script. Fixes #1222. --- src/Bindings/AllToLua_lua.bat | 27 +++++++++++++++++++++++++++ src/Bindings/AllToLua_lua.bat.bat | 27 --------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 src/Bindings/AllToLua_lua.bat delete mode 100644 src/Bindings/AllToLua_lua.bat.bat (limited to 'src/Bindings') diff --git a/src/Bindings/AllToLua_lua.bat b/src/Bindings/AllToLua_lua.bat new file mode 100644 index 000000000..81c738f32 --- /dev/null +++ b/src/Bindings/AllToLua_lua.bat @@ -0,0 +1,27 @@ + +:: AllToLua_Lua.bat +:: This scripts updates the automatically-generates Lua bindings in Bindings.cpp / Bindings.h +:: When called without any parameters, it will pause for a keypress at the end +:: Call with any parameter to disable the wait (for buildserver use) +:: This script assumes "lua" executable to be in PATH, it uses a pure-lua implementation of the ToLua processor + +@echo off + + + + + +:: Regenerate the files: +echo Regenerating LUA bindings . . . +lua ..\..\lib\tolua++\src\bin\lua\_driver.lua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg + + + + +: Wait for keypress, if no param given: +echo. +if %ALLTOLUA_WAIT%N == N pause + + + + diff --git a/src/Bindings/AllToLua_lua.bat.bat b/src/Bindings/AllToLua_lua.bat.bat deleted file mode 100644 index 81c738f32..000000000 --- a/src/Bindings/AllToLua_lua.bat.bat +++ /dev/null @@ -1,27 +0,0 @@ - -:: AllToLua_Lua.bat -:: This scripts updates the automatically-generates Lua bindings in Bindings.cpp / Bindings.h -:: When called without any parameters, it will pause for a keypress at the end -:: Call with any parameter to disable the wait (for buildserver use) -:: This script assumes "lua" executable to be in PATH, it uses a pure-lua implementation of the ToLua processor - -@echo off - - - - - -:: Regenerate the files: -echo Regenerating LUA bindings . . . -lua ..\..\lib\tolua++\src\bin\lua\_driver.lua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg - - - - -: Wait for keypress, if no param given: -echo. -if %ALLTOLUA_WAIT%N == N pause - - - - -- cgit v1.2.3 From 9e7958e7fbb5a2477e04d30724730e15335b969f Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 19 Jul 2014 13:22:16 +0200 Subject: Fixed MSVC bindings generation. --- src/Bindings/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Bindings') diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt index 4726eea23..95b858f5d 100644 --- a/src/Bindings/CMakeLists.txt +++ b/src/Bindings/CMakeLists.txt @@ -112,7 +112,7 @@ set(BINDING_DEPENDECIES ../World.h ) -if (NOT WIN32) +if (NOT MSVC) ADD_CUSTOM_COMMAND( # add any new generated bindings here OUTPUT ${BINDING_OUTPUTS} -- cgit v1.2.3 From 00c524519ef6c7ceaf4ac91307617cfd65d7cf21 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 19 Jul 2014 14:53:41 +0200 Subject: Fixed style: spaces after commas. --- src/Bindings/DeprecatedBindings.cpp | 38 ++++++++++++++++++------------------- src/Bindings/LuaState.cpp | 3 +-- src/Bindings/ManualBindings.cpp | 26 ++++++++++++------------- 3 files changed, 33 insertions(+), 34 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/DeprecatedBindings.cpp b/src/Bindings/DeprecatedBindings.cpp index d2e60945d..07b1a29fd 100644 --- a/src/Bindings/DeprecatedBindings.cpp +++ b/src/Bindings/DeprecatedBindings.cpp @@ -25,9 +25,9 @@ static int tolua_get_AllToLua_g_BlockLightValue(lua_State* tolua_S) #ifndef TOLUA_RELEASE { tolua_Error tolua_err; - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) + if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) { - tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); + tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err); } } #endif @@ -36,7 +36,7 @@ static int tolua_get_AllToLua_g_BlockLightValue(lua_State* tolua_S) { tolua_error(tolua_S, "array indexing out of range.", NULL); } - tolua_pushnumber(tolua_S,(lua_Number)cBlockInfo::GetLightValue((BLOCKTYPE)BlockType)); + tolua_pushnumber(tolua_S, (lua_Number)cBlockInfo::GetLightValue((BLOCKTYPE)BlockType)); return 1; } #endif // #ifndef TOLUA_DISABLE @@ -53,8 +53,8 @@ static int tolua_get_AllToLua_g_BlockSpreadLightFalloff(lua_State* tolua_S) #ifndef TOLUA_RELEASE { tolua_Error tolua_err; - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); + if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) + tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err); } #endif BlockType = (int)tolua_tonumber(tolua_S, 2, 0); @@ -79,8 +79,8 @@ static int tolua_get_AllToLua_g_BlockTransparent(lua_State* tolua_S) #ifndef TOLUA_RELEASE { tolua_Error tolua_err; - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); + if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) + tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err); } #endif BlockType = (int)tolua_tonumber(tolua_S, 2, 0); @@ -105,8 +105,8 @@ static int tolua_get_AllToLua_g_BlockOneHitDig(lua_State* tolua_S) #ifndef TOLUA_RELEASE { tolua_Error tolua_err; - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); + if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) + tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err); } #endif BlockType = (int)tolua_tonumber(tolua_S, 2, 0); @@ -131,8 +131,8 @@ static int tolua_get_AllToLua_g_BlockPistonBreakable(lua_State* tolua_S) #ifndef TOLUA_RELEASE { tolua_Error tolua_err; - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); + if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) + tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err); } #endif BlockType = (int)tolua_tonumber(tolua_S, 2, 0); @@ -157,8 +157,8 @@ static int tolua_get_AllToLua_g_BlockIsSnowable(lua_State* tolua_S) #ifndef TOLUA_RELEASE { tolua_Error tolua_err; - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); + if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) + tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err); } #endif BlockType = (int)tolua_tonumber(tolua_S, 2, 0); @@ -183,8 +183,8 @@ static int tolua_get_AllToLua_g_BlockRequiresSpecialTool(lua_State* tolua_S) #ifndef TOLUA_RELEASE { tolua_Error tolua_err; - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); + if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) + tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err); } #endif BlockType = (int)tolua_tonumber(tolua_S, 2, 0); @@ -209,8 +209,8 @@ static int tolua_get_AllToLua_g_BlockIsSolid(lua_State* tolua_S) #ifndef TOLUA_RELEASE { tolua_Error tolua_err; - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); + if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) + tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err); } #endif BlockType = (int)tolua_tonumber(tolua_S, 2, 0); @@ -235,8 +235,8 @@ static int tolua_get_AllToLua_g_BlockFullyOccupiesVoxel(lua_State* tolua_S) #ifndef TOLUA_RELEASE { tolua_Error tolua_err; - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); + if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) + tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err); } #endif BlockType = (int)tolua_tonumber(tolua_S, 2, 0); diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index 7d918cf2b..e123a87c9 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -1336,9 +1336,8 @@ 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 - // Format string consisting only of %s is used to appease the compiler - LOGD("%s",(a_Header != NULL) ? a_Header : "Lua C API Stack contents:"); + LOGD("%s", (a_Header != NULL) ? a_Header : "Lua C API Stack contents:"); for (int i = lua_gettop(a_LuaState); i > 0; i--) { AString Value; diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 530101d47..4047adc3a 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -958,7 +958,7 @@ tolua_lerror: static int tolua_cWorld_TryGetHeight(lua_State * tolua_S) { // Exported manually, because tolua would require the out-only param a_Height to be used when calling - // Takes (a_World,) a_BlockX, a_BlockZ + // Takes a_World, a_BlockX, a_BlockZ // Returns Height, IsValid #ifndef TOLUA_RELEASE tolua_Error tolua_err; @@ -1926,12 +1926,12 @@ static int tolua_cPluginLua_AddWebTab(lua_State * tolua_S) int Reference = LUA_REFNIL; if ( - tolua_isstring(tolua_S, 2, 0, &tolua_err ) && - lua_isfunction(tolua_S, 3 ) + tolua_isstring(tolua_S, 2, 0, &tolua_err) && + lua_isfunction(tolua_S, 3) ) { Reference = luaL_ref(tolua_S, LUA_REGISTRYINDEX); - Title = ((std::string) tolua_tocppstring(tolua_S,2,0)); + Title = ((std::string)tolua_tocppstring(tolua_S, 2, 0)); } else { @@ -2591,7 +2591,7 @@ static int tolua_cBlockArea_LoadFromSchematicFile(lua_State * tolua_S) } AString Filename = tolua_tostring(tolua_S, 2, 0); - bool res = cSchematicFileSerializer::LoadFromSchematicFile(*self,Filename); + bool res = cSchematicFileSerializer::LoadFromSchematicFile(*self, Filename); tolua_pushboolean(tolua_S, res); return 1; } @@ -2651,7 +2651,7 @@ static int tolua_cBlockArea_SaveToSchematicFile(lua_State * tolua_S) return 0; } AString Filename = tolua_tostring(tolua_S, 2, 0); - bool res = cSchematicFileSerializer::SaveToSchematicFile(*self,Filename); + bool res = cSchematicFileSerializer::SaveToSchematicFile(*self, Filename); tolua_pushboolean(tolua_S, res); return 1; } @@ -3065,13 +3065,13 @@ void ManualBindings::Bind(lua_State * tolua_S) tolua_function(tolua_S, "AddWebTab", tolua_cPluginLua_AddWebTab); tolua_endmodule(tolua_S); - tolua_cclass(tolua_S,"HTTPRequest","HTTPRequest","",NULL); - tolua_beginmodule(tolua_S,"HTTPRequest"); - // tolua_variable(tolua_S,"Method",tolua_get_HTTPRequest_Method,tolua_set_HTTPRequest_Method); - // tolua_variable(tolua_S,"Path",tolua_get_HTTPRequest_Path,tolua_set_HTTPRequest_Path); - tolua_variable(tolua_S,"FormData",tolua_get_HTTPRequest_FormData,0); - tolua_variable(tolua_S,"Params",tolua_get_HTTPRequest_Params,0); - tolua_variable(tolua_S,"PostParams",tolua_get_HTTPRequest_PostParams,0); + tolua_cclass(tolua_S, "HTTPRequest", "HTTPRequest", "", NULL); + tolua_beginmodule(tolua_S, "HTTPRequest"); + // tolua_variable(tolua_S, "Method", tolua_get_HTTPRequest_Method, tolua_set_HTTPRequest_Method); + // tolua_variable(tolua_S, "Path", tolua_get_HTTPRequest_Path, tolua_set_HTTPRequest_Path); + tolua_variable(tolua_S, "FormData", tolua_get_HTTPRequest_FormData, 0); + tolua_variable(tolua_S, "Params", tolua_get_HTTPRequest_Params, 0); + tolua_variable(tolua_S, "PostParams", tolua_get_HTTPRequest_PostParams, 0); tolua_endmodule(tolua_S); tolua_beginmodule(tolua_S, "cWebAdmin"); -- cgit v1.2.3 From 6be79575fd50e37ac275bd0cb9d16f9e51e8a225 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 20 Jul 2014 23:10:31 +0200 Subject: Style: Normalized spaces after if, for and while. --- src/Bindings/ManualBindings.cpp | 22 +++++++++++----------- src/Bindings/PluginManager.cpp | 2 +- src/Bindings/WebPlugin.cpp | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 4047adc3a..5e9e7349d 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -656,12 +656,12 @@ template< static int tolua_ForEach(lua_State * tolua_S) { int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */ - if( NumArgs != 1 && NumArgs != 2) + if ((NumArgs != 1) && (NumArgs != 2)) { return lua_do_error(tolua_S, "Error in function call '#funcname#': Requires 1 or 2 arguments, got %i", NumArgs); } - Ty1 * self = (Ty1 *) tolua_tousertype(tolua_S, 1, NULL); + Ty1 * self = (Ty1 *)tolua_tousertype(tolua_S, 1, NULL); if (self == NULL) { return lua_do_error(tolua_S, "Error in function call '#funcname#': Not called on an object instance"); @@ -1360,7 +1360,7 @@ static int tolua_cPluginManager_AddHook(lua_State * tolua_S) static int tolua_cPluginManager_ForEachCommand(lua_State * tolua_S) { int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */ - if( NumArgs != 1) + if (NumArgs != 1) { LOGWARN("Error in function call 'ForEachCommand': Requires 1 argument, got %i", NumArgs); return 0; @@ -1437,7 +1437,7 @@ static int tolua_cPluginManager_ForEachCommand(lua_State * tolua_S) static int tolua_cPluginManager_ForEachConsoleCommand(lua_State * tolua_S) { int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */ - if( NumArgs != 1) + if (NumArgs != 1) { LOGWARN("Error in function call 'ForEachConsoleCommand': Requires 1 argument, got %i", NumArgs); return 0; @@ -1938,16 +1938,16 @@ static int tolua_cPluginLua_AddWebTab(lua_State * tolua_S) return tolua_do_error(tolua_S, "#ferror calling function '#funcname#'", &tolua_err); } - if( Reference != LUA_REFNIL ) + if (Reference != LUA_REFNIL) { - if( !self->AddWebTab( Title.c_str(), tolua_S, Reference ) ) + if (!self->AddWebTab(Title.c_str(), tolua_S, Reference)) { - luaL_unref( tolua_S, LUA_REGISTRYINDEX, Reference ); + luaL_unref(tolua_S, LUA_REGISTRYINDEX, Reference); } } else { - LOGERROR("ERROR: cPluginLua:AddWebTab invalid function reference in 2nd argument (Title: \"%s\")", Title.c_str() ); + LOGWARNING("cPluginLua:AddWebTab: invalid function reference in 2nd argument (Title: \"%s\")", Title.c_str()); } return 0; @@ -2016,7 +2016,7 @@ static int tolua_push_StringStringMap(lua_State* tolua_S, std::map< std::string, lua_newtable(tolua_S); int top = lua_gettop(tolua_S); - for( std::map< std::string, std::string >::iterator it = a_StringStringMap.begin(); it != a_StringStringMap.end(); ++it ) + for (std::map::iterator it = a_StringStringMap.begin(); it != a_StringStringMap.end(); ++it) { const char* key = it->first.c_str(); const char* value = it->second.c_str(); @@ -2060,7 +2060,7 @@ static int tolua_get_HTTPRequest_FormData(lua_State* tolua_S) lua_newtable(tolua_S); int top = lua_gettop(tolua_S); - for( std::map< std::string, HTTPFormData >::iterator it = FormData.begin(); it != FormData.end(); ++it ) + for (std::map::iterator it = FormData.begin(); it != FormData.end(); ++it) { lua_pushstring(tolua_S, it->first.c_str() ); tolua_pushusertype(tolua_S, &(it->second), "HTTPFormData" ); @@ -2109,7 +2109,7 @@ static int tolua_cWebPlugin_GetTabNames(lua_State * tolua_S) lua_newtable(tolua_S); int index = 1; cWebPlugin::TabNameList::const_iterator iter = TabNames.begin(); - while(iter != TabNames.end()) + while (iter != TabNames.end()) { const AString & FancyName = iter->first; const AString & WebName = iter->second; diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp index 2c0ce701b..33ecb95ad 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -1434,7 +1434,7 @@ cPluginManager::CommandResult cPluginManager::HandleCommand(cPlayer * a_Player, cPlugin * cPluginManager::GetPlugin( const AString & a_Plugin ) const { - for( PluginMap::const_iterator itr = m_Plugins.begin(); itr != m_Plugins.end(); ++itr ) + for (PluginMap::const_iterator itr = m_Plugins.begin(); itr != m_Plugins.end(); ++itr) { if (itr->second == NULL ) continue; if (itr->second->GetName().compare(a_Plugin) == 0) diff --git a/src/Bindings/WebPlugin.cpp b/src/Bindings/WebPlugin.cpp index 57ed9f6a4..a22826d1b 100644 --- a/src/Bindings/WebPlugin.cpp +++ b/src/Bindings/WebPlugin.cpp @@ -45,7 +45,7 @@ cWebPlugin::~cWebPlugin() std::list > cWebPlugin::GetTabNames(void) { std::list< std::pair< AString, AString > > NameList; - for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) + for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) { std::pair< AString, AString > StringPair; StringPair.first = (*itr)->Title; @@ -69,7 +69,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest sWebPluginTab * Tab = NULL; if (Split.size() > 2) // If we got the tab name, show that page { - for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) + for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) { if ((*itr)->SafeTitle.compare(Split[2]) == 0) // This is the one! { @@ -80,7 +80,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest } else // Otherwise show the first tab { - if( GetTabs().size() > 0 ) + if (GetTabs().size() > 0 ) Tab = *GetTabs().begin(); } @@ -100,10 +100,10 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest AString cWebPlugin::SafeString(const AString & a_String) { AString RetVal; - for( unsigned int i = 0; i < a_String.size(); ++i ) + for (unsigned int i = 0; i < a_String.size(); ++i ) { char c = a_String[i]; - if( c == ' ' ) + if (c == ' ' ) { c = '_'; } -- cgit v1.2.3 From 93d29555e58df172bafba530afbc593c16ec66a3 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 21 Jul 2014 15:19:48 +0200 Subject: Style: Normalized to no spaces before closing parenthesis. --- src/Bindings/DeprecatedBindings.h | 2 +- src/Bindings/LuaFunctions.h | 2 +- src/Bindings/ManualBindings.cpp | 60 +++++++++++++++++++-------------------- src/Bindings/ManualBindings.h | 2 +- src/Bindings/Plugin.h | 4 +-- src/Bindings/PluginLua.cpp | 2 +- src/Bindings/PluginLua.h | 2 +- src/Bindings/PluginManager.cpp | 6 ++-- src/Bindings/PluginManager.h | 2 +- src/Bindings/WebPlugin.cpp | 14 ++++----- src/Bindings/WebPlugin.h | 6 ++-- 11 files changed, 51 insertions(+), 51 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/DeprecatedBindings.h b/src/Bindings/DeprecatedBindings.h index 5fc3cfa80..037d50489 100644 --- a/src/Bindings/DeprecatedBindings.h +++ b/src/Bindings/DeprecatedBindings.h @@ -4,5 +4,5 @@ struct lua_State; class DeprecatedBindings { public: - static void Bind( lua_State* tolua_S ); + static void Bind( lua_State* tolua_S); }; diff --git a/src/Bindings/LuaFunctions.h b/src/Bindings/LuaFunctions.h index 629e2d77d..2ea37d7a4 100644 --- a/src/Bindings/LuaFunctions.h +++ b/src/Bindings/LuaFunctions.h @@ -9,7 +9,7 @@ inline unsigned int GetTime() return (unsigned int)time(0); } -inline std::string GetChar( std::string & a_Str, unsigned int a_Idx ) +inline std::string GetChar( std::string & a_Str, unsigned int a_Idx) { return std::string(1, a_Str[ a_Idx ]); } diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 5e9e7349d..df9687fc0 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -319,9 +319,9 @@ static int tolua_DoWith(lua_State* tolua_S) { public: cLuaCallback(lua_State* a_LuaState, int a_FuncRef, int a_TableRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) - , TableRef( a_TableRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) + , TableRef( a_TableRef) {} private: @@ -358,7 +358,7 @@ static int tolua_DoWith(lua_State* tolua_S) luaL_unref(tolua_S, LUA_REGISTRYINDEX, FuncRef); /* Push return value on stack */ - tolua_pushboolean(tolua_S, bRetVal ); + tolua_pushboolean(tolua_S, bRetVal); return 1; } @@ -448,7 +448,7 @@ static int tolua_DoWithID(lua_State* tolua_S) luaL_unref(tolua_S, LUA_REGISTRYINDEX, FuncRef); /* Push return value on stack */ - tolua_pushboolean(tolua_S, bRetVal ); + tolua_pushboolean(tolua_S, bRetVal); return 1; } @@ -478,7 +478,7 @@ static int tolua_DoWithXYZ(lua_State* tolua_S) int ItemX = ((int)tolua_tonumber(tolua_S, 2, 0)); int ItemY = ((int)tolua_tonumber(tolua_S, 3, 0)); int ItemZ = ((int)tolua_tonumber(tolua_S, 4, 0)); - LOG("x %i y %i z %i", ItemX, ItemY, ItemZ ); + LOG("x %i y %i z %i", ItemX, ItemY, ItemZ); if (!lua_isfunction( tolua_S, 5)) { return lua_do_error(tolua_S, "Error in function call '#funcname#': Expected a function for parameter #4"); @@ -506,9 +506,9 @@ static int tolua_DoWithXYZ(lua_State* tolua_S) { public: cLuaCallback(lua_State* a_LuaState, int a_FuncRef, int a_TableRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) - , TableRef( a_TableRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) + , TableRef( a_TableRef) {} private: @@ -544,7 +544,7 @@ static int tolua_DoWithXYZ(lua_State* tolua_S) luaL_unref(tolua_S, LUA_REGISTRYINDEX, FuncRef); /* Push return value on stack */ - tolua_pushboolean(tolua_S, bRetVal ); + tolua_pushboolean(tolua_S, bRetVal); return 1; } @@ -601,9 +601,9 @@ static int tolua_ForEachInChunk(lua_State * tolua_S) { public: cLuaCallback(lua_State* a_LuaState, int a_FuncRef, int a_TableRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) - , TableRef( a_TableRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) + , TableRef( a_TableRef) {} private: @@ -640,7 +640,7 @@ static int tolua_ForEachInChunk(lua_State * tolua_S) luaL_unref(tolua_S, LUA_REGISTRYINDEX, FuncRef); /* Push return value on stack */ - tolua_pushboolean(tolua_S, bRetVal ); + tolua_pushboolean(tolua_S, bRetVal); return 1; } @@ -694,16 +694,16 @@ static int tolua_ForEach(lua_State * tolua_S) { public: cLuaCallback(lua_State* a_LuaState, int a_FuncRef, int a_TableRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) - , TableRef( a_TableRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) + , TableRef( a_TableRef) {} private: virtual bool Item(Ty2 * a_Item) override { lua_rawgeti( LuaState, LUA_REGISTRYINDEX, FuncRef); /* Push function reference */ - tolua_pushusertype( LuaState, a_Item, Ty2::GetClassStatic() ); + tolua_pushusertype( LuaState, a_Item, Ty2::GetClassStatic()); if (TableRef != LUA_REFNIL) { lua_rawgeti( LuaState, LUA_REGISTRYINDEX, TableRef); /* Push table reference */ @@ -733,7 +733,7 @@ static int tolua_ForEach(lua_State * tolua_S) luaL_unref(tolua_S, LUA_REGISTRYINDEX, FuncRef); /* Push return value on stack */ - tolua_pushboolean(tolua_S, bRetVal ); + tolua_pushboolean(tolua_S, bRetVal); return 1; } @@ -1390,8 +1390,8 @@ static int tolua_cPluginManager_ForEachCommand(lua_State * tolua_S) { public: cLuaCallback(lua_State * a_LuaState, int a_FuncRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) {} private: @@ -1467,8 +1467,8 @@ static int tolua_cPluginManager_ForEachConsoleCommand(lua_State * tolua_S) { public: cLuaCallback(lua_State * a_LuaState, int a_FuncRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) {} private: @@ -1963,7 +1963,7 @@ static int tolua_cPluginLua_AddTab(lua_State* tolua_S) LOGWARN("WARNING: Using deprecated function AddTab()! Use AddWebTab() instead. (plugin \"%s\" in folder \"%s\")", self->GetName().c_str(), self->GetDirectory().c_str() ); - return tolua_cPluginLua_AddWebTab( tolua_S ); + return tolua_cPluginLua_AddWebTab( tolua_S); } @@ -2011,7 +2011,7 @@ static int tolua_md5(lua_State* tolua_S) -static int tolua_push_StringStringMap(lua_State* tolua_S, std::map< std::string, std::string >& a_StringStringMap ) +static int tolua_push_StringStringMap(lua_State* tolua_S, std::map< std::string, std::string >& a_StringStringMap) { lua_newtable(tolua_S); int top = lua_gettop(tolua_S); @@ -2062,9 +2062,9 @@ static int tolua_get_HTTPRequest_FormData(lua_State* tolua_S) for (std::map::iterator it = FormData.begin(); it != FormData.end(); ++it) { - lua_pushstring(tolua_S, it->first.c_str() ); - tolua_pushusertype(tolua_S, &(it->second), "HTTPFormData" ); - // lua_pushlstring(tolua_S, it->second.Value.c_str(), it->second.Value.size() ); // Might contain binary data + lua_pushstring(tolua_S, it->first.c_str()); + tolua_pushusertype(tolua_S, &(it->second), "HTTPFormData"); + // lua_pushlstring(tolua_S, it->second.Value.c_str(), it->second.Value.size()); // Might contain binary data lua_settable(tolua_S, top); } @@ -2113,8 +2113,8 @@ static int tolua_cWebPlugin_GetTabNames(lua_State * tolua_S) { const AString & FancyName = iter->first; const AString & WebName = iter->second; - tolua_pushstring( tolua_S, WebName.c_str() ); // Because the WebName is supposed to be unique, use it as key - tolua_pushstring( tolua_S, FancyName.c_str() ); + tolua_pushstring( tolua_S, WebName.c_str()); // Because the WebName is supposed to be unique, use it as key + tolua_pushstring( tolua_S, FancyName.c_str()); // lua_rawset(tolua_S, -3); ++iter; diff --git a/src/Bindings/ManualBindings.h b/src/Bindings/ManualBindings.h index f38e26267..36161c6a2 100644 --- a/src/Bindings/ManualBindings.h +++ b/src/Bindings/ManualBindings.h @@ -4,5 +4,5 @@ struct lua_State; class ManualBindings { public: - static void Bind( lua_State* tolua_S ); + static void Bind( lua_State* tolua_S); }; diff --git a/src/Bindings/Plugin.h b/src/Bindings/Plugin.h index fc8aa1cdb..3882b7474 100644 --- a/src/Bindings/Plugin.h +++ b/src/Bindings/Plugin.h @@ -33,7 +33,7 @@ class cPlugin public: // tolua_end - cPlugin( const AString & a_PluginDirectory ); + cPlugin( const AString & a_PluginDirectory); virtual ~cPlugin(); virtual void OnDisable(void) {} @@ -141,7 +141,7 @@ public: E_SQUIRREL, // OBSOLETE, but kept in place to remind us of the horrors lurking in the history }; PluginLanguage GetLanguage() { return m_Language; } - void SetLanguage( PluginLanguage a_Language ) { m_Language = a_Language; } + void SetLanguage( PluginLanguage a_Language) { m_Language = a_Language; } private: PluginLanguage m_Language; diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp index 5fa8adc66..0f3f25d75 100644 --- a/src/Bindings/PluginLua.cpp +++ b/src/Bindings/PluginLua.cpp @@ -1655,7 +1655,7 @@ int cPluginLua::CallFunctionFromForeignState( -AString cPluginLua::HandleWebRequest(const HTTPRequest * a_Request ) +AString cPluginLua::HandleWebRequest(const HTTPRequest * a_Request) { cCSLock Lock(m_CriticalSection); std::string RetVal = ""; diff --git a/src/Bindings/PluginLua.h b/src/Bindings/PluginLua.h index b2979a210..2cea644c1 100644 --- a/src/Bindings/PluginLua.h +++ b/src/Bindings/PluginLua.h @@ -144,7 +144,7 @@ public: virtual const AString GetWebTitle(void) const {return GetName(); } // cWebPlugin and WebAdmin stuff - virtual AString HandleWebRequest(const HTTPRequest * a_Request ) override; + virtual AString HandleWebRequest(const HTTPRequest * a_Request) override; bool AddWebTab(const AString & a_Title, lua_State * a_LuaState, int a_FunctionReference); // >> EXPORTED IN MANUALBINDINGS << /** Binds the command to call the function specified by a Lua function reference. Simply adds to CommandMap. */ diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp index 33ecb95ad..088b92a6d 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -72,7 +72,7 @@ void cPluginManager::FindPlugins(void) { PluginMap::iterator thiz = itr; ++thiz; - m_Plugins.erase( itr ); + m_Plugins.erase( itr); itr = thiz; continue; } @@ -1432,11 +1432,11 @@ cPluginManager::CommandResult cPluginManager::HandleCommand(cPlayer * a_Player, -cPlugin * cPluginManager::GetPlugin( const AString & a_Plugin ) const +cPlugin * cPluginManager::GetPlugin( const AString & a_Plugin) const { for (PluginMap::const_iterator itr = m_Plugins.begin(); itr != m_Plugins.end(); ++itr) { - if (itr->second == NULL ) continue; + if (itr->second == NULL) continue; if (itr->second->GetName().compare(a_Plugin) == 0) { return itr->second; diff --git a/src/Bindings/PluginManager.h b/src/Bindings/PluginManager.h index cffd8d04b..44a94e316 100644 --- a/src/Bindings/PluginManager.h +++ b/src/Bindings/PluginManager.h @@ -163,7 +163,7 @@ public: typedef std::map< AString, cPlugin * > PluginMap; typedef std::list< cPlugin * > PluginList; - cPlugin * GetPlugin( const AString & a_Plugin ) const; // tolua_export + cPlugin * GetPlugin( const AString & a_Plugin) const; // tolua_export const PluginMap & GetAllPlugins() const; // >> EXPORTED IN MANUALBINDINGS << // tolua_begin diff --git a/src/Bindings/WebPlugin.cpp b/src/Bindings/WebPlugin.cpp index a22826d1b..1178c127a 100644 --- a/src/Bindings/WebPlugin.cpp +++ b/src/Bindings/WebPlugin.cpp @@ -45,12 +45,12 @@ cWebPlugin::~cWebPlugin() std::list > cWebPlugin::GetTabNames(void) { std::list< std::pair< AString, AString > > NameList; - for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) + for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr) { std::pair< AString, AString > StringPair; StringPair.first = (*itr)->Title; StringPair.second = (*itr)->SafeTitle; - NameList.push_back( StringPair ); + NameList.push_back( StringPair); } return NameList; } @@ -69,7 +69,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest sWebPluginTab * Tab = NULL; if (Split.size() > 2) // If we got the tab name, show that page { - for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) + for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr) { if ((*itr)->SafeTitle.compare(Split[2]) == 0) // This is the one! { @@ -80,7 +80,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest } else // Otherwise show the first tab { - if (GetTabs().size() > 0 ) + if (GetTabs().size() > 0) Tab = *GetTabs().begin(); } @@ -100,14 +100,14 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest AString cWebPlugin::SafeString(const AString & a_String) { AString RetVal; - for (unsigned int i = 0; i < a_String.size(); ++i ) + for (unsigned int i = 0; i < a_String.size(); ++i) { char c = a_String[i]; - if (c == ' ' ) + if (c == ' ') { c = '_'; } - RetVal.push_back( c ); + RetVal.push_back( c); } return RetVal; } diff --git a/src/Bindings/WebPlugin.h b/src/Bindings/WebPlugin.h index 3587ac637..46bc0cd2d 100644 --- a/src/Bindings/WebPlugin.h +++ b/src/Bindings/WebPlugin.h @@ -19,9 +19,9 @@ public: // tolua_begin virtual const AString GetWebTitle(void) const = 0; - virtual AString HandleWebRequest(const HTTPRequest * a_Request ) = 0; + virtual AString HandleWebRequest(const HTTPRequest * a_Request) = 0; - static AString SafeString( const AString & a_String ); + static AString SafeString( const AString & a_String); // tolua_end struct sWebPluginTab @@ -37,7 +37,7 @@ public: typedef std::list< std::pair > TabNameList; TabNameList GetTabNames(); // >> EXPORTED IN MANUALBINDINGS << - std::pair< AString, AString > GetTabNameForRequest(const HTTPRequest* a_Request ); + std::pair< AString, AString > GetTabNameForRequest(const HTTPRequest* a_Request); private: TabList m_Tabs; -- cgit v1.2.3 From e171285408028e858ec3a921bbfd97e8a5dcf6ca Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 22 Jul 2014 23:29:04 +0200 Subject: Fixed Bindings generation in MSVC. The bindings weren't regenerated because of the typo in the dependencies cmake variable. --- src/Bindings/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt index 95b858f5d..2ea2fa8c0 100644 --- a/src/Bindings/CMakeLists.txt +++ b/src/Bindings/CMakeLists.txt @@ -39,7 +39,7 @@ set (BINDING_OUTPUTS ${CMAKE_CURRENT_SOURCE_DIR}/LuaState_Call.inc ) -set(BINDING_DEPENDECIES +set(BINDING_DEPENDENCIES tolua ../Bindings/virtual_method_hooks.lua ../Bindings/AllToLua.pkg @@ -122,7 +122,7 @@ if (NOT MSVC) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} # add any new generation dependencies here - DEPENDS ${BINDING_DEPENDECIES} + DEPENDS ${BINDING_DEPENDENCIES} ) endif () set_source_files_properties(Bindings/Bindings.cpp PROPERTIES GENERATED TRUE) -- cgit v1.2.3 From 4191be7ddba820af4ed0c505a8d62416c2b7a8b4 Mon Sep 17 00:00:00 2001 From: archshift Date: Tue, 22 Jul 2014 15:36:13 -0700 Subject: Removed redundant semicolons and re-added warning --- src/Bindings/Plugin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/Plugin.h b/src/Bindings/Plugin.h index 3882b7474..39d53674b 100644 --- a/src/Bindings/Plugin.h +++ b/src/Bindings/Plugin.h @@ -115,10 +115,10 @@ public: virtual bool HandleConsoleCommand(const AStringVector & a_Split, cCommandOutputCallback & a_Output) = 0; /// All bound commands are to be removed, do any language-dependent cleanup here - virtual void ClearCommands(void) {} ; + virtual void ClearCommands(void) {} /// All bound console commands are to be removed, do any language-dependent cleanup here - virtual void ClearConsoleCommands(void) {} ; + virtual void ClearConsoleCommands(void) {} // tolua_begin const AString & GetName(void) const { return m_Name; } -- cgit v1.2.3