Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements

Fix whitespace changes
This commit is contained in:
Michael Sundqvist
2022-07-31 22:14:38 +02:00
committed by Martin Natano
parent f0680a29fc
commit 0cba3579de
534 changed files with 3456 additions and 3488 deletions
+13 -13
View File
@@ -18,7 +18,7 @@
// Actor registration
static map<RString,CreateActorFn> *g_pmapRegistrees = nullptr;
static std::map<RString,CreateActorFn> *g_pmapRegistrees = nullptr;
static bool IsRegistered( const RString& sClassName )
{
@@ -28,9 +28,9 @@ static bool IsRegistered( const RString& sClassName )
void ActorUtil::Register( const RString& sClassName, CreateActorFn pfn )
{
if( g_pmapRegistrees == nullptr )
g_pmapRegistrees = new map<RString,CreateActorFn>;
g_pmapRegistrees = new std::map<RString,CreateActorFn>;
map<RString,CreateActorFn>::iterator iter = g_pmapRegistrees->find( sClassName );
std::map<RString,CreateActorFn>::iterator iter = g_pmapRegistrees->find( sClassName );
ASSERT_M( iter == g_pmapRegistrees->end(), ssprintf("Actor class '%s' already registered.", sClassName.c_str()) );
(*g_pmapRegistrees)[sClassName] = pfn;
@@ -48,7 +48,7 @@ bool ActorUtil::ResolvePath( RString &sPath, const RString &sName, bool optional
RageFileManager::FileType ft = FILEMAN->GetFileType( sPath );
if( ft != RageFileManager::TYPE_FILE && ft != RageFileManager::TYPE_DIR )
{
vector<RString> asPaths;
std::vector<RString> asPaths;
GetDirListing( sPath + "*", asPaths, false, true ); // return path too
if( asPaths.empty() )
@@ -193,7 +193,7 @@ Actor *ActorUtil::LoadFromNode( const XNode* _pNode, Actor *pParentActor )
if( !bHasClass && bLegacy )
sClass = GetLegacyActorClass( &node );
map<RString,CreateActorFn>::iterator iter = g_pmapRegistrees->find( sClass );
std::map<RString,CreateActorFn>::iterator iter = g_pmapRegistrees->find( sClass );
if( iter == g_pmapRegistrees->end() )
{
RString sFile;
@@ -305,7 +305,7 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor )
{
case FT_Lua:
{
unique_ptr<XNode> pNode( LoadXNodeFromLuaShowErrors(sPath) );
std::unique_ptr<XNode> pNode( LoadXNodeFromLuaShowErrors(sPath) );
if( pNode.get() == nullptr )
{
// XNode will warn about the error
@@ -471,7 +471,7 @@ void ActorUtil::LoadAllCommands( Actor& actor, const RString &sMetricsGroup )
void ActorUtil::LoadAllCommandsFromName( Actor& actor, const RString &sMetricsGroup, const RString &sName )
{
set<RString> vsValueNames;
std::set<RString> vsValueNames;
THEME->GetMetricsThatBeginWith( sMetricsGroup, sName, vsValueNames );
for (RString const & sv : vsValueNames)
@@ -490,7 +490,7 @@ static bool CompareActorsByZPosition(const Actor *p1, const Actor *p2)
return p1->GetZ() < p2->GetZ();
}
void ActorUtil::SortByZPosition( vector<Actor*> &vActors )
void ActorUtil::SortByZPosition( std::vector<Actor*> &vActors )
{
// Preserve ordering of Actors with equal Z positions.
stable_sort( vActors.begin(), vActors.end(), CompareActorsByZPosition );
@@ -511,8 +511,8 @@ XToString( FileType );
LuaXType( FileType );
// convenience so the for-loop lines can be shorter.
typedef map<RString, FileType> etft_cont_t;
typedef map<FileType, vector<RString> > fttel_cont_t;
typedef std::map<RString, FileType> etft_cont_t;
typedef std::map<FileType, std::vector<RString> > fttel_cont_t;
etft_cont_t ExtensionToFileType;
fttel_cont_t FileTypeToExtensionList;
@@ -569,18 +569,18 @@ void ActorUtil::InitFileTypeLists()
}
}
vector<RString> const& ActorUtil::GetTypeExtensionList(FileType ft)
std::vector<RString> const& ActorUtil::GetTypeExtensionList(FileType ft)
{
return FileTypeToExtensionList[ft];
}
void ActorUtil::AddTypeExtensionsToList(FileType ft, vector<RString>& add_to)
void ActorUtil::AddTypeExtensionsToList(FileType ft, std::vector<RString>& add_to)
{
fttel_cont_t::iterator ext_list= FileTypeToExtensionList.find(ft);
if(ext_list != FileTypeToExtensionList.end())
{
add_to.reserve(add_to.size() + ext_list->second.size());
for(vector<RString>::iterator curr= ext_list->second.begin();
for(std::vector<RString>::iterator curr= ext_list->second.begin();
curr != ext_list->second.end(); ++curr)
{
add_to.push_back(*curr);