about summary refs log tree commit diff
path: root/third_party/nix/src/libstore
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-08-21T02·23+0100
committertazjin <mail@tazj.in>2020-08-21T03·55+0000
commit7edbe59c6c70cd085fc68c4317c3a71a40ac21e5 (patch)
treeb036747e1c9615c2abbd58560353e704d51bc922 /third_party/nix/src/libstore
parent674d921202754661bfcc02ef8fe40ade227349cb (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 'third_party/nix/src/libstore')
-rw-r--r--third_party/nix/src/libstore/builtins/buildenv.cc4
-rw-r--r--third_party/nix/src/libstore/derivations.hh2
-rw-r--r--third_party/nix/src/libstore/local-store.hh8
-rw-r--r--third_party/nix/src/libstore/serve-protocol.hh4
4 files changed, 9 insertions, 9 deletions
diff --git a/third_party/nix/src/libstore/builtins/buildenv.cc b/third_party/nix/src/libstore/builtins/buildenv.cc
index 7ef7e2c25a59..0d1c59e6b5b7 100644
--- a/third_party/nix/src/libstore/builtins/buildenv.cc
+++ b/third_party/nix/src/libstore/builtins/buildenv.cc
@@ -120,7 +120,7 @@ static void createLinks(const Path& srcDir, const Path& dstDir, int priority) {
   }
 }
 
-typedef std::set<Path> FileProp;
+using FileProp = std::set<Path>;
 
 static FileProp done;
 static FileProp postponed = FileProp{};
@@ -158,7 +158,7 @@ struct Package {
       : path{path}, active{active}, priority{priority} {}
 };
 
-typedef std::vector<Package> Packages;
+using Packages = std::vector<Package>;
 
 void builtinBuildenv(const BasicDerivation& drv) {
   auto getAttr = [&](const std::string& name) {
diff --git a/third_party/nix/src/libstore/derivations.hh b/third_party/nix/src/libstore/derivations.hh
index 3e26d5fa6f4e..8d46b58b5c0d 100644
--- a/third_party/nix/src/libstore/derivations.hh
+++ b/third_party/nix/src/libstore/derivations.hh
@@ -112,7 +112,7 @@ extern DrvHashes drvHashes;  // FIXME: global, not thread-safe
 /* Split a string specifying a derivation and a set of outputs
    (/nix/store/hash-foo!out1,out2,...) into the derivation path and
    the outputs. */
-typedef std::pair<std::string, std::set<std::string> > DrvPathWithOutputs;
+using DrvPathWithOutputs = std::pair<std::string, std::set<std::string> >;
 DrvPathWithOutputs parseDrvPathWithOutputs(absl::string_view path);
 
 Path makeDrvPathWithOutputs(const Path& drvPath,
diff --git a/third_party/nix/src/libstore/local-store.hh b/third_party/nix/src/libstore/local-store.hh
index 669b878b6601..193050e538b2 100644
--- a/third_party/nix/src/libstore/local-store.hh
+++ b/third_party/nix/src/libstore/local-store.hh
@@ -172,7 +172,7 @@ class LocalStore : public LocalFSStore {
 
  private:
   typedef std::shared_ptr<AutoCloseFD> FDPtr;
-  typedef std::list<FDPtr> FDs;
+  using FDs = std::list<FDPtr>;
 
   void findTempRoots(FDs& fds, Roots& roots, bool censor);
 
@@ -270,7 +270,7 @@ class LocalStore : public LocalFSStore {
 
   void checkDerivationOutputs(const Path& drvPath, const Derivation& drv);
 
-  typedef std::unordered_set<ino_t> InodeHash;
+  using InodeHash = std::unordered_set<ino_t>;
 
   InodeHash loadInodeHash();
   static Strings readDirectoryIgnoringInodes(const Path& path,
@@ -295,8 +295,8 @@ class LocalStore : public LocalFSStore {
   friend class SubstitutionGoal;
 };
 
-typedef std::pair<dev_t, ino_t> Inode;
-typedef std::set<Inode> InodesSeen;
+using Inode = std::pair<dev_t, ino_t>;
+using InodesSeen = std::set<Inode>;
 
 /* "Fix", or canonicalise, the meta-data of the files in a store path
    after it has been built.  In particular:
diff --git a/third_party/nix/src/libstore/serve-protocol.hh b/third_party/nix/src/libstore/serve-protocol.hh
index a07a7ef97425..04c92e63f6de 100644
--- a/third_party/nix/src/libstore/serve-protocol.hh
+++ b/third_party/nix/src/libstore/serve-protocol.hh
@@ -9,7 +9,7 @@ namespace nix {
 #define GET_PROTOCOL_MAJOR(x) ((x)&0xff00)
 #define GET_PROTOCOL_MINOR(x) ((x)&0x00ff)
 
-typedef enum {
+using ServeCommand = enum {
   cmdQueryValidPaths = 1,
   cmdQueryPathInfos = 2,
   cmdDumpStorePath = 3,
@@ -19,6 +19,6 @@ typedef enum {
   cmdQueryClosure = 7,
   cmdBuildDerivation = 8,
   cmdAddToStoreNar = 9,
-} ServeCommand;
+};
 
 }  // namespace nix