From c127d36789457d351cc5daa38a50a16d85442063 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 23 Sep 2010 19:29:14 +0200 Subject: [PATCH] Changed: Removed "using namespace" from *.h --- code/nel/include/nel/net/message_recorder.h | 9 +++------ .../client/src/interface_v3/chat_displayer.h | 7 ++----- .../pvp_faction_reward_manager.cpp | 4 ++-- .../pvp_faction_reward_manager.h | 19 ++++++++----------- .../src/frontend_service/client_host.cpp | 1 + .../server/src/frontend_service/client_host.h | 12 ++++++------ .../frontend_service/distance_prioritizer.cpp | 1 + .../src/frontend_service/fe_receive_sub.h | 5 ++--- .../src/frontend_service/fe_receive_task.h | 7 +++---- .../src/frontend_service/frontend_service.cpp | 1 + .../frontend_service/processing_spreader.cpp | 2 +- 11 files changed, 30 insertions(+), 38 deletions(-) diff --git a/code/nel/include/nel/net/message_recorder.h b/code/nel/include/nel/net/message_recorder.h index c3a57c5f6..dfebb835f 100644 --- a/code/nel/include/nel/net/message_recorder.h +++ b/code/nel/include/nel/net/message_recorder.h @@ -28,9 +28,6 @@ #include #include -using namespace std; - - namespace NLNET { @@ -41,10 +38,10 @@ enum TNetworkEvent { Sending, Receiving, Connecting, ConnFailing, Accepting, Dis /// TNetworkEvent -> string -string EventToString( TNetworkEvent e ); +std::string EventToString( TNetworkEvent e ); /// string -> TNetworkEvent -TNetworkEvent StringToEvent( string& s ); +TNetworkEvent StringToEvent( std::string& s ); /* @@ -65,7 +62,7 @@ struct TMessageRecord nlassert( stream.stringMode() ); uint32 len; - string s_event; + std::string s_event; stream.serial( UpdateCounter ); if ( stream.isReading() ) { diff --git a/code/ryzom/client/src/interface_v3/chat_displayer.h b/code/ryzom/client/src/interface_v3/chat_displayer.h index 770fd8ea9..9c8120223 100644 --- a/code/ryzom/client/src/interface_v3/chat_displayer.h +++ b/code/ryzom/client/src/interface_v3/chat_displayer.h @@ -25,9 +25,6 @@ #include "nel/misc/mutex.h" -using namespace std; -using namespace NLMISC; - /** * class used to display console text commands in the chat window * \author Nicolas Brigand @@ -57,8 +54,8 @@ public: /// Display the string to the chat window virtual void doDisplay ( const NLMISC::CLog::TDisplayInfo& args, const char *message ) { - string temp = message; - string str; + std::string temp = message; + std::string str; CInterfaceManager::TSystemInfoMode mode; if (args.LogType == NLMISC::CLog::LOG_ERROR) { diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp index 1099b247e..cca91c289 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp @@ -30,7 +30,7 @@ #include "phrase_manager/phrase_utilities_functions.h" //#include "creature_manager/creature_manager.h" - +using namespace std; using namespace EFFECT_FAMILIES; using namespace NLLIGO; using namespace NLMISC; @@ -66,7 +66,7 @@ CPVPFactionRewardManager::CPVPFactionRewardManager() //---------------------------------------------------------------------------- void CPVPFactionRewardManager::_BuildTotemBasesRec( const IPrimitive* prim, - map >& neighboursNames, + std::map >& neighboursNames, map& totemBasesPerName ) { if ( !prim ) diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.h b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.h index 80c28a7a8..bfb1b1a5a 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.h +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.h @@ -22,9 +22,6 @@ #include "nel/ligo/primitive.h" #include "game_share/effect_families.h" -using namespace std; -using namespace EFFECT_FAMILIES; - class CCharacter; class CSEffect; class CTotemBase; @@ -52,7 +49,7 @@ class CPVPFactionRewardManager { DECLARE_PERSISTENCE_METHODS public : - typedef vector TPossessionsPerEffect; + typedef std::vector TPossessionsPerEffect; /// Totems levels with the number of totems needed to reach them enum TotemLevel @@ -65,7 +62,7 @@ public : }; /// Values of each effects - static sint32 EffectValues[ EndTotemEffects+1 ]; + static sint32 EffectValues[ EFFECT_FAMILIES::EndTotemEffects+1 ]; /// Returns the totem base for a given region using its ID const CTotemBase* getTotemBaseFromId( uint16 regionId ) { return _GetTotemBaseFromId( regionId ); } @@ -91,12 +88,12 @@ private : /// Get the effects a character would get on a totem void _GetTotemsEffectsRec( CCharacter* user, CTotemBase* pTotem, - vector& outEffects, vector& processed ); + std::vector& outEffects, std::vector& processed ); /// Remove all totem effects from a given player void _removeTotemsEffects( CCharacter* user ); /// Totem bases sorted by region - map _TotemBasesPerRegion; + std::map _TotemBasesPerRegion; /// Number of totems uint32 _NbTotems; @@ -106,8 +103,8 @@ private : /// Build the totem bases using the a LIGO primitive void _BuildTotemBasesRec( const NLLIGO::IPrimitive* prim, - map >& neighboursNames, - map& totemBasesPerName ); + std::map >& neighboursNames, + std::map& totemBasesPerName ); /// Have the totem bases been setup ? bool _InitDone; @@ -146,7 +143,7 @@ public : bool destroyTotem( uint16 regionIndex, TDataSetRow killerRowId ); /// Get the list of reward effects for a character depending on its coordinates - vector getTotemsEffects( CCharacter* user, std::vector& processed ); + std::vector getTotemsEffects( CCharacter* user, std::vector& processed ); /// Give totem rewards to a player void giveTotemsEffects( CCharacter* user ); @@ -176,7 +173,7 @@ public : PVP_CLAN::TPVPClan getRegionOwner( uint16 regionId ); /// send event message to ai - void sendEventToAI( const CTotemBase * totem, const string& event ); + void sendEventToAI( const CTotemBase * totem, const std::string& event ); /// send message when spire is attacked void spireAttacked( CCharacter * actor, CCreature * spire ); diff --git a/code/ryzom/server/src/frontend_service/client_host.cpp b/code/ryzom/server/src/frontend_service/client_host.cpp index 364e840fb..86bba619f 100644 --- a/code/ryzom/server/src/frontend_service/client_host.cpp +++ b/code/ryzom/server/src/frontend_service/client_host.cpp @@ -26,6 +26,7 @@ #include "id_impulsions.h" #include "uid_impulsions.h" +using namespace std; using namespace NLMISC; using namespace CLFECOMMON; diff --git a/code/ryzom/server/src/frontend_service/client_host.h b/code/ryzom/server/src/frontend_service/client_host.h index a8e377a29..9f2f22442 100644 --- a/code/ryzom/server/src/frontend_service/client_host.h +++ b/code/ryzom/server/src/frontend_service/client_host.h @@ -317,7 +317,7 @@ public: /// Return the current maximum number of bits that can fit in the outbox sint32 getCurrentThrottle() const { - return min( (sint32)(_MaxOutboxSizeInBit*2-_BitBandwidthUsageAvg), (sint32)(_MaxOutboxSizeInBit*3/2) ); + return std::min( (sint32)(_MaxOutboxSizeInBit*2-_BitBandwidthUsageAvg), (sint32)(_MaxOutboxSizeInBit*3/2) ); } /// Update the average bits filled that determine the throttle @@ -364,7 +364,7 @@ public: if ( _BitImpulsionUsageAvg < nominalBitSize ) availBitsize = nominalBitSize; else - availBitsize = max( (sint32)0, nominalBitSize*2 - _BitImpulsionUsageAvg ); + availBitsize = std::max( (sint32)0, nominalBitSize*2 - _BitImpulsionUsageAvg ); CMirrorPropValue availableImpulseBitsize( TheDataset, _EntityIndex, DSFirstPropertyAvailableImpulseBitSize ); #ifdef NL_DEBUG @@ -402,16 +402,16 @@ public: TUid Uid; /// User name (put on the NeL Launcher, transmitted by the login system) - string UserName; + std::string UserName; /// User privilege (put on the NeL Launcher, transmitted by the login system) - string UserPriv; + std::string UserPriv; /// User extended data (put on the NeL Launcher, transmitted by the login system) - string UserExtended; + std::string UserExtended; /// Language Id - string LanguageId; + std::string LanguageId; /// Login cookie NLNET::CLoginCookie LoginCookie; diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp index d71e60e0f..3c1e17f17 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp @@ -32,6 +32,7 @@ #include #endif +using namespace std; using namespace CLFECOMMON; using namespace NLMISC; using namespace NLNET; diff --git a/code/ryzom/server/src/frontend_service/fe_receive_sub.h b/code/ryzom/server/src/frontend_service/fe_receive_sub.h index d811ec74f..2792f42c5 100644 --- a/code/ryzom/server/src/frontend_service/fe_receive_sub.h +++ b/code/ryzom/server/src/frontend_service/fe_receive_sub.h @@ -30,7 +30,6 @@ #include "client_id_lookup.h" #include -using namespace std; extern bool verbosePacketLost; @@ -55,7 +54,7 @@ typedef std::list< std::pair > TClientsToRemove; enum TBadMessageFormatType { InsufficientSize=1, NotSystemLoginCode=2, BadCookie=4, BadSystemCode=8, HackedSizeInBuffer=16, AccessClosed=32, IrrelevantSystemMessage=64, MalformedAction=128, UnknownExceptionType=256, UnknownFormatType=512, UnauthorizedCharacterSlot=1024 }; /// Return the string for the message invalidity reasons -string getBadMessageString( uint32 reasons ); +std::string getBadMessageString( uint32 reasons ); /// Hacking description struct THackingDesc @@ -121,7 +120,7 @@ public: void release(); /// Add client - CClientHost *addClient( const NLNET::CInetAddress& addrfrom, TUid userId, const string &userName, const string &userPriv, const std::string & userExtended, const std::string & languageId, const NLNET::CLoginCookie &cookie, uint32 instanceId, uint8 authorisedCharSlot, bool sendCLConnect=true ); + CClientHost *addClient( const NLNET::CInetAddress& addrfrom, TUid userId, const std::string &userName, const std::string &userPriv, const std::string & userExtended, const std::string & languageId, const NLNET::CLoginCookie &cookie, uint32 instanceId, uint8 authorisedCharSlot, bool sendCLConnect=true ); /// Add to the list of clients which will be removed by addr at the three cycles later (leaving the time to send an impulsion to the client) void addToRemoveList( TClientId clientid ) { _ClientsToRemove.push_back( std::make_pair(clientid,3) ); } diff --git a/code/ryzom/server/src/frontend_service/fe_receive_task.h b/code/ryzom/server/src/frontend_service/fe_receive_task.h index 2eb31abed..093f7379f 100644 --- a/code/ryzom/server/src/frontend_service/fe_receive_task.h +++ b/code/ryzom/server/src/frontend_service/fe_receive_task.h @@ -30,7 +30,6 @@ #include "nel/net/udp_sock.h" #include -using namespace std; const uint32 MsgHeaderSize = 1; @@ -72,12 +71,12 @@ struct TReceivedMessage uint32 userSize() { return (uint32)_Data.size() - MsgHeaderSize; } /// Return the data vector (event type header byte + user data) - vector& data() { return _Data; } + std::vector& data() { return _Data; } private: /// One byte for event type (header), followed by user data - vector _Data; + std::vector _Data; public: @@ -85,7 +84,7 @@ public: NLNET::CInetAddress AddrFrom; /// Placeholder vector for address info - vector VAddrFrom; + std::vector VAddrFrom; }; diff --git a/code/ryzom/server/src/frontend_service/frontend_service.cpp b/code/ryzom/server/src/frontend_service/frontend_service.cpp index af27047b2..9b2ea65eb 100644 --- a/code/ryzom/server/src/frontend_service/frontend_service.cpp +++ b/code/ryzom/server/src/frontend_service/frontend_service.cpp @@ -61,6 +61,7 @@ # include #endif // NL_OS_WINDOWS +using namespace std; using namespace NLNET; using namespace NLMISC; using namespace CLFECOMMON; diff --git a/code/ryzom/server/src/frontend_service/processing_spreader.cpp b/code/ryzom/server/src/frontend_service/processing_spreader.cpp index 6c442a14e..448fe1135 100644 --- a/code/ryzom/server/src/frontend_service/processing_spreader.cpp +++ b/code/ryzom/server/src/frontend_service/processing_spreader.cpp @@ -83,7 +83,7 @@ void CProcessingSpreader::getProcessingBounds( THostMap::iterator& firstit, sint } sint maxNbClientsProcessedPerTick = MaxNbClients / ExecutionPeriod; - outerboundindex = firstindex + min( maxNbClientsProcessedPerTick, nbClients - firstindex ); + outerboundindex = firstindex + std::min( maxNbClientsProcessedPerTick, nbClients - firstindex ); _ClientMapIndex = outerboundindex; }