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-10 18:28:56 +03:00
committed by Martin Natano
parent f0680a29fc
commit 0cba3579de
534 changed files with 3456 additions and 3488 deletions
+39 -39
View File
@@ -41,9 +41,9 @@ RString unique_name(RString const& type)
void convert_xmls_in_dir(RString const& dirname)
{
vector<RString> listing;
std::vector<RString> listing;
FILEMAN->GetDirListing(dirname, listing, false, true);
for(vector<RString>::iterator curr_file= listing.begin();
for(std::vector<RString>::iterator curr_file= listing.begin();
curr_file != listing.end(); ++curr_file)
{
switch(ActorUtil::GetFileType(*curr_file))
@@ -83,7 +83,7 @@ RString maybe_conv_pos(RString pos, RString (*conv_func)(float p))
size_t after_slash_or_zero(RString const& s)
{
size_t ret= s.rfind('/');
if(ret != string::npos)
if(ret != std::string::npos)
{
return ret+1;
}
@@ -96,10 +96,10 @@ RString add_extension_to_relative_path_from_found_file(
size_t rel_last_slash= after_slash_or_zero(relative_path);
size_t found_last_slash= after_slash_or_zero(found_file);
return relative_path.Left(rel_last_slash) +
found_file.substr(found_last_slash, string::npos);
found_file.substr(found_last_slash, std::string::npos);
}
bool verify_arg_count(RString cmd, vector<RString>& args, size_t req)
bool verify_arg_count(RString cmd, std::vector<RString>& args, size_t req)
{
if(args.size() < req)
{
@@ -109,15 +109,15 @@ bool verify_arg_count(RString cmd, vector<RString>& args, size_t req)
return true;
}
typedef void (*arg_converter_t)(vector<RString>& args);
typedef void (*arg_converter_t)(std::vector<RString>& args);
map<RString, arg_converter_t> arg_converters;
map<RString, size_t> tween_counters;
set<RString> fields_that_are_strings;
map<RString, RString> chunks_to_replace;
std::map<RString, arg_converter_t> arg_converters;
std::map<RString, size_t> tween_counters;
std::set<RString> fields_that_are_strings;
std::map<RString, RString> chunks_to_replace;
#define COMMON_ARG_VERIFY(count) if(!verify_arg_count(args[0], args, count)) return;
void x_conv(vector<RString>& args)
void x_conv(std::vector<RString>& args)
{
COMMON_ARG_VERIFY(2);
float pos;
@@ -126,7 +126,7 @@ void x_conv(vector<RString>& args)
args[1]= convert_xpos(pos);
}
}
void y_conv(vector<RString>& args)
void y_conv(std::vector<RString>& args)
{
COMMON_ARG_VERIFY(2);
float pos;
@@ -135,16 +135,16 @@ void y_conv(vector<RString>& args)
args[1]= convert_ypos(pos);
}
}
void string_arg_conv(vector<RString>& args)
void string_arg_conv(std::vector<RString>& args)
{
COMMON_ARG_VERIFY(2);
args[1]= "\"" + args[1] + "\"";
}
void lower_string_conv(vector<RString>& args)
void lower_string_conv(std::vector<RString>& args)
{
args[0].MakeLower();
}
void hidden_conv(vector<RString>& args)
void hidden_conv(std::vector<RString>& args)
{
COMMON_ARG_VERIFY(2);
args[0]= "visible";
@@ -157,7 +157,7 @@ void hidden_conv(vector<RString>& args)
args[1]= "true";
}
}
void diffuse_conv(vector<RString>& args)
void diffuse_conv(std::vector<RString>& args)
{
COMMON_ARG_VERIFY(2);
RString retarg;
@@ -176,7 +176,7 @@ void diffuse_conv(vector<RString>& args)
// Prototype for a function that is created by a macro in another translation unit and has no visible prototype, don't do this unless you have a good reason.
const RString& BlendModeToString(BlendMode);
const RString& CullModeToString(CullMode);
void blend_conv(vector<RString>& args)
void blend_conv(std::vector<RString>& args)
{
COMMON_ARG_VERIFY(2);
for(int i= 0; i < NUM_BlendMode; ++i)
@@ -190,7 +190,7 @@ void blend_conv(vector<RString>& args)
}
}
}
void cull_conv(vector<RString>& args)
void cull_conv(std::vector<RString>& args)
{
COMMON_ARG_VERIFY(2);
for(int i= 0; i < NUM_CullMode; ++i)
@@ -246,7 +246,7 @@ void init_parser_helpers()
void convert_lua_chunk(RString& chunk_text)
{
for(map<RString, RString>::iterator chunk= chunks_to_replace.begin();
for(std::map<RString, RString>::iterator chunk= chunks_to_replace.begin();
chunk != chunks_to_replace.end(); ++chunk)
{
chunk_text.Replace(chunk->first, chunk->second);
@@ -257,8 +257,8 @@ void convert_lua_chunk(RString& chunk_text)
// So condition_set_t::iterator->first is the lua to execute for the
// condition, and condition_set_t::iterator->second is the name of the
// condition.
typedef map<RString, RString> condition_set_t;
typedef map<RString, RString> field_cont_t;
typedef std::map<RString, RString> condition_set_t;
typedef std::map<RString, RString> field_cont_t;
struct frame_t
{
int frame;
@@ -272,8 +272,8 @@ struct actor_template_t
field_cont_t fields;
RString condition;
RString name;
vector<frame_t> frames;
vector<actor_template_t> children;
std::vector<frame_t> frames;
std::vector<actor_template_t> children;
RString x;
RString y;
void make_space_for_frame(int id);
@@ -305,19 +305,19 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm
fields[cmd_name]= cmd_text;
return;
}
vector<RString> cmds;
std::vector<RString> cmds;
split(full_cmd, ";", cmds, true);
size_t queue_size= 0;
// If someone has a simfile that uses a playcommand that pushes tween
// states onto the queue, queue size counting will have to be made much
// more complex to prevent that from causing an overflow.
for(vector<RString>::iterator cmd= cmds.begin(); cmd != cmds.end(); ++cmd)
for(std::vector<RString>::iterator cmd= cmds.begin(); cmd != cmds.end(); ++cmd)
{
vector<RString> args;
std::vector<RString> args;
split(*cmd, ",", args, true);
if(!args.empty())
{
for(vector<RString>::iterator arg= args.begin(); arg != args.end(); ++arg)
for(std::vector<RString>::iterator arg= args.begin(); arg != args.end(); ++arg)
{
size_t first_nonspace= 0;
size_t last_nonspace= arg->size();
@@ -331,12 +331,12 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm
}
*arg= arg->substr(first_nonspace, last_nonspace - first_nonspace);
}
map<RString, arg_converter_t>::iterator conv= arg_converters.find(args[0]);
std::map<RString, arg_converter_t>::iterator conv= arg_converters.find(args[0]);
if(conv != arg_converters.end())
{
conv->second(args);
}
map<RString, size_t>::iterator counter= tween_counters.find(args[0]);
std::map<RString, size_t>::iterator counter= tween_counters.find(args[0]);
if(counter != tween_counters.end())
{
queue_size+= counter->second;
@@ -353,15 +353,15 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm
size_t states_per= (queue_size / num_to_make) + 1;
size_t states_in_curr= 0;
RString this_name= cmd_name;
vector<RString> curr_cmd;
for(vector<RString>::iterator cmd= cmds.begin(); cmd != cmds.end(); ++cmd)
std::vector<RString> curr_cmd;
for(std::vector<RString>::iterator cmd= cmds.begin(); cmd != cmds.end(); ++cmd)
{
curr_cmd.push_back(*cmd);
vector<RString> args;
std::vector<RString> args;
split(*cmd, ",", args, true);
if(!args.empty())
{
map<RString, size_t>::iterator counter= tween_counters.find(args[0]);
std::map<RString, size_t>::iterator counter= tween_counters.find(args[0]);
if(counter != tween_counters.end())
{
states_in_curr+= counter->second;
@@ -547,11 +547,11 @@ void actor_template_t::load_node(XNode const& node, RString const& dirname, cond
}
else
{
vector<RString> files_in_dir;
std::vector<RString> files_in_dir;
FILEMAN->GetDirListing(sfname + "*", files_in_dir, false, true);
int handled_level= 0;
RString found_file= "";
for(vector<RString>::iterator file= files_in_dir.begin();
for(std::vector<RString>::iterator file= files_in_dir.begin();
file != files_in_dir.end() && handled_level < 2; ++file)
{
RString extension= GetExtension(*file);
@@ -684,7 +684,7 @@ void actor_template_t::output_to_file(RageFile* file, RString const& indent)
{
file->Write(subindent + "Frames= {\n");
RString frameindent= subindent + " ";
for(vector<frame_t>::iterator frame= frames.begin();
for(std::vector<frame_t>::iterator frame= frames.begin();
frame != frames.end(); ++frame)
{
file->Write(frameindent + "{Frame= " + std::to_string(frame->frame) +
@@ -695,7 +695,7 @@ void actor_template_t::output_to_file(RageFile* file, RString const& indent)
for(field_cont_t::iterator field= fields.begin();
field != fields.end(); ++field)
{
set<RString>::iterator is_string= fields_that_are_strings.find(field->first);
std::set<RString>::iterator is_string= fields_that_are_strings.find(field->first);
if(is_string != fields_that_are_strings.end())
{
file->Write(subindent + field->first + "= \"" + field->second + "\",\n");
@@ -705,7 +705,7 @@ void actor_template_t::output_to_file(RageFile* file, RString const& indent)
file->Write(subindent + field->first + "= " + field->second + ",\n");
}
}
for(vector<actor_template_t>::iterator child= children.begin();
for(std::vector<actor_template_t>::iterator child= children.begin();
child != children.end(); ++child)
{
child->output_to_file(file, subindent);
@@ -767,7 +767,7 @@ int LuaFunc_convert_xml_bgs(lua_State* L);
int LuaFunc_convert_xml_bgs(lua_State* L)
{
RString dir= SArg(1);
vector<RString> xml_list;
std::vector<RString> xml_list;
convert_xmls_in_dir(dir + "/");
return 0;
}