Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion libgag/src/TrueTypeFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <fribidi/fribidi.h>
#endif

using namespace std;
#define MAX_CACHE_SIZE 128

namespace GAGCore
Expand Down
3 changes: 2 additions & 1 deletion libusl/src/code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

#include <sstream>

using namespace std;
using std::ostringstream;
using std::string;

ThunkPrototype* thisMember(Prototype* outer)
{
Expand Down
2 changes: 1 addition & 1 deletion libusl/src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "code.h"
#include "native.h"

using namespace std;
using std::string;

const Position& ThunkDebugInfo::find(size_t address) const
{
Expand Down
6 changes: 1 addition & 5 deletions libusl/src/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <iostream>

using namespace std;
using std::for_each;

bool Thread::step()
{
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion libusl/src/lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include <cassert>
#include <sstream>

using namespace std;
using std::ostringstream;
using std::string;
using std::endl;

const Token::Type Lexer::tokenTypes[] =
{
Expand Down
3 changes: 2 additions & 1 deletion libusl/src/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#include "interpreter.h"
#include "types.h"

using namespace std;
using std::for_each;
using std::mem_fun;

void Heap::collectGarbage()
{
Expand Down
3 changes: 2 additions & 1 deletion libusl/src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include "error.h"
#include <memory>

using namespace std;
using std::string;
using std::unique_ptr;

void Parser::parse(BlockNode* block)
{
Expand Down
4 changes: 3 additions & 1 deletion libusl/src/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#include "types.h"
#include <sstream>

using namespace std;
using std::stringstream;
using std::ostringstream;
using std::endl;


void Node::generate(ThunkPrototype* thunk, DebugInfo* debug, Code* code)
Expand Down
1 change: 0 additions & 1 deletion libusl/src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <cassert>
#include <algorithm>

using namespace std;

void Value::dump(std::ostream &stream) const
{
Expand Down
9 changes: 6 additions & 3 deletions libusl/src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(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<Value*>(member.second)->markForGC(); });
}

Expand Down Expand Up @@ -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));
}

Expand Down
7 changes: 6 additions & 1 deletion libusl/src/usl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
#include <fstream>
#include <memory>

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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/AI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "AINicowar.h"
#include "AIEcho.h"

using namespace boost;
using boost::shared_ptr;

/*AI::AI(Player *player)
{
Expand Down
2 changes: 1 addition & 1 deletion src/AICastor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion src/AIEcho.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;



Expand Down
2 changes: 1 addition & 1 deletion src/AINumbi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "Utilities.h"
#include "Unit.h"

using namespace boost;
using boost::shared_ptr;

AINumbi::AINumbi(Player *player)
{
Expand Down
2 changes: 1 addition & 1 deletion src/AIToubib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "Order.h"
#include "Player.h"

using namespace boost;
using boost::shared_ptr;

AIToubib::AIToubib(Player *player)
{
Expand Down
2 changes: 1 addition & 1 deletion src/AIWarrush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define BUILDING_DELAY 30
#define AREAS_DELAY 50

using namespace boost;
using boost::shared_ptr;

void AIWarrush::init(Player *player)
{
Expand Down
1 change: 0 additions & 1 deletion src/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

#include <iostream>

using namespace boost;

Engine::Engine()
{
Expand Down
2 changes: 2 additions & 0 deletions src/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/FertilityCalculatorDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/GameGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 2 additions & 0 deletions src/Glob2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
# include <sys/param.h>
#endif

using boost::shared_ptr;

/*! \mainpage Globulation 2 Reference documentation

\section intro Introduction
Expand Down
2 changes: 1 addition & 1 deletion src/IRCTextMessageHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "YOGConsts.h"

using namespace GAGCore;
using namespace boost;
using boost::static_pointer_cast;

IRCTextMessageHandler::IRCTextMessageHandler()
: irc(incoming, incomingMutex)
Expand Down
2 changes: 1 addition & 1 deletion src/IRCThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "IRCThreadMessage.h"
#include <iostream>

using namespace boost;
using boost::static_pointer_cast;

IRCThread::IRCThread(std::queue<boost::shared_ptr<IRCThreadMessage> >& outgoing, boost::recursive_mutex& outgoingMutex)
: outgoing(outgoing), outgoingMutex(outgoingMutex)
Expand Down
1 change: 1 addition & 0 deletions src/LANFindScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "YOGClientGameListManager.h"

using namespace GAGGUI;
using boost::shared_ptr;

LANFindScreen::LANFindScreen()
{
Expand Down
2 changes: 2 additions & 0 deletions src/LANMenuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include <Toolkit.h>
#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));
Expand Down
7 changes: 6 additions & 1 deletion src/MapScriptUSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ using namespace GAGCore;
#include <memory>
#include <boost/functional.hpp>

using namespace std;
using std::string;
using std::unique_ptr;
using std::ifstream;
using std::istringstream;
using std::cerr;
using std::endl;


template<>
Expand Down
3 changes: 3 additions & 0 deletions src/MultiplayerGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include "NetMessage.h"
#include "YOGClientGameListManager.h"

using boost::shared_ptr;
using boost::static_pointer_cast;

MultiplayerGame::MultiplayerGame(boost::shared_ptr<YOGClient> client)
: client(client), creationState(YOGCreateRefusalUnknown), joinState(YOGJoinRefusalUnknown), playerManager(gameHeader)
{
Expand Down
2 changes: 2 additions & 0 deletions src/MultiplayerGameScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "YOGMessage.h"
#include "CustomGameOtherOptions.h"

using boost::static_pointer_cast;

MultiplayerGameScreen::MultiplayerGameScreen(TabScreen* parent, boost::shared_ptr<MultiplayerGame> game, boost::shared_ptr<YOGClient> client, boost::shared_ptr<IRCTextMessageHandler> ircChat)
: TabScreenWindow(parent, Toolkit::getStringTable()->getString("[Game]")), game(game), gameChat(new YOGClientChatChannel(static_cast<unsigned int>(-1), client)), ircChat(ircChat)
{
Expand Down
2 changes: 2 additions & 0 deletions src/NetConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "NetMessage.h"

using namespace GAGCore;
using boost::static_pointer_cast;
using boost::shared_ptr;



Expand Down
2 changes: 1 addition & 1 deletion src/NetConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <queue>
#include <boost/shared_ptr.hpp>

using namespace boost;
using boost::shared_ptr;

class NetListener;
class NetMessage;
Expand Down
1 change: 1 addition & 0 deletions src/NetConnectionThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "boost/lexical_cast.hpp"

using namespace GAGCore;
using boost::static_pointer_cast;

NetConnectionThread::NetConnectionThread(std::queue<boost::shared_ptr<NetConnectionThreadMessage> >& outgoing, boost::recursive_mutex& outgoingMutex)
: outgoing(outgoing), outgoingMutex(outgoingMutex)
Expand Down
1 change: 0 additions & 1 deletion src/NetListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/NetMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "YOGAfterJoinGameInformation.h"


using namespace boost;
using boost::shared_ptr;

///This is the enum of message types
enum NetMessageType
Expand Down
1 change: 1 addition & 0 deletions src/NetTestSuite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@


using namespace GAGCore;
using boost::shared_ptr;

NetTestSuite::NetTestSuite()
{
Expand Down
2 changes: 0 additions & 2 deletions src/NetTestSuite.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "YOGMessage.h"
#include <boost/shared_ptr.hpp>

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
Expand Down
4 changes: 3 additions & 1 deletion src/SGSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
#include "Unit.h"
#include "Utilities.h"

using std::string;
using std::cerr;
using std::endl;

SGSLToken::TokenSymbolLookupTable SGSLToken::table[] =
{
Expand Down Expand Up @@ -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
{
Expand Down
3 changes: 3 additions & 0 deletions src/YOGClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading