From e1b3ddcbcb4bf7e9587fb7537353afce7c7b5de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Sat, 20 Apr 2019 17:03:23 +0200 Subject: [PATCH] Nuke using namespace std; --- src/PowderToySDL.cpp | 2 -- src/gui/game/GameController.cpp | 15 +++++++-------- src/gui/game/Tool.cpp | 2 -- src/gui/interface/Engine.cpp | 4 ---- src/gui/render/RenderModel.h | 2 -- src/powdertoyjava/PowderToyJava.cpp | 2 -- 6 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index c303cc255..765a77d4b 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -50,8 +50,6 @@ #include "gui/Style.h" #include "gui/interface/Engine.h" -using namespace std; - #define INCLUDE_SYSWM #include "SDLCompat.h" diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 1b97708f1..2b1de0f23 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -78,8 +78,6 @@ # undef GetUserName // dammit windows #endif -using namespace std; - class GameController::SearchCallback: public ControllerCallback { GameController * cc; @@ -1394,17 +1392,18 @@ void GameController::OpenProfile() void GameController::OpenElementSearch() { - vector toolList; - vector menuList = gameModel->GetMenuList(); - for(std::vector::iterator iter = menuList.begin(), end = menuList.end(); iter!=end; ++iter) { - if(!(*iter)) + std::vector toolList; + std::vector menuList = gameModel->GetMenuList(); + for(auto *mm : menuList) + { + if(!mm) continue; - vector menuToolList = (*iter)->GetToolList(); + std::vector menuToolList = mm->GetToolList(); if(!menuToolList.size()) continue; toolList.insert(toolList.end(), menuToolList.begin(), menuToolList.end()); } - vector hiddenTools = gameModel->GetUnlistedTools(); + std::vector hiddenTools = gameModel->GetUnlistedTools(); toolList.insert(toolList.end(), hiddenTools.begin(), hiddenTools.end()); new ElementSearchActivity(this, toolList); } diff --git a/src/gui/game/Tool.cpp b/src/gui/game/Tool.cpp index 669b02228..6f01c2cd0 100644 --- a/src/gui/game/Tool.cpp +++ b/src/gui/game/Tool.cpp @@ -6,8 +6,6 @@ #include "simulation/SimulationData.h" #include "ElementClasses.h" -using namespace std; - Tool::Tool(int id, String name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int)): textureGen(textureGen), toolID(id), diff --git a/src/gui/interface/Engine.cpp b/src/gui/interface/Engine.cpp index ce92a4eac..e147ed986 100644 --- a/src/gui/interface/Engine.cpp +++ b/src/gui/interface/Engine.cpp @@ -14,7 +14,6 @@ #include "PowderToy.h" using namespace ui; -using namespace std; Engine::Engine(): FpsLimit(60.0f), @@ -24,9 +23,6 @@ Engine::Engine(): altFullscreen(false), resizable(false), lastBuffer(NULL), - prevBuffers(stack()), - windows(stack()), - mousePositions(stack()), state_(NULL), windowTargetPosition(0, 0), break_(false), diff --git a/src/gui/render/RenderModel.h b/src/gui/render/RenderModel.h index c072c16b0..d612815b6 100644 --- a/src/gui/render/RenderModel.h +++ b/src/gui/render/RenderModel.h @@ -3,8 +3,6 @@ #include -using namespace std; - class RenderView; class Renderer; class RenderModel diff --git a/src/powdertoyjava/PowderToyJava.cpp b/src/powdertoyjava/PowderToyJava.cpp index d11f7c380..b0ab4c09b 100644 --- a/src/powdertoyjava/PowderToyJava.cpp +++ b/src/powdertoyjava/PowderToyJava.cpp @@ -9,8 +9,6 @@ #include "game/GameController.h" -using namespace std; - GameController * gameController; ui::Engine * engine;