From f7fa77f14dedad98ab9e8a014d3bcfd60565dfd0 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 20 Aug 2020 03:05:08 +0100 Subject: style(tvix): typedef -> using in build.cc/store-api.hh this shuts up a few lints ... Change-Id: I51ee9418767e97247f98b170cdad137e5b12b44d Reviewed-on: https://cl.tvl.fyi/c/depot/+/1796 Tested-by: BuildkiteCI Reviewed-by: kanepyork Reviewed-by: glittershark --- third_party/nix/src/libstore/build.cc | 18 +++++++++--------- third_party/nix/src/libstore/store-api.hh | 17 ++++++++--------- 2 files changed, 17 insertions(+), 18 deletions(-) (limited to 'third_party/nix/src/libstore') diff --git a/third_party/nix/src/libstore/build.cc b/third_party/nix/src/libstore/build.cc index a9d40991d30d..91f80e51e042 100644 --- a/third_party/nix/src/libstore/build.cc +++ b/third_party/nix/src/libstore/build.cc @@ -96,21 +96,21 @@ struct CompareGoalPtrs { }; /* Set of goals. */ -typedef std::set Goals; +using Goals = std::set; using WeakGoals = std::list; /* A map of paths to goals (and the other way around). */ -typedef std::map WeakGoalMap; +using WeakGoalMap = std::map; class Goal : public std::enable_shared_from_this { public: - typedef enum { + using ExitCode = enum { ecBusy, ecSuccess, ecFailed, ecNoSubstituters, ecIncompleteClosure - } ExitCode; + }; protected: /* Backlink to the worker. */ @@ -728,7 +728,7 @@ std::string rewriteStrings(std::string s, const StringRewrites& rewrites) { ////////////////////////////////////////////////////////////////////// -typedef enum { rpAccept, rpDecline, rpPostpone } HookReply; +using HookReply = enum { rpAccept, rpDecline, rpPostpone }; class SubstitutionGoal; @@ -835,16 +835,16 @@ class DerivationGoal : public Goal { explicit ChrootPath(Path source = "", bool optional = false) : source(std::move(source)), optional(optional) {} }; - typedef std::map - DirsInChroot; // maps target path to source path + using DirsInChroot = + std::map; // maps target path to source path DirsInChroot dirsInChroot; - typedef std::map Environment; + using Environment = std::map; Environment env; /* Hash rewriting. */ StringRewrites inputRewrites, outputRewrites; - typedef std::map RedirectedOutputs; + using RedirectedOutputs = std::map; RedirectedOutputs redirectedOutputs; BuildMode buildMode; diff --git a/third_party/nix/src/libstore/store-api.hh b/third_party/nix/src/libstore/store-api.hh index bb2f1a950bfd..6c125ad2765f 100644 --- a/third_party/nix/src/libstore/store-api.hh +++ b/third_party/nix/src/libstore/store-api.hh @@ -50,7 +50,7 @@ const size_t storePathHashLen = 32; // i.e. 160 bits /* Magic header of exportPath() output (obsolete). */ const uint32_t exportMagic = 0x4558494e; -typedef std::unordered_map> Roots; +using Roots = std::unordered_map>; struct GCOptions { /* Garbage collector operation: @@ -66,12 +66,12 @@ struct GCOptions { - `gcDeleteSpecific': delete the paths listed in `pathsToDelete', insofar as they are not reachable. */ - typedef enum { + using GCAction = enum { gcReturnLive, gcReturnDead, gcDeleteDead, gcDeleteSpecific, - } GCAction; + }; GCAction action{gcDeleteDead}; @@ -110,7 +110,7 @@ struct SubstitutablePathInfo { unsigned long long narSize; /* 0 = unknown */ }; -typedef std::map SubstitutablePathInfos; +using SubstitutablePathInfos = std::map; struct ValidPathInfo { Path path; @@ -248,7 +248,7 @@ struct BuildResult { class Store : public std::enable_shared_from_this, public Config { public: - typedef std::map Params; + using Params = std::map; const PathSetting storeDir_{this, false, settings.nixStore, "store", "path to the Nix store"}; @@ -780,12 +780,11 @@ StoreType getStoreType(const std::string& uri = settings.storeUri.get(), std::list> getDefaultSubstituters(); /* Store implementation registration. */ -typedef std::function(const std::string& uri, - const Store::Params& params)> - OpenStore; +using OpenStore = std::function(const std::string&, + const Store::Params&)>; struct RegisterStoreImplementation { - typedef std::vector Implementations; + using Implementations = std::vector; static Implementations* implementations; RegisterStoreImplementation(OpenStore fun) { -- cgit 1.4.1