From e8945fbb15e472afca16fe1c3f36997742a2d64a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Jul 2015 08:17:00 +0200 Subject: Common types cleanup (strings, cstrings) --- build/cli/rule.cxx | 5 +++-- build/config/utility | 3 +-- build/cxx/rule.cxx | 14 +++++++------- build/diagnostics | 4 ++-- build/types | 9 ++++++--- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/build/cli/rule.cxx b/build/cli/rule.cxx index 889e6a2..9abe665 100644 --- a/build/cli/rule.cxx +++ b/build/cli/rule.cxx @@ -6,6 +6,7 @@ #include +#include #include #include #include @@ -183,7 +184,7 @@ namespace build } static void - append_extension (vector& args, + append_extension (cstrings& args, path_target& t, const char* option, const char* default_extension) @@ -224,7 +225,7 @@ namespace build scope& rs (t.root_scope ()); const string& cli (rs["config.cli"].as ()); - vector args {cli.c_str ()}; + cstrings args {cli.c_str ()}; // See if we need to pass any --?xx-suffix options. // diff --git a/build/config/utility b/build/config/utility index c2209e4..8ab6afe 100644 --- a/build/config/utility +++ b/build/config/utility @@ -5,7 +5,6 @@ #ifndef BUILD_CONFIG_UTILITY #define BUILD_CONFIG_UTILITY -#include #include #include // pair @@ -47,7 +46,7 @@ namespace build // template void - append_options (std::vector& args, T& s, const char* var) + append_options (cstrings& args, T& s, const char* var) { if (auto val = s[var]) { diff --git a/build/cxx/rule.cxx b/build/cxx/rule.cxx index 7547201..e0e5c0f 100644 --- a/build/cxx/rule.cxx +++ b/build/cxx/rule.cxx @@ -6,7 +6,6 @@ #include #include -#include #include // size_t #include // exit #include // move() @@ -17,6 +16,7 @@ #include #include +#include #include #include #include @@ -40,7 +40,7 @@ namespace build using config::append_options; static void - append_std (vector& args, target& t, string& opt) + append_std (cstrings& args, target& t, string& opt) { if (auto val = t["cxx.std"]) { @@ -66,7 +66,7 @@ namespace build // recursively, prerequisite libraries first. // static void - append_lib_options (vector& args, target& l, const char* var) + append_lib_options (cstrings& args, target& l, const char* var) { for (target* t: l.prerequisite_targets) { @@ -381,7 +381,7 @@ namespace build scope& rs (t.root_scope ()); const string& cxx (rs["config.cxx"].as ()); - vector args {cxx.c_str ()}; + cstrings args {cxx.c_str ()}; // Add cxx.export.poptions from prerequisite libraries. Note // that here we don't need to see group members (see apply()). @@ -725,7 +725,7 @@ namespace build scope& rs (t.root_scope ()); const string& cxx (rs["config.cxx"].as ()); - vector args {cxx.c_str ()}; + cstrings args {cxx.c_str ()}; // Add cxx.export.poptions from prerequisite libraries. Note that // here we don't need to see group members (see apply()). @@ -1175,7 +1175,7 @@ namespace build path relt (relative (t.path ())); scope& rs (t.root_scope ()); - vector args; + cstrings args; string storage1; if (lt == type::a) @@ -1206,7 +1206,7 @@ namespace build // Reserve enough space so that we don't reallocate. Reallocating // means pointers to elements may no longer be valid. // - vector relo; + paths relo; relo.reserve (t.prerequisite_targets.size ()); for (target* pt: t.prerequisite_targets) diff --git a/build/diagnostics b/build/diagnostics index 6c528f2..3f05688 100644 --- a/build/diagnostics +++ b/build/diagnostics @@ -5,7 +5,6 @@ #ifndef BUILD_DIAGNOSTICS #define BUILD_DIAGNOSTICS -#include #include #include #include @@ -16,6 +15,7 @@ #include +#include #include namespace build @@ -72,7 +72,7 @@ namespace build print_process (const char* const* args); inline void - print_process (const std::vector& args) + print_process (const cstrings& args) { print_process (args.data ()); } diff --git a/build/types b/build/types index 5f6b3de..0a71252 100644 --- a/build/types +++ b/build/types @@ -6,6 +6,7 @@ #define BUILD_TYPES #include +#include #include #include @@ -16,6 +17,8 @@ namespace build { // Commonly-used types. // + using strings = std::vector; + using cstrings = std::vector; // // @@ -24,6 +27,9 @@ namespace build using butl::basic_path; using butl::invalid_path; + using paths = std::vector; + using dir_paths = std::vector; + // // using butl::system_clock; @@ -32,9 +38,6 @@ namespace build using butl::timestamp_unknown; using butl::timestamp_nonexistent; using butl::operator<<; - - typedef std::vector paths; - typedef std::vector dir_paths; } #endif // BUILD_TYPES -- cgit v1.1