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 <rikingcoding@gmail.com> Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
parent
a75c0278db
commit
f7fa77f14d
2 changed files with 17 additions and 18 deletions
18
third_party/nix/src/libstore/build.cc
vendored
18
third_party/nix/src/libstore/build.cc
vendored
|
@ -96,21 +96,21 @@ struct CompareGoalPtrs {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Set of goals. */
|
/* Set of goals. */
|
||||||
typedef std::set<GoalPtr, CompareGoalPtrs> Goals;
|
using Goals = std::set<GoalPtr, CompareGoalPtrs>;
|
||||||
using WeakGoals = std::list<WeakGoalPtr>;
|
using WeakGoals = std::list<WeakGoalPtr>;
|
||||||
|
|
||||||
/* A map of paths to goals (and the other way around). */
|
/* A map of paths to goals (and the other way around). */
|
||||||
typedef std::map<Path, WeakGoalPtr> WeakGoalMap;
|
using WeakGoalMap = std::map<Path, WeakGoalPtr>;
|
||||||
|
|
||||||
class Goal : public std::enable_shared_from_this<Goal> {
|
class Goal : public std::enable_shared_from_this<Goal> {
|
||||||
public:
|
public:
|
||||||
typedef enum {
|
using ExitCode = enum {
|
||||||
ecBusy,
|
ecBusy,
|
||||||
ecSuccess,
|
ecSuccess,
|
||||||
ecFailed,
|
ecFailed,
|
||||||
ecNoSubstituters,
|
ecNoSubstituters,
|
||||||
ecIncompleteClosure
|
ecIncompleteClosure
|
||||||
} ExitCode;
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* Backlink to the worker. */
|
/* 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;
|
class SubstitutionGoal;
|
||||||
|
|
||||||
|
@ -835,16 +835,16 @@ class DerivationGoal : public Goal {
|
||||||
explicit ChrootPath(Path source = "", bool optional = false)
|
explicit ChrootPath(Path source = "", bool optional = false)
|
||||||
: source(std::move(source)), optional(optional) {}
|
: source(std::move(source)), optional(optional) {}
|
||||||
};
|
};
|
||||||
typedef std::map<Path, ChrootPath>
|
using DirsInChroot =
|
||||||
DirsInChroot; // maps target path to source path
|
std::map<Path, ChrootPath>; // maps target path to source path
|
||||||
DirsInChroot dirsInChroot;
|
DirsInChroot dirsInChroot;
|
||||||
|
|
||||||
typedef std::map<std::string, std::string> Environment;
|
using Environment = std::map<std::string, std::string>;
|
||||||
Environment env;
|
Environment env;
|
||||||
|
|
||||||
/* Hash rewriting. */
|
/* Hash rewriting. */
|
||||||
StringRewrites inputRewrites, outputRewrites;
|
StringRewrites inputRewrites, outputRewrites;
|
||||||
typedef std::map<Path, Path> RedirectedOutputs;
|
using RedirectedOutputs = std::map<Path, Path>;
|
||||||
RedirectedOutputs redirectedOutputs;
|
RedirectedOutputs redirectedOutputs;
|
||||||
|
|
||||||
BuildMode buildMode;
|
BuildMode buildMode;
|
||||||
|
|
17
third_party/nix/src/libstore/store-api.hh
vendored
17
third_party/nix/src/libstore/store-api.hh
vendored
|
@ -50,7 +50,7 @@ const size_t storePathHashLen = 32; // i.e. 160 bits
|
||||||
/* Magic header of exportPath() output (obsolete). */
|
/* Magic header of exportPath() output (obsolete). */
|
||||||
const uint32_t exportMagic = 0x4558494e;
|
const uint32_t exportMagic = 0x4558494e;
|
||||||
|
|
||||||
typedef std::unordered_map<Path, std::unordered_set<std::string>> Roots;
|
using Roots = std::unordered_map<Path, std::unordered_set<std::string>>;
|
||||||
|
|
||||||
struct GCOptions {
|
struct GCOptions {
|
||||||
/* Garbage collector operation:
|
/* Garbage collector operation:
|
||||||
|
@ -66,12 +66,12 @@ struct GCOptions {
|
||||||
- `gcDeleteSpecific': delete the paths listed in
|
- `gcDeleteSpecific': delete the paths listed in
|
||||||
`pathsToDelete', insofar as they are not reachable.
|
`pathsToDelete', insofar as they are not reachable.
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
using GCAction = enum {
|
||||||
gcReturnLive,
|
gcReturnLive,
|
||||||
gcReturnDead,
|
gcReturnDead,
|
||||||
gcDeleteDead,
|
gcDeleteDead,
|
||||||
gcDeleteSpecific,
|
gcDeleteSpecific,
|
||||||
} GCAction;
|
};
|
||||||
|
|
||||||
GCAction action{gcDeleteDead};
|
GCAction action{gcDeleteDead};
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ struct SubstitutablePathInfo {
|
||||||
unsigned long long narSize; /* 0 = unknown */
|
unsigned long long narSize; /* 0 = unknown */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<Path, SubstitutablePathInfo> SubstitutablePathInfos;
|
using SubstitutablePathInfos = std::map<Path, SubstitutablePathInfo>;
|
||||||
|
|
||||||
struct ValidPathInfo {
|
struct ValidPathInfo {
|
||||||
Path path;
|
Path path;
|
||||||
|
@ -248,7 +248,7 @@ struct BuildResult {
|
||||||
|
|
||||||
class Store : public std::enable_shared_from_this<Store>, public Config {
|
class Store : public std::enable_shared_from_this<Store>, public Config {
|
||||||
public:
|
public:
|
||||||
typedef std::map<std::string, std::string> Params;
|
using Params = std::map<std::string, std::string>;
|
||||||
|
|
||||||
const PathSetting storeDir_{this, false, settings.nixStore, "store",
|
const PathSetting storeDir_{this, false, settings.nixStore, "store",
|
||||||
"path to the Nix store"};
|
"path to the Nix store"};
|
||||||
|
@ -780,12 +780,11 @@ StoreType getStoreType(const std::string& uri = settings.storeUri.get(),
|
||||||
std::list<ref<Store>> getDefaultSubstituters();
|
std::list<ref<Store>> getDefaultSubstituters();
|
||||||
|
|
||||||
/* Store implementation registration. */
|
/* Store implementation registration. */
|
||||||
typedef std::function<std::shared_ptr<Store>(const std::string& uri,
|
using OpenStore = std::function<std::shared_ptr<Store>(const std::string&,
|
||||||
const Store::Params& params)>
|
const Store::Params&)>;
|
||||||
OpenStore;
|
|
||||||
|
|
||||||
struct RegisterStoreImplementation {
|
struct RegisterStoreImplementation {
|
||||||
typedef std::vector<OpenStore> Implementations;
|
using Implementations = std::vector<OpenStore>;
|
||||||
static Implementations* implementations;
|
static Implementations* implementations;
|
||||||
|
|
||||||
RegisterStoreImplementation(OpenStore fun) {
|
RegisterStoreImplementation(OpenStore fun) {
|
||||||
|
|
Loading…
Reference in a new issue