diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/build-remote/build-remote.cc | 2 | ||||
-rw-r--r-- | src/libexpr/nixexpr.hh | 4 | ||||
-rw-r--r-- | src/libexpr/parser.y | 16 | ||||
-rw-r--r-- | src/libexpr/primops.cc | 4 | ||||
-rw-r--r-- | src/libutil/config.cc | 4 | ||||
-rw-r--r-- | src/libutil/types.hh | 3 | ||||
-rw-r--r-- | src/libutil/util.cc | 2 | ||||
-rw-r--r-- | src/libutil/util.hh | 2 | ||||
-rw-r--r-- | src/nix-env/nix-env.cc | 6 |
9 files changed, 21 insertions, 22 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc index 9d541b45d..4d7b602d8 100644 --- a/src/build-remote/build-remote.cc +++ b/src/build-remote/build-remote.cc @@ -208,7 +208,7 @@ static int main_build_remote(int argc, char * * argv) for (auto & m : machines) error - % concatStringsSep<vector<string>>(", ", m.systemTypes) + % concatStringsSep<std::vector<string>>(", ", m.systemTypes) % m.maxJobs % concatStringsSep<StringSet>(", ", m.supportedFeatures) % concatStringsSep<StringSet>(", ", m.mandatoryFeatures); diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh index 6f6acb074..e7f717eba 100644 --- a/src/libexpr/nixexpr.hh +++ b/src/libexpr/nixexpr.hh @@ -335,8 +335,8 @@ struct ExprConcatStrings : Expr { Pos pos; bool forceString; - vector<std::pair<Pos, Expr *> > * es; - ExprConcatStrings(const Pos & pos, bool forceString, vector<std::pair<Pos, Expr *> > * es) + std::vector<std::pair<Pos, Expr *> > * es; + ExprConcatStrings(const Pos & pos, bool forceString, std::vector<std::pair<Pos, Expr *> > * es) : pos(pos), forceString(forceString), es(es) { }; COMMON_METHODS }; diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index f0c80ebd5..e1d177c1f 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -193,7 +193,7 @@ static Formals * toFormals(ParseData & data, ParserFormals * formals, static Expr * stripIndentation(const Pos & pos, SymbolTable & symbols, - vector<std::pair<Pos, std::variant<Expr *, StringToken> > > & es) + std::vector<std::pair<Pos, std::variant<Expr *, StringToken> > > & es) { if (es.empty()) return new ExprString(""); @@ -233,7 +233,7 @@ static Expr * stripIndentation(const Pos & pos, SymbolTable & symbols, } /* Strip spaces from each line. */ - vector<std::pair<Pos, Expr *> > * es2 = new vector<std::pair<Pos, Expr *> >; + std::vector<std::pair<Pos, Expr *> > * es2 = new std::vector<std::pair<Pos, Expr *> >; atStartOfLine = true; size_t curDropped = 0; size_t n = es.size(); @@ -415,7 +415,7 @@ expr_op | expr_op UPDATE expr_op { $$ = new ExprOpUpdate(CUR_POS, $1, $3); } | expr_op '?' attrpath { $$ = new ExprOpHasAttr($1, *$3); } | expr_op '+' expr_op - { $$ = new ExprConcatStrings(CUR_POS, false, new vector<std::pair<Pos, Expr *> >({{makeCurPos(@1, data), $1}, {makeCurPos(@3, data), $3}})); } + { $$ = new ExprConcatStrings(CUR_POS, false, new std::vector<std::pair<Pos, Expr *> >({{makeCurPos(@1, data), $1}, {makeCurPos(@3, data), $3}})); } | expr_op '-' expr_op { $$ = new ExprCall(CUR_POS, new ExprVar(data->symbols.create("__sub")), {$1, $3}); } | expr_op '*' expr_op { $$ = new ExprCall(CUR_POS, new ExprVar(data->symbols.create("__mul")), {$1, $3}); } | expr_op '/' expr_op { $$ = new ExprCall(CUR_POS, new ExprVar(data->symbols.create("__div")), {$1, $3}); } @@ -503,9 +503,9 @@ string_parts_interpolated : string_parts_interpolated STR { $$ = $1; $1->emplace_back(makeCurPos(@2, data), new ExprString(string($2))); } | string_parts_interpolated DOLLAR_CURLY expr '}' { $$ = $1; $1->emplace_back(makeCurPos(@2, data), $3); } - | DOLLAR_CURLY expr '}' { $$ = new vector<std::pair<Pos, Expr *> >; $$->emplace_back(makeCurPos(@1, data), $2); } + | DOLLAR_CURLY expr '}' { $$ = new std::vector<std::pair<Pos, Expr *> >; $$->emplace_back(makeCurPos(@1, data), $2); } | STR DOLLAR_CURLY expr '}' { - $$ = new vector<std::pair<Pos, Expr *> >; + $$ = new std::vector<std::pair<Pos, Expr *> >; $$->emplace_back(makeCurPos(@1, data), new ExprString(string($1))); $$->emplace_back(makeCurPos(@2, data), $3); } @@ -528,7 +528,7 @@ path_start ind_string_parts : ind_string_parts IND_STR { $$ = $1; $1->emplace_back(makeCurPos(@2, data), $2); } | ind_string_parts DOLLAR_CURLY expr '}' { $$ = $1; $1->emplace_back(makeCurPos(@2, data), $3); } - | { $$ = new vector<std::pair<Pos, std::variant<Expr *, StringToken> > >; } + | { $$ = new std::vector<std::pair<Pos, std::variant<Expr *, StringToken> > >; } ; binds @@ -582,9 +582,9 @@ attrpath } else $$->push_back(AttrName($3)); } - | attr { $$ = new vector<AttrName>; $$->push_back(AttrName(data->symbols.create($1))); } + | attr { $$ = new std::vector<AttrName>; $$->push_back(AttrName(data->symbols.create($1))); } | string_attr - { $$ = new vector<AttrName>; + { $$ = new std::vector<AttrName>; ExprString *str = dynamic_cast<ExprString *>($1); if (str) { $$->push_back(AttrName(data->symbols.create(str->s))); diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 44f0b19bc..daf679a5a 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -3649,12 +3649,12 @@ static void prim_replaceStrings(EvalState & state, const Pos & pos, Value * * ar .errPos = pos }); - vector<string> from; + std::vector<string> from; from.reserve(args[0]->listSize()); for (auto elem : args[0]->listItems()) from.emplace_back(state.forceString(*elem, pos)); - vector<std::pair<string, PathSet>> to; + std::vector<std::pair<string, PathSet>> to; to.reserve(args[1]->listSize()); for (auto elem : args[1]->listItems()) { PathSet ctx; diff --git a/src/libutil/config.cc b/src/libutil/config.cc index 92ab265d3..8e05f1765 100644 --- a/src/libutil/config.cc +++ b/src/libutil/config.cc @@ -90,7 +90,7 @@ void AbstractConfig::applyConfig(const std::string & contents, const std::string if (hash != string::npos) line = string(line, 0, hash); - vector<string> tokens = tokenizeString<vector<string> >(line); + auto tokens = tokenizeString<std::vector<string>>(line); if (tokens.empty()) continue; if (tokens.size() < 2) @@ -122,7 +122,7 @@ void AbstractConfig::applyConfig(const std::string & contents, const std::string string name = tokens[0]; - vector<string>::iterator i = tokens.begin(); + auto i = tokens.begin(); advance(i, 2); set(name, concatStringsSep(" ", Strings(i, tokens.end()))); // FIXME: slow diff --git a/src/libutil/types.hh b/src/libutil/types.hh index 057c9021c..a26c9a966 100644 --- a/src/libutil/types.hh +++ b/src/libutil/types.hh @@ -11,7 +11,6 @@ namespace nix { -using std::vector; using std::string; typedef std::list<string> Strings; @@ -25,7 +24,7 @@ typedef std::string_view PathView; typedef std::list<Path> Paths; typedef std::set<Path> PathSet; -typedef vector<std::pair<string, string>> Headers; +typedef std::vector<std::pair<string, string>> Headers; /* Helper class to run code at startup. */ template<typename T> diff --git a/src/libutil/util.cc b/src/libutil/util.cc index b6041264e..b172e0554 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -1250,7 +1250,7 @@ template<class C> C tokenizeString(std::string_view s, std::string_view separato template Strings tokenizeString(std::string_view s, std::string_view separators); template StringSet tokenizeString(std::string_view s, std::string_view separators); -template vector<string> tokenizeString(std::string_view s, std::string_view separators); +template std::vector<string> tokenizeString(std::string_view s, std::string_view separators); string chomp(std::string_view s) diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 319442210..a949e6424 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -99,7 +99,7 @@ struct DirEntry : name(name), ino(ino), type(type) { } }; -typedef vector<DirEntry> DirEntries; +typedef std::vector<DirEntry> DirEntries; DirEntries readDirectory(const Path & path); diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index d2636abf7..52d07e3df 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -840,7 +840,7 @@ void printTable(Table & table) { auto nrColumns = table.size() > 0 ? table.front().size() : 0; - vector<size_t> widths; + std::vector<size_t> widths; widths.resize(nrColumns); for (auto & i : table) { @@ -907,7 +907,7 @@ static VersionDiff compareVersionAgainstSet( } -static void queryJSON(Globals & globals, vector<DrvInfo> & elems, bool printOutPath, bool printMeta) +static void queryJSON(Globals & globals, std::vector<DrvInfo> & elems, bool printOutPath, bool printMeta) { JSONObject topObj(cout, true); for (auto & i : elems) { @@ -1020,7 +1020,7 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) /* Sort them by name. */ /* !!! */ - vector<DrvInfo> elems; + std::vector<DrvInfo> elems; for (auto & i : elems_) elems.push_back(i); sort(elems.begin(), elems.end(), cmpElemByName); |