diff options
author | Vincent Ambo <mail@tazj.in> | 2020-08-21T02·23+0100 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2020-08-21T03·55+0000 |
commit | 7edbe59c6c70cd085fc68c4317c3a71a40ac21e5 (patch) | |
tree | b036747e1c9615c2abbd58560353e704d51bc922 /third_party/nix/src/nix | |
parent | 674d921202754661bfcc02ef8fe40ade227349cb (diff) |
style(tvix): Replace remaining typedefs with using statements r/1702
Change (mostly) created via: fd . -e hh -e cc | parallel clang-tidy -p ~/builds/nix --fix "'--checks=-*,modernize-use-using'" Change-Id: I90ad6e64a5399f2005dfb9956074ec51c2c78cea Reviewed-on: https://cl.tvl.fyi/c/depot/+/1830 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to '')
-rw-r--r-- | third_party/nix/src/nix-env/nix-env.cc | 10 | ||||
-rw-r--r-- | third_party/nix/src/nix/command.hh | 4 | ||||
-rw-r--r-- | third_party/nix/src/nix/legacy.hh | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/third_party/nix/src/nix-env/nix-env.cc b/third_party/nix/src/nix-env/nix-env.cc index 9c0931e7f4..830bd514da 100644 --- a/third_party/nix/src/nix-env/nix-env.cc +++ b/third_party/nix/src/nix-env/nix-env.cc @@ -32,14 +32,14 @@ using namespace nix; using std::cout; -typedef enum { +using InstallSourceType = enum { srcNixExprDrvs, srcNixExprs, srcStorePaths, srcProfile, srcAttrPath, srcUnknown -} InstallSourceType; +}; struct InstallSourceInfo { InstallSourceType type; @@ -229,7 +229,7 @@ static DrvInfos filterBySelector(EvalState& state, const DrvInfos& allElems, std::set<unsigned int> done; for (auto& i : selectors) { - typedef std::list<std::pair<DrvInfo, unsigned int> > Matches; + using Matches = std::list<std::pair<DrvInfo, unsigned int> >; Matches matches; unsigned int n = 0; for (auto j = allElems.begin(); j != allElems.end(); ++j, ++n) { @@ -249,7 +249,7 @@ static DrvInfos filterBySelector(EvalState& state, const DrvInfos& allElems, arbitrarily pick the first one. */ if (newestOnly) { /* Map from package names to derivations. */ - typedef std::map<std::string, std::pair<DrvInfo, unsigned int> > Newest; + using Newest = std::map<std::string, std::pair<DrvInfo, unsigned int> >; Newest newest; StringSet multiple; @@ -834,7 +834,7 @@ void printTable(Table& table) { least one element with a higher version in the set. `cvUnavail' means that there are no elements with the same name in the set. */ -typedef enum { cvLess, cvEqual, cvGreater, cvUnavail } VersionDiff; +using VersionDiff = enum { cvLess, cvEqual, cvGreater, cvUnavail }; static VersionDiff compareVersionAgainstSet(const DrvInfo& elem, const DrvInfos& elems, diff --git a/third_party/nix/src/nix/command.hh b/third_party/nix/src/nix/command.hh index 01c1ed69d6..87e2fbe9d2 100644 --- a/third_party/nix/src/nix/command.hh +++ b/third_party/nix/src/nix/command.hh @@ -51,7 +51,7 @@ struct Buildable { std::map<std::string, Path> outputs; }; -typedef std::vector<Buildable> Buildables; +using Buildables = std::vector<Buildable>; struct Installable { virtual std::string what() = 0; @@ -140,7 +140,7 @@ struct StorePathCommand : public InstallablesCommand { void run(ref<Store> store) override; }; -typedef std::map<std::string, ref<Command>> Commands; +using Commands = std::map<std::string, ref<Command>>; /* An argument parser that supports multiple subcommands, i.e. ‘<command> <subcommand>’. */ diff --git a/third_party/nix/src/nix/legacy.hh b/third_party/nix/src/nix/legacy.hh index a9bc65c02e..a0fc88da24 100644 --- a/third_party/nix/src/nix/legacy.hh +++ b/third_party/nix/src/nix/legacy.hh @@ -9,7 +9,7 @@ namespace nix { typedef std::function<void(int, char**)> MainFunction; struct RegisterLegacyCommand { - typedef std::map<std::string, MainFunction> Commands; + using Commands = std::map<std::string, MainFunction>; static Commands* commands; RegisterLegacyCommand(const std::string& name, MainFunction fun) { |