Skip to content

Commit

Permalink
CheckBasicStyle: Check number of empty lines between functions (cuber…
Browse files Browse the repository at this point in the history
…ite#4267)

Add check for number of empty lines between functions and fix the corresponding failures
  • Loading branch information
peterbell10 authored Jul 26, 2018
1 parent b8ab03b commit 950aeff
Show file tree
Hide file tree
Showing 121 changed files with 192 additions and 166 deletions.
1 change: 0 additions & 1 deletion src/Bindings/LuaServerHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ cLuaServerHandle::cLuaServerHandle(UInt16 a_Port, cLuaState::cTableRefPtr && a_C




cLuaServerHandle::~cLuaServerHandle()
{
// If the server handle is still open, close it explicitly:
Expand Down
3 changes: 1 addition & 2 deletions src/Bindings/LuaState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ extern "C"




const cLuaState::cRet cLuaState::Return = {};
const cLuaState::cNil cLuaState::Nil = {};






////////////////////////////////////////////////////////////////////////////////
// cCanonLuaStates:

Expand Down Expand Up @@ -135,6 +133,7 @@ void cLuaStateTracker::Add(cLuaState & a_LuaState)




void cLuaStateTracker::Del(cLuaState & a_LuaState)
{
auto & Instance = Get();
Expand Down
2 changes: 1 addition & 1 deletion src/Bindings/ManualBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2454,6 +2454,7 @@ static int tolua_cClientHandle_IsUUIDOnline(lua_State * tolua_S)




static int tolua_cMobHeadEntity_SetOwner(lua_State * tolua_S)
{
// Check params:
Expand Down Expand Up @@ -3493,7 +3494,6 @@ static int tolua_cHopperEntity_GetOutputBlockPos(lua_State * tolua_S)




static int tolua_cBoundingBox_CalcLineIntersection(lua_State * a_LuaState)
{
/* Function signatures:
Expand Down
1 change: 0 additions & 1 deletion src/Bindings/ManualBindings_BlockArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@




/** Reads params that together form a Cuboid.
These can be:
- 6 numbers (MinX, MaxX, MinY, MaxY, MinZ, MaxZ)
Expand Down
1 change: 0 additions & 1 deletion src/Bindings/ManualBindings_World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ static int tolua_cWorld_ScheduleTask(lua_State * tolua_S)




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
Expand Down
1 change: 1 addition & 0 deletions src/Bindings/Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ AString cPlugin::GetLocalFolder(void) const




void cPlugin::SetLoadError(const AString & a_LoadError)
{
m_Status = cPluginManager::psError;
Expand Down
6 changes: 6 additions & 0 deletions src/Bindings/PluginManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ bool cPluginManager::CallHookEntityTeleport(cEntity & a_Entity, const Vector3d &




bool cPluginManager::CallHookEntityChangingWorld(cEntity & a_Entity, cWorld & a_World)
{
return GenericCallHook(HOOK_ENTITY_CHANGING_WORLD, [&](cPlugin * a_Plugin)
Expand All @@ -491,6 +492,7 @@ bool cPluginManager::CallHookEntityChangingWorld(cEntity & a_Entity, cWorld & a_




bool cPluginManager::CallHookEntityChangedWorld(cEntity & a_Entity, cWorld & a_World)
{
return GenericCallHook(HOOK_ENTITY_CHANGED_WORLD, [&](cPlugin * a_Plugin)
Expand All @@ -503,6 +505,7 @@ bool cPluginManager::CallHookEntityChangedWorld(cEntity & a_Entity, cWorld & a_W




bool cPluginManager::CallHookExecuteCommand(cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, CommandResult & a_Result)
{
// Output the command being executed to log (for troubleshooting deadlocks-in-commands):
Expand Down Expand Up @@ -643,6 +646,7 @@ bool cPluginManager::CallHookLogin(cClientHandle & a_Client, UInt32 a_ProtocolVe




bool cPluginManager::CallHookLoginForge(cClientHandle & a_Client, AStringMap & a_Mods)
{
return GenericCallHook(HOOK_LOGIN_FORGE, [&](cPlugin * a_Plugin)
Expand Down Expand Up @@ -1068,6 +1072,7 @@ bool cPluginManager::CallHookSpawnedEntity(cWorld & a_World, cEntity & a_Entity)




bool cPluginManager::CallHookSpawnedMonster(cWorld & a_World, cMonster & a_Monster)
{
return GenericCallHook(HOOK_SPAWNED_MONSTER, [&](cPlugin * a_Plugin)
Expand All @@ -1080,6 +1085,7 @@ bool cPluginManager::CallHookSpawnedMonster(cWorld & a_World, cMonster & a_Monst




bool cPluginManager::CallHookSpawningEntity(cWorld & a_World, cEntity & a_Entity)
{
return GenericCallHook(HOOK_SPAWNING_ENTITY, [&](cPlugin * a_Plugin)
Expand Down
1 change: 1 addition & 0 deletions src/BiomeDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ bool IsBiomeVeryCold(EMCSBiome a_Biome)




bool IsBiomeCold(EMCSBiome a_Biome)
{
switch (a_Biome)
Expand Down
13 changes: 1 addition & 12 deletions src/BlockArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,17 +629,6 @@ void cBlockArea::DumpToRawFile(const AString & a_FileName)














void cBlockArea::Crop(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ)
{
if (
Expand Down Expand Up @@ -2272,7 +2261,6 @@ NIBBLETYPE cBlockArea::GetNibble(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBL




void cBlockArea::CropBlockTypes(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ)
{
int NewSizeX = GetSizeX() - a_AddMinX - a_SubMaxX;
Expand Down Expand Up @@ -2963,6 +2951,7 @@ void cBlockArea::cChunkReader::ChunkData(const cChunkData & a_BlockBuffer)




void cBlockArea::cChunkReader::BlockEntity(cBlockEntity * a_BlockEntity)
{
if (!m_Area.HasBlockEntities())
Expand Down
9 changes: 0 additions & 9 deletions src/BlockEntities/BrewingstandEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@










cBrewingstandEntity::cBrewingstandEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World):
Super(a_BlockType, a_BlockMeta, a_BlockX, a_BlockY, a_BlockZ, ContentsWidth, ContentsHeight, a_World),
m_IsDestroyed(false),
Expand Down Expand Up @@ -160,7 +153,6 @@ bool cBrewingstandEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)




bool cBrewingstandEntity::UsedBy(cPlayer * a_Player)
{
cWindow * Window = GetWindow();
Expand Down Expand Up @@ -207,7 +199,6 @@ void cBrewingstandEntity::BroadcastProgress(short a_ProgressbarID, short a_Value




void cBrewingstandEntity::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum)
{
Super::OnSlotChanged(a_ItemGrid, a_SlotNum);
Expand Down
1 change: 1 addition & 0 deletions src/BlockEntities/ChestEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ cChestEntity::cChestEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_




cChestEntity::~cChestEntity()
{
if (m_Neighbour != nullptr)
Expand Down
1 change: 0 additions & 1 deletion src/BlockEntities/CommandBlockEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ cCommandBlockEntity::cCommandBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_Blo




bool cCommandBlockEntity::UsedBy(cPlayer * a_Player)
{
// Nothing to do
Expand Down
2 changes: 2 additions & 0 deletions src/BlockEntities/DispenserEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ UInt32 cDispenserEntity::SpawnProjectileFromDispenser(int a_BlockX, int a_BlockY





Vector3d cDispenserEntity::GetShootVector(NIBBLETYPE a_Meta)
{
switch (a_Meta & E_META_DROPSPENSER_FACING_MASK)
Expand Down
2 changes: 0 additions & 2 deletions src/BlockEntities/FurnaceEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@




enum
{
PROGRESSBAR_FUEL = 0,
Expand Down Expand Up @@ -282,7 +281,6 @@ void cFurnaceEntity::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum)




void cFurnaceEntity::UpdateInput(void)
{
if (!m_Contents.GetSlot(fsInput).IsEqual(m_LastInput))
Expand Down
1 change: 1 addition & 0 deletions src/BlockEntities/MobHeadEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void cMobHeadEntity::CopyFrom(const cBlockEntity & a_Src)




bool cMobHeadEntity::UsedBy(cPlayer * a_Player)
{
UNUSED(a_Player);
Expand Down
1 change: 1 addition & 0 deletions src/BlockID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ int BlockStringToType(const AString & a_BlockTypeString)




bool StringToItem(const AString & a_ItemTypeString, cItem & a_Item)
{
AString ItemName = TrimString(a_ItemTypeString);
Expand Down
3 changes: 3 additions & 0 deletions src/BlockInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ void cBlockInfo::sHandlerDeleter::operator () (cBlockHandler * a_Handler)
}





cBlockInfo::cBlockInfoArray::cBlockInfoArray()
{
cBlockInfoArray & Info = *this;
Expand Down
4 changes: 4 additions & 0 deletions src/Blocks/BlockDoor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ NIBBLETYPE cBlockDoorHandler::MetaRotateCW(NIBBLETYPE a_Meta)





NIBBLETYPE cBlockDoorHandler::MetaMirrorXY(NIBBLETYPE a_Meta)
{
/*
Expand Down Expand Up @@ -181,6 +183,8 @@ NIBBLETYPE cBlockDoorHandler::MetaMirrorXY(NIBBLETYPE a_Meta)





NIBBLETYPE cBlockDoorHandler::MetaMirrorYZ(NIBBLETYPE a_Meta)
{
// Top bit (0x08) contains door panel type (Top / Bottom panel) Only Bottom panels contain position data
Expand Down
2 changes: 1 addition & 1 deletion src/Blocks/BlockHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@




/*
// Tests the meta rotation and mirroring.
// Note that the cMetaRotator needs to have its assert paths disabled for this test to work!
Expand Down Expand Up @@ -577,6 +576,7 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac




bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, const cChunk & a_Chunk)
{
return true;
Expand Down
7 changes: 0 additions & 7 deletions src/Blocks/ChunkInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ NIBBLETYPE cChunkInterface::GetBlockMeta(Vector3i a_Pos)




bool cChunkInterface::GetBlockTypeMeta(Vector3i a_Pos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta)
{
return m_ChunkMap->GetBlockTypeMeta(a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta);
Expand All @@ -38,7 +37,6 @@ bool cChunkInterface::GetBlockTypeMeta(Vector3i a_Pos, BLOCKTYPE & a_BlockType,




/** Sets the block at the specified coords to the specified value.
Full processing, incl. updating neighbors, is performed.
*/
Expand Down Expand Up @@ -72,7 +70,6 @@ void cChunkInterface::FastSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLO




void cChunkInterface::FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
FastSetBlock( a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta);
Expand All @@ -82,7 +79,6 @@ void cChunkInterface::FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType




bool cChunkInterface::UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ)
{
return m_ChunkMap->UseBlockEntity(a_Player, a_BlockX, a_BlockY, a_BlockZ);
Expand All @@ -92,7 +88,6 @@ bool cChunkInterface::UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_Blo




bool cChunkInterface::ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback & a_Callback)
{
return m_ChunkMap->ForEachChunkInRect(a_MinChunkX, a_MaxChunkX, a_MinChunkZ, a_MaxChunkZ, a_Callback);
Expand All @@ -102,7 +97,6 @@ bool cChunkInterface::ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a




bool cChunkInterface::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes)
{
return m_ChunkMap->WriteBlockArea(a_Area, a_MinBlockX, a_MinBlockY, a_MinBlockZ, a_DataTypes);
Expand All @@ -112,7 +106,6 @@ bool cChunkInterface::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a




bool cChunkInterface::DigBlock(cWorldInterface & a_WorldInterface, int a_X, int a_Y, int a_Z)
{
cBlockHandler * Handler = cBlockInfo::GetHandler(GetBlock({a_X, a_Y, a_Z}));
Expand Down
Loading

0 comments on commit 950aeff

Please sign in to comment.