From 9a1c29fd9e25aa52939bba0bb006095aa86661d9 Mon Sep 17 00:00:00 2001 From: Nathan Mills <38995150+Quipyowert2@users.noreply.github.com> Date: Sat, 22 Apr 2023 20:49:08 -0700 Subject: [PATCH] Fix "xtime: ambiguous symbol" errors w/ Visual Studio. --- libgag/src/TrueTypeFont.cpp | 1 - libusl/src/code.cpp | 3 ++- libusl/src/debug.cpp | 2 +- libusl/src/interpreter.cpp | 6 +----- libusl/src/lexer.cpp | 4 +++- libusl/src/memory.cpp | 3 ++- libusl/src/parser.cpp | 3 ++- libusl/src/tree.cpp | 4 +++- libusl/src/types.cpp | 1 - libusl/src/types.h | 9 ++++++--- libusl/src/usl.cpp | 7 ++++++- src/AI.cpp | 2 +- src/AICastor.cpp | 2 +- src/AIEcho.cpp | 2 +- src/AINumbi.cpp | 2 +- src/AIToubib.cpp | 2 +- src/AIWarrush.cpp | 2 +- src/Engine.cpp | 1 - src/Engine.h | 2 ++ src/FertilityCalculatorDialog.cpp | 2 +- src/GameGUI.cpp | 3 ++- src/Glob2.cpp | 2 ++ src/IRCTextMessageHandler.cpp | 2 +- src/IRCThread.cpp | 2 +- src/LANFindScreen.cpp | 1 + src/LANMenuScreen.cpp | 2 ++ src/MapScriptUSL.cpp | 7 ++++++- src/MultiplayerGame.cpp | 3 +++ src/MultiplayerGameScreen.cpp | 2 ++ src/NetConnection.cpp | 2 ++ src/NetConnection.h | 2 +- src/NetConnectionThread.cpp | 1 + src/NetListener.h | 1 - src/NetMessage.h | 2 +- src/NetTestSuite.cpp | 1 + src/NetTestSuite.h | 2 -- src/SGSL.cpp | 4 +++- src/YOGClient.cpp | 3 +++ src/YOGClientDownloadableMapList.cpp | 1 + src/YOGClientFileAssembler.cpp | 2 +- src/YOGClientGameConnectionDialog.cpp | 1 - src/YOGClientGameListManager.cpp | 2 ++ src/YOGClientMapUploader.cpp | 1 + src/YOGClientPlayerListManager.cpp | 2 ++ src/YOGClientRouterAdministrator.cpp | 1 + src/YOGLoginScreen.cpp | 2 ++ src/YOGRegisterScreen.cpp | 1 + src/YOGServerFileDistributor.cpp | 2 +- src/YOGServerPlayer.cpp | 2 ++ src/YOGServerPlayer.h | 2 +- src/YOGServerRouter.cpp | 2 +- src/YOGServerRouterManager.cpp | 2 ++ src/YOGServerRouterPlayer.cpp | 1 + 53 files changed, 86 insertions(+), 40 deletions(-) diff --git a/libgag/src/TrueTypeFont.cpp b/libgag/src/TrueTypeFont.cpp index 799f61388..6cd995e58 100644 --- a/libgag/src/TrueTypeFont.cpp +++ b/libgag/src/TrueTypeFont.cpp @@ -28,7 +28,6 @@ #include #endif -using namespace std; #define MAX_CACHE_SIZE 128 namespace GAGCore diff --git a/libusl/src/code.cpp b/libusl/src/code.cpp index 9144e9103..b4f66df3b 100644 --- a/libusl/src/code.cpp +++ b/libusl/src/code.cpp @@ -8,7 +8,8 @@ #include -using namespace std; +using std::ostringstream; +using std::string; ThunkPrototype* thisMember(Prototype* outer) { diff --git a/libusl/src/debug.cpp b/libusl/src/debug.cpp index 484799742..39cd4d575 100644 --- a/libusl/src/debug.cpp +++ b/libusl/src/debug.cpp @@ -3,7 +3,7 @@ #include "code.h" #include "native.h" -using namespace std; +using std::string; const Position& ThunkDebugInfo::find(size_t address) const { diff --git a/libusl/src/interpreter.cpp b/libusl/src/interpreter.cpp index 4c02e5e94..65c06735d 100644 --- a/libusl/src/interpreter.cpp +++ b/libusl/src/interpreter.cpp @@ -6,7 +6,7 @@ #include -using namespace std; +using std::for_each; bool Thread::step() { @@ -81,16 +81,12 @@ size_t Thread::run() void Thread::markForGC() { - using namespace std; - // mark all frames in stack for_each(frames.begin(), frames.end(), [](auto& frame) {frame.markForGC(); }); } void Thread::Frame::markForGC() { - using namespace std; - // mark all variables in frame for_each(stack.begin(), stack.end(), [](auto& value) {value->markForGC(); }); thunk->markForGC(); diff --git a/libusl/src/lexer.cpp b/libusl/src/lexer.cpp index 198427512..3d79b4292 100644 --- a/libusl/src/lexer.cpp +++ b/libusl/src/lexer.cpp @@ -4,7 +4,9 @@ #include #include -using namespace std; +using std::ostringstream; +using std::string; +using std::endl; const Token::Type Lexer::tokenTypes[] = { diff --git a/libusl/src/memory.cpp b/libusl/src/memory.cpp index a9ff53d28..46fdb5c5f 100644 --- a/libusl/src/memory.cpp +++ b/libusl/src/memory.cpp @@ -2,7 +2,8 @@ #include "interpreter.h" #include "types.h" -using namespace std; +using std::for_each; +using std::mem_fun; void Heap::collectGarbage() { diff --git a/libusl/src/parser.cpp b/libusl/src/parser.cpp index 432724888..e11667b8b 100644 --- a/libusl/src/parser.cpp +++ b/libusl/src/parser.cpp @@ -3,7 +3,8 @@ #include "error.h" #include -using namespace std; +using std::string; +using std::unique_ptr; void Parser::parse(BlockNode* block) { diff --git a/libusl/src/tree.cpp b/libusl/src/tree.cpp index 84e52ce53..aeed470a3 100644 --- a/libusl/src/tree.cpp +++ b/libusl/src/tree.cpp @@ -5,7 +5,9 @@ #include "types.h" #include -using namespace std; +using std::stringstream; +using std::ostringstream; +using std::endl; void Node::generate(ThunkPrototype* thunk, DebugInfo* debug, Code* code) diff --git a/libusl/src/types.cpp b/libusl/src/types.cpp index 339dedf58..1d5f66b04 100644 --- a/libusl/src/types.cpp +++ b/libusl/src/types.cpp @@ -9,7 +9,6 @@ #include #include -using namespace std; void Value::dump(std::ostream &stream) const { diff --git a/libusl/src/types.h b/libusl/src/types.h index f61e8ee51..1e0bb393e 100644 --- a/libusl/src/types.h +++ b/libusl/src/types.h @@ -65,13 +65,15 @@ struct Prototype: Value virtual void dumpSpecific(std::ostream& stream) const { stream << ": "; - using namespace std; + using std::transform; + using std::ostream_iterator; + using std::string; transform(members.begin(), members.end(), ostream_iterator(stream, " "), [](auto& member) {return member.first; }); } virtual void propagateMarkForGC() { - using namespace std; + using std::for_each; for_each(members.begin(), members.end(), [this](auto& member) {dynamic_cast(member.second)->markForGC(); }); } @@ -157,7 +159,8 @@ struct Scope: Thunk virtual void propagateMarkForGC() { - using namespace std; + using std::for_each; + using std::mem_fun; for_each(locals.begin(), locals.end(), mem_fun(&Value::markForGC)); } diff --git a/libusl/src/usl.cpp b/libusl/src/usl.cpp index 893c60e1e..e0f2ab252 100644 --- a/libusl/src/usl.cpp +++ b/libusl/src/usl.cpp @@ -8,7 +8,12 @@ #include #include -using namespace std; +using std::ostream; +using std::ifstream; +using std::string; +using std::unique_ptr; +using std::cout; +using std::endl; void dumpCode(ThunkPrototype* thunk, ThunkDebugInfo* debug, ostream& stream) { diff --git a/src/AI.cpp b/src/AI.cpp index c1722afa6..52042bcd7 100644 --- a/src/AI.cpp +++ b/src/AI.cpp @@ -35,7 +35,7 @@ #include "AINicowar.h" #include "AIEcho.h" -using namespace boost; +using boost::shared_ptr; /*AI::AI(Player *player) { diff --git a/src/AICastor.cpp b/src/AICastor.cpp index 2f154d149..a075c8780 100644 --- a/src/AICastor.cpp +++ b/src/AICastor.cpp @@ -34,7 +34,7 @@ #define AI_FILE_MIN_VERSION 1 #define AI_FILE_VERSION 2 -using namespace boost; +using boost::shared_ptr; // AICastor::Project part: diff --git a/src/AIEcho.cpp b/src/AIEcho.cpp index 2d98efbed..c9d5df579 100644 --- a/src/AIEcho.cpp +++ b/src/AIEcho.cpp @@ -40,7 +40,7 @@ using namespace AIEcho::Management; using namespace AIEcho::Conditions; using namespace AIEcho::SearchTools; using namespace boost::logic; -using namespace boost; +using boost::shared_ptr; diff --git a/src/AINumbi.cpp b/src/AINumbi.cpp index d42a1472b..a14bf2c46 100644 --- a/src/AINumbi.cpp +++ b/src/AINumbi.cpp @@ -27,7 +27,7 @@ #include "Utilities.h" #include "Unit.h" -using namespace boost; +using boost::shared_ptr; AINumbi::AINumbi(Player *player) { diff --git a/src/AIToubib.cpp b/src/AIToubib.cpp index c4f62ead4..8835b0d3d 100644 --- a/src/AIToubib.cpp +++ b/src/AIToubib.cpp @@ -25,7 +25,7 @@ #include "Order.h" #include "Player.h" -using namespace boost; +using boost::shared_ptr; AIToubib::AIToubib(Player *player) { diff --git a/src/AIWarrush.cpp b/src/AIWarrush.cpp index 2a14ba550..2445f5892 100644 --- a/src/AIWarrush.cpp +++ b/src/AIWarrush.cpp @@ -34,7 +34,7 @@ #define BUILDING_DELAY 30 #define AREAS_DELAY 50 -using namespace boost; +using boost::shared_ptr; void AIWarrush::init(Player *player) { diff --git a/src/Engine.cpp b/src/Engine.cpp index 6b964d684..ed1835370 100644 --- a/src/Engine.cpp +++ b/src/Engine.cpp @@ -44,7 +44,6 @@ #include -using namespace boost; Engine::Engine() { diff --git a/src/Engine.h b/src/Engine.h index a9efc1db6..ed17e1cae 100644 --- a/src/Engine.h +++ b/src/Engine.h @@ -36,6 +36,8 @@ class MultiplayersJoin; class NetGame; +using boost::shared_ptr; + /// Engine is the backend of the game. It is responsible for loading and setting up games and players, /// and its run function is meant to run the game that has been loaded. class Engine diff --git a/src/FertilityCalculatorDialog.cpp b/src/FertilityCalculatorDialog.cpp index da38f9e0a..085e4c15b 100644 --- a/src/FertilityCalculatorDialog.cpp +++ b/src/FertilityCalculatorDialog.cpp @@ -29,7 +29,7 @@ using namespace GAGCore; using namespace GAGGUI; -using namespace boost; +using boost::static_pointer_cast; FertilityCalculatorDialog::FertilityCalculatorDialog(GraphicContext *parentCtx, Map& map) : OverlayScreen(parentCtx, 200, 100), map(map), parentCtx(parentCtx), thread(map, incoming, incomingMutex) diff --git a/src/GameGUI.cpp b/src/GameGUI.cpp index 9534c8009..7909a2e56 100644 --- a/src/GameGUI.cpp +++ b/src/GameGUI.cpp @@ -128,7 +128,8 @@ #define REPLAY_BAR_FAST_FORWARD_BUTTON_SPRITE 55 #define REPLAY_BAR_FAST_FORWARD_BUTTON_ACTIVE_SPRITE 54 -using namespace boost; +using boost::shared_ptr; +using boost::static_pointer_cast; enum GameGUIGfxId { diff --git a/src/Glob2.cpp b/src/Glob2.cpp index 0aeb6446c..3d9822145 100644 --- a/src/Glob2.cpp +++ b/src/Glob2.cpp @@ -70,6 +70,8 @@ # include #endif +using boost::shared_ptr; + /*! \mainpage Globulation 2 Reference documentation \section intro Introduction diff --git a/src/IRCTextMessageHandler.cpp b/src/IRCTextMessageHandler.cpp index 10ec5c38f..668841352 100644 --- a/src/IRCTextMessageHandler.cpp +++ b/src/IRCTextMessageHandler.cpp @@ -26,7 +26,7 @@ #include "YOGConsts.h" using namespace GAGCore; -using namespace boost; +using boost::static_pointer_cast; IRCTextMessageHandler::IRCTextMessageHandler() : irc(incoming, incomingMutex) diff --git a/src/IRCThread.cpp b/src/IRCThread.cpp index ff2ecd2ff..936154061 100644 --- a/src/IRCThread.cpp +++ b/src/IRCThread.cpp @@ -20,7 +20,7 @@ #include "IRCThreadMessage.h" #include -using namespace boost; +using boost::static_pointer_cast; IRCThread::IRCThread(std::queue >& outgoing, boost::recursive_mutex& outgoingMutex) : outgoing(outgoing), outgoingMutex(outgoingMutex) diff --git a/src/LANFindScreen.cpp b/src/LANFindScreen.cpp index 1bcd7fae3..ad0150d3c 100644 --- a/src/LANFindScreen.cpp +++ b/src/LANFindScreen.cpp @@ -34,6 +34,7 @@ #include "YOGClientGameListManager.h" using namespace GAGGUI; +using boost::shared_ptr; LANFindScreen::LANFindScreen() { diff --git a/src/LANMenuScreen.cpp b/src/LANMenuScreen.cpp index bb48f12fc..598e49354 100644 --- a/src/LANMenuScreen.cpp +++ b/src/LANMenuScreen.cpp @@ -33,6 +33,8 @@ #include #include "YOGServer.h" +using boost::shared_ptr; + LANMenuScreen::LANMenuScreen() { addWidget(new TextButton(0, 70, 300, 40, ALIGN_CENTERED, ALIGN_SCREEN_CENTERED, "menu", Toolkit::getStringTable()->getString("[host]"), HOST)); diff --git a/src/MapScriptUSL.cpp b/src/MapScriptUSL.cpp index e6755c38a..404385c70 100644 --- a/src/MapScriptUSL.cpp +++ b/src/MapScriptUSL.cpp @@ -33,7 +33,12 @@ using namespace GAGCore; #include #include -using namespace std; +using std::string; +using std::unique_ptr; +using std::ifstream; +using std::istringstream; +using std::cerr; +using std::endl; template<> diff --git a/src/MultiplayerGame.cpp b/src/MultiplayerGame.cpp index f8126c9aa..484cad90c 100644 --- a/src/MultiplayerGame.cpp +++ b/src/MultiplayerGame.cpp @@ -26,6 +26,9 @@ #include "NetMessage.h" #include "YOGClientGameListManager.h" +using boost::shared_ptr; +using boost::static_pointer_cast; + MultiplayerGame::MultiplayerGame(boost::shared_ptr client) : client(client), creationState(YOGCreateRefusalUnknown), joinState(YOGJoinRefusalUnknown), playerManager(gameHeader) { diff --git a/src/MultiplayerGameScreen.cpp b/src/MultiplayerGameScreen.cpp index c554072e5..abc55e6fb 100644 --- a/src/MultiplayerGameScreen.cpp +++ b/src/MultiplayerGameScreen.cpp @@ -40,6 +40,8 @@ #include "YOGMessage.h" #include "CustomGameOtherOptions.h" +using boost::static_pointer_cast; + MultiplayerGameScreen::MultiplayerGameScreen(TabScreen* parent, boost::shared_ptr game, boost::shared_ptr client, boost::shared_ptr ircChat) : TabScreenWindow(parent, Toolkit::getStringTable()->getString("[Game]")), game(game), gameChat(new YOGClientChatChannel(static_cast(-1), client)), ircChat(ircChat) { diff --git a/src/NetConnection.cpp b/src/NetConnection.cpp index 8dbc55f00..6ef15d0a8 100644 --- a/src/NetConnection.cpp +++ b/src/NetConnection.cpp @@ -24,6 +24,8 @@ #include "NetMessage.h" using namespace GAGCore; +using boost::static_pointer_cast; +using boost::shared_ptr; diff --git a/src/NetConnection.h b/src/NetConnection.h index 60c1f1fac..8c51fb3ef 100644 --- a/src/NetConnection.h +++ b/src/NetConnection.h @@ -24,7 +24,7 @@ #include #include -using namespace boost; +using boost::shared_ptr; class NetListener; class NetMessage; diff --git a/src/NetConnectionThread.cpp b/src/NetConnectionThread.cpp index 1df4901df..c5b203bd2 100644 --- a/src/NetConnectionThread.cpp +++ b/src/NetConnectionThread.cpp @@ -23,6 +23,7 @@ #include "boost/lexical_cast.hpp" using namespace GAGCore; +using boost::static_pointer_cast; NetConnectionThread::NetConnectionThread(std::queue >& outgoing, boost::recursive_mutex& outgoingMutex) : outgoing(outgoing), outgoingMutex(outgoingMutex) diff --git a/src/NetListener.h b/src/NetListener.h index 67d5ed844..f54d03b70 100644 --- a/src/NetListener.h +++ b/src/NetListener.h @@ -22,7 +22,6 @@ #include "SDL_net.h" #include "NetConnection.h" -using namespace boost; ///NetListener represents a low level wrapper arround SDL. ///It listens for incoming connections. One should frequently diff --git a/src/NetMessage.h b/src/NetMessage.h index b8629e399..5855601a5 100644 --- a/src/NetMessage.h +++ b/src/NetMessage.h @@ -37,7 +37,7 @@ #include "YOGAfterJoinGameInformation.h" -using namespace boost; +using boost::shared_ptr; ///This is the enum of message types enum NetMessageType diff --git a/src/NetTestSuite.cpp b/src/NetTestSuite.cpp index fa88372e9..155d62672 100644 --- a/src/NetTestSuite.cpp +++ b/src/NetTestSuite.cpp @@ -25,6 +25,7 @@ using namespace GAGCore; +using boost::shared_ptr; NetTestSuite::NetTestSuite() { diff --git a/src/NetTestSuite.h b/src/NetTestSuite.h index aef942075..dab080b3b 100644 --- a/src/NetTestSuite.h +++ b/src/NetTestSuite.h @@ -26,8 +26,6 @@ #include "YOGMessage.h" #include -using namespace boost; - ///This is a basic test system for the low level net classes, ///NetConnection, NetListener, NetMessage, YOGGameInfo and YOGMessage ///When run, it is assumed that the host allows the program to listen on diff --git a/src/SGSL.cpp b/src/SGSL.cpp index 2bc8f295e..62ddec136 100644 --- a/src/SGSL.cpp +++ b/src/SGSL.cpp @@ -41,6 +41,9 @@ #include "Unit.h" #include "Utilities.h" +using std::string; +using std::cerr; +using std::endl; SGSLToken::TokenSymbolLookupTable SGSLToken::table[] = { @@ -1090,7 +1093,6 @@ void Story::syncStep(GameGUI *gui) std::cout << "Story::syncStep : SGSL : Warning, story step took more than 256 cycles, perhaps you have infinite loop in your script" << std::endl; } -using namespace std; std::string ErrorReport::getErrorString(void) const { diff --git a/src/YOGClient.cpp b/src/YOGClient.cpp index 69f47c21e..50fcd1ab9 100644 --- a/src/YOGClient.cpp +++ b/src/YOGClient.cpp @@ -34,6 +34,9 @@ #include "YOGMessage.h" #include "YOGServer.h" +using boost::static_pointer_cast; +using boost::shared_ptr; + YOGClient::YOGClient(const std::string& server) { initialize(); diff --git a/src/YOGClientDownloadableMapList.cpp b/src/YOGClientDownloadableMapList.cpp index a629412a9..304849943 100644 --- a/src/YOGClientDownloadableMapList.cpp +++ b/src/YOGClientDownloadableMapList.cpp @@ -21,6 +21,7 @@ #include "YOGClient.h" #include "NetMessage.h" +using boost::static_pointer_cast; YOGClientDownloadableMapList::YOGClientDownloadableMapList(YOGClient* client) : client(client) diff --git a/src/YOGClientFileAssembler.cpp b/src/YOGClientFileAssembler.cpp index 0fe2794f4..83c9948ae 100644 --- a/src/YOGClientFileAssembler.cpp +++ b/src/YOGClientFileAssembler.cpp @@ -25,8 +25,8 @@ #include "YOGClientFileAssembler.h" #include "YOGClient.h" -using namespace boost; using namespace GAGCore; +using boost::static_pointer_cast; YOGClientFileAssembler::YOGClientFileAssembler(boost::weak_ptr client, Uint16 fileID) : client(client), fileID(fileID) diff --git a/src/YOGClientGameConnectionDialog.cpp b/src/YOGClientGameConnectionDialog.cpp index c2f1c15f2..8d29c96ff 100644 --- a/src/YOGClientGameConnectionDialog.cpp +++ b/src/YOGClientGameConnectionDialog.cpp @@ -27,7 +27,6 @@ using namespace GAGCore; using namespace GAGGUI; -using namespace boost; YOGClientGameConnectionDialog::YOGClientGameConnectionDialog(GraphicContext *parentCtx, boost::shared_ptr game) : OverlayScreen(parentCtx, 200, 100), parentCtx(parentCtx), game(game) diff --git a/src/YOGClientGameListManager.cpp b/src/YOGClientGameListManager.cpp index b84a31b0a..2aeafc0e0 100644 --- a/src/YOGClientGameListManager.cpp +++ b/src/YOGClientGameListManager.cpp @@ -21,6 +21,8 @@ #include "NetMessage.h" #include "YOGClientGameListListener.h" +using boost::static_pointer_cast; + YOGClientGameListManager::YOGClientGameListManager(YOGClient* client) : client(client) { diff --git a/src/YOGClientMapUploader.cpp b/src/YOGClientMapUploader.cpp index 794e6cd64..9985022dc 100644 --- a/src/YOGClientMapUploader.cpp +++ b/src/YOGClientMapUploader.cpp @@ -28,6 +28,7 @@ #include "Stream.h" #include "BinaryStream.h" +using boost::static_pointer_cast; YOGClientMapUploader::YOGClientMapUploader(boost::shared_ptr client) : state(Nothing), client(client) diff --git a/src/YOGClientPlayerListManager.cpp b/src/YOGClientPlayerListManager.cpp index d801ee9b2..c0272173e 100644 --- a/src/YOGClientPlayerListManager.cpp +++ b/src/YOGClientPlayerListManager.cpp @@ -20,6 +20,8 @@ #include "YOGClientPlayerListListener.h" #include "NetMessage.h" +using boost::static_pointer_cast; + YOGClientPlayerListManager::YOGClientPlayerListManager(YOGClient* client) : client(client) { diff --git a/src/YOGClientRouterAdministrator.cpp b/src/YOGClientRouterAdministrator.cpp index e6c0c4ce7..1115ca790 100644 --- a/src/YOGClientRouterAdministrator.cpp +++ b/src/YOGClientRouterAdministrator.cpp @@ -23,6 +23,7 @@ #include "YOGClientRouterAdministrator.h" #include "YOGConsts.h" +using boost::static_pointer_cast; YOGClientRouterAdministrator::YOGClientRouterAdministrator() { diff --git a/src/YOGLoginScreen.cpp b/src/YOGLoginScreen.cpp index 5ba5cfc53..622038675 100644 --- a/src/YOGLoginScreen.cpp +++ b/src/YOGLoginScreen.cpp @@ -40,6 +40,8 @@ #include "YOGLoginScreen.h" #include "YOGRegisterScreen.h" +using boost::static_pointer_cast; + YOGLoginScreen::YOGLoginScreen(boost::shared_ptr client) : client(client) { diff --git a/src/YOGRegisterScreen.cpp b/src/YOGRegisterScreen.cpp index ac499989c..55fa125cb 100644 --- a/src/YOGRegisterScreen.cpp +++ b/src/YOGRegisterScreen.cpp @@ -32,6 +32,7 @@ #include "GlobalContainer.h" +using boost::static_pointer_cast; YOGRegisterScreen::YOGRegisterScreen(boost::shared_ptr client) : client(client) diff --git a/src/YOGServerFileDistributor.cpp b/src/YOGServerFileDistributor.cpp index c745e8afb..2dfee2300 100644 --- a/src/YOGServerFileDistributor.cpp +++ b/src/YOGServerFileDistributor.cpp @@ -25,8 +25,8 @@ #include "YOGServerFileDistributor.h" #include "YOGServerPlayer.h" -using namespace boost; using namespace GAGCore; +using boost::static_pointer_cast; YOGServerFileDistributor::YOGServerFileDistributor(Uint16 fileID) : fileID(fileID), startedLoading(false), downloadFromPlayerCanceled(false) diff --git a/src/YOGServerPlayer.cpp b/src/YOGServerPlayer.cpp index 121846c98..870200d64 100644 --- a/src/YOGServerPlayer.cpp +++ b/src/YOGServerPlayer.cpp @@ -23,6 +23,8 @@ #include "YOGServerFileDistributor.h" #include "YOGServerPlayer.h" +using boost::static_pointer_cast; + YOGServerPlayer::YOGServerPlayer(shared_ptr connection, Uint16 id, YOGServer& server) : connection(connection), server(server), playerID(id) { diff --git a/src/YOGServerPlayer.h b/src/YOGServerPlayer.h index 2e945d015..efd7f2a35 100644 --- a/src/YOGServerPlayer.h +++ b/src/YOGServerPlayer.h @@ -27,13 +27,13 @@ #include "YOGGameInfo.h" #include "YOGPlayerSessionInfo.h" -using namespace boost; class YOGServer; class YOGServerGame; class NetMessage; class P2PManager; +using boost::weak_ptr; ///This represents a connected user on the YOG server. class YOGServerPlayer { diff --git a/src/YOGServerRouter.cpp b/src/YOGServerRouter.cpp index 3afd5bfe0..fd24c364a 100644 --- a/src/YOGServerRouter.cpp +++ b/src/YOGServerRouter.cpp @@ -28,8 +28,8 @@ #include "YOGServerRouterPlayer.h" #include -using namespace boost; using namespace GAGCore; +using boost::static_pointer_cast; YOGServerRouter::YOGServerRouter() : nl(YOG_ROUTER_PORT), admin(this) diff --git a/src/YOGServerRouterManager.cpp b/src/YOGServerRouterManager.cpp index af2a05677..a3de922bb 100644 --- a/src/YOGServerRouterManager.cpp +++ b/src/YOGServerRouterManager.cpp @@ -21,6 +21,8 @@ #include "NetConnection.h" #include "NetMessage.h" +using boost::static_pointer_cast; + YOGServerRouterManager::YOGServerRouterManager(YOGServer& server) : listener(YOG_SERVER_ROUTER_PORT), server(server) { diff --git a/src/YOGServerRouterPlayer.cpp b/src/YOGServerRouterPlayer.cpp index 725913c2b..6d2845b67 100644 --- a/src/YOGServerRouterPlayer.cpp +++ b/src/YOGServerRouterPlayer.cpp @@ -23,6 +23,7 @@ #include "YOGServerGameRouter.h" #include "YOGServerRouter.h" +using boost::static_pointer_cast; YOGServerRouterPlayer::YOGServerRouterPlayer(boost::shared_ptr connection, YOGServerRouter* router) : connection(connection), router(router), isAdmin(false)