From fe9afb65bb35737a144acd612170b2e284298a2f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 21 Feb 2022 16:28:23 +0100 Subject: [PATCH] Remove std::set alias --- src/libexpr/get-drvs.cc | 2 +- src/libexpr/primops.cc | 2 +- src/libstore/build/derivation-goal.cc | 2 +- src/libstore/build/goal.hh | 4 ++-- src/libstore/build/worker.cc | 4 ++-- src/libstore/build/worker.hh | 4 ++-- src/libstore/local-store.hh | 2 +- src/libutil/types.hh | 5 ++--- src/libutil/util.cc | 2 +- src/libutil/util.hh | 2 +- src/nix/repl.cc | 2 +- 11 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index 5995a857b..167fb5fa9 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -266,7 +266,7 @@ void DrvInfo::setMeta(const string & name, Value * v) /* Cache for already considered attrsets. */ -typedef set Done; +typedef std::set Done; /* Evaluate value `v'. If it evaluates to a set of type `derivation', diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 6f79fc49d..44f0b19bc 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -654,7 +654,7 @@ static void prim_genericClosure(EvalState & state, const Pos & pos, Value * * ar // `doneKeys' doesn't need to be a GC root, because its values are // reachable from res. auto cmp = CompareValues(state); - set doneKeys(cmp); + std::set doneKeys(cmp); while (!workSet.empty()) { Value * e = *(workSet.begin()); workSet.pop_front(); diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index 151217b8b..27f8c6257 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -1091,7 +1091,7 @@ HookReply DerivationGoal::tryBuildHook() /* Create the log file and pipe. */ Path logFile = openLogFile(); - set fds; + std::set fds; fds.insert(hook->fromHook.readSide.get()); fds.insert(hook->builderOut.readSide.get()); worker.childStarted(shared_from_this(), fds, false, false); diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh index 192e416d2..0db0c1938 100644 --- a/src/libstore/build/goal.hh +++ b/src/libstore/build/goal.hh @@ -18,8 +18,8 @@ struct CompareGoalPtrs { }; /* Set of goals. */ -typedef set Goals; -typedef set> WeakGoals; +typedef std::set Goals; +typedef std::set> WeakGoals; /* A map of paths to goals (and the other way around). */ typedef std::map WeakGoalMap; diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc index f11c5ce68..0a6108233 100644 --- a/src/libstore/build/worker.cc +++ b/src/libstore/build/worker.cc @@ -161,7 +161,7 @@ unsigned Worker::getNrLocalBuilds() } -void Worker::childStarted(GoalPtr goal, const set & fds, +void Worker::childStarted(GoalPtr goal, const std::set & fds, bool inBuildSlot, bool respectTimeouts) { Child child; @@ -377,7 +377,7 @@ void Worker::waitForInput() GoalPtr goal = j->goal.lock(); assert(goal); - set fds2(j->fds); + std::set fds2(j->fds); std::vector buffer(4096); for (auto & k : fds2) { if (pollStatus.at(fdToPollStatus.at(k)).revents) { diff --git a/src/libstore/build/worker.hh b/src/libstore/build/worker.hh index 6a3b99c02..a1e036a96 100644 --- a/src/libstore/build/worker.hh +++ b/src/libstore/build/worker.hh @@ -38,7 +38,7 @@ struct Child { WeakGoalPtr goal; Goal * goal2; // ugly hackery - set fds; + std::set fds; bool respectTimeouts; bool inBuildSlot; steady_time_point lastOutput; /* time we last got output on stdout/stderr */ @@ -167,7 +167,7 @@ public: /* Registers a running child process. `inBuildSlot' means that the process counts towards the jobs limit. */ - void childStarted(GoalPtr goal, const set & fds, + void childStarted(GoalPtr goal, const std::set & fds, bool inBuildSlot, bool respectTimeouts); /* Unregisters a running child process. `wakeSleepers' should be diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 46aed9bcb..a9c7475ac 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -292,7 +292,7 @@ private: typedef std::pair Inode; -typedef set InodesSeen; +typedef std::set InodesSeen; /* "Fix", or canonicalise, the meta-data of the files in a store path diff --git a/src/libutil/types.hh b/src/libutil/types.hh index 130c04451..057c9021c 100644 --- a/src/libutil/types.hh +++ b/src/libutil/types.hh @@ -11,12 +11,11 @@ namespace nix { -using std::set; using std::vector; using std::string; typedef std::list Strings; -typedef set StringSet; +typedef std::set StringSet; typedef std::map StringMap; /* Paths are just strings. */ @@ -24,7 +23,7 @@ typedef std::map StringMap; typedef string Path; typedef std::string_view PathView; typedef std::list Paths; -typedef set PathSet; +typedef std::set PathSet; typedef vector> Headers; diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 9c2e43cdd..b6041264e 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -1174,7 +1174,7 @@ void runProgram2(const RunOptions & options) } -void closeMostFDs(const set & exceptions) +void closeMostFDs(const std::set & exceptions) { #if __linux__ try { diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 579a42785..319442210 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -343,7 +343,7 @@ std::vector stringsToCharPtrs(const Strings & ss); /* Close all file descriptors except those listed in the given set. Good practice in child processes. */ -void closeMostFDs(const set & exceptions); +void closeMostFDs(const std::set & exceptions); /* Set the close-on-exec flag for the given file descriptor. */ void closeOnExec(int fd); diff --git a/src/nix/repl.cc b/src/nix/repl.cc index 2c39fac91..60454471d 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -75,7 +75,7 @@ struct NixRepl Expr * parseString(string s); void evalString(string s, Value & v); - typedef set ValuesSeen; + typedef std::set ValuesSeen; std::ostream & printValue(std::ostream & str, Value & v, unsigned int maxDepth); std::ostream & printValue(std::ostream & str, Value & v, unsigned int maxDepth, ValuesSeen & seen); };