forked from lix-project/lix
Remove some designated initializers
With the switch to C++20, the rules became more strict, and we can no longer initialize base classes. Make them comments instead. (BTW https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2287r1.html this offers some new syntax for this use-case. Hopefully this will be adopted and we can eventually use it.)
This commit is contained in:
parent
59d3175649
commit
ee9eb83a84
|
@ -299,7 +299,7 @@ SV * makeFixedOutputPath(int recursive, char * algo, char * hash, char * name)
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = h,
|
.hash = h,
|
||||||
},
|
},
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
});
|
});
|
||||||
XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(path).c_str(), 0)));
|
XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(path).c_str(), 0)));
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
|
|
|
@ -1287,7 +1287,7 @@ drvName, Bindings * attrs, Value & v)
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = h,
|
.hash = h,
|
||||||
},
|
},
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
});
|
});
|
||||||
drv.env["out"] = state.store->printStorePath(outPath);
|
drv.env["out"] = state.store->printStorePath(outPath);
|
||||||
drv.outputs.insert_or_assign("out",
|
drv.outputs.insert_or_assign("out",
|
||||||
|
@ -2103,7 +2103,7 @@ static void addPath(
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = *expectedHash,
|
.hash = *expectedHash,
|
||||||
},
|
},
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!expectedHash || !state.store->isValidPath(*expectedStorePath)) {
|
if (!expectedHash || !state.store->isValidPath(*expectedStorePath)) {
|
||||||
|
|
|
@ -240,7 +240,7 @@ static void fetch(EvalState & state, const PosIdx pos, Value * * args, Value & v
|
||||||
.method = unpack ? FileIngestionMethod::Recursive : FileIngestionMethod::Flat,
|
.method = unpack ? FileIngestionMethod::Recursive : FileIngestionMethod::Flat,
|
||||||
.hash = *expectedHash,
|
.hash = *expectedHash,
|
||||||
},
|
},
|
||||||
.references = {}
|
/* .references = */ {}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (state.store->isValidPath(expectedPath)) {
|
if (state.store->isValidPath(expectedPath)) {
|
||||||
|
|
|
@ -215,7 +215,7 @@ StorePath Input::computeStorePath(Store & store) const
|
||||||
.method = FileIngestionMethod::Recursive,
|
.method = FileIngestionMethod::Recursive,
|
||||||
.hash = *narHash,
|
.hash = *narHash,
|
||||||
},
|
},
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ DownloadFileResult downloadFile(
|
||||||
.method = FileIngestionMethod::Flat,
|
.method = FileIngestionMethod::Flat,
|
||||||
.hash = hash,
|
.hash = hash,
|
||||||
},
|
},
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
},
|
},
|
||||||
hashString(htSHA256, sink.s),
|
hashString(htSHA256, sink.s),
|
||||||
};
|
};
|
||||||
|
|
|
@ -313,7 +313,7 @@ StorePath BinaryCacheStore::addToStoreFromDump(Source & dump, std::string_view n
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = nar.first,
|
.hash = nar.first,
|
||||||
},
|
},
|
||||||
.references = {
|
/* .references = */ {
|
||||||
.others = references,
|
.others = references,
|
||||||
.self = false,
|
.self = false,
|
||||||
},
|
},
|
||||||
|
@ -431,7 +431,7 @@ StorePath BinaryCacheStore::addToStore(
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = h,
|
.hash = h,
|
||||||
},
|
},
|
||||||
.references = {
|
/* .references = */ {
|
||||||
.others = references,
|
.others = references,
|
||||||
.self = false,
|
.self = false,
|
||||||
},
|
},
|
||||||
|
|
|
@ -2498,7 +2498,7 @@ DrvOutputs LocalDerivationGoal::registerOutputs()
|
||||||
.method = outputHash.method,
|
.method = outputHash.method,
|
||||||
.hash = got,
|
.hash = got,
|
||||||
},
|
},
|
||||||
.references = rewriteRefs(),
|
/* .references = */ rewriteRefs(),
|
||||||
},
|
},
|
||||||
Hash::dummy,
|
Hash::dummy,
|
||||||
};
|
};
|
||||||
|
|
|
@ -167,13 +167,13 @@ ContentAddressWithReferences caWithoutRefs(const ContentAddress & ca) {
|
||||||
[&](const TextHash & h) -> ContentAddressWithReferences {
|
[&](const TextHash & h) -> ContentAddressWithReferences {
|
||||||
return TextInfo {
|
return TextInfo {
|
||||||
h,
|
h,
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
[&](const FixedOutputHash & h) -> ContentAddressWithReferences {
|
[&](const FixedOutputHash & h) -> ContentAddressWithReferences {
|
||||||
return FixedOutputInfo {
|
return FixedOutputInfo {
|
||||||
h,
|
h,
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
}, ca);
|
}, ca);
|
||||||
|
|
|
@ -1419,7 +1419,7 @@ StorePath LocalStore::addToStoreFromDump(Source & source0, std::string_view name
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = hash,
|
.hash = hash,
|
||||||
},
|
},
|
||||||
.references = {
|
/* .references = */ {
|
||||||
.others = references,
|
.others = references,
|
||||||
.self = false,
|
.self = false,
|
||||||
},
|
},
|
||||||
|
|
|
@ -56,7 +56,7 @@ std::map<StorePath, StorePath> makeContentAddressed(
|
||||||
.method = FileIngestionMethod::Recursive,
|
.method = FileIngestionMethod::Recursive,
|
||||||
.hash = narModuloHash,
|
.hash = narModuloHash,
|
||||||
},
|
},
|
||||||
.references = std::move(refs),
|
/* .references = */ std::move(refs),
|
||||||
},
|
},
|
||||||
Hash::dummy,
|
Hash::dummy,
|
||||||
};
|
};
|
||||||
|
|
|
@ -31,7 +31,7 @@ std::optional<ContentAddressWithReferences> ValidPathInfo::contentAddressWithRef
|
||||||
assert(references.count(path) == 0);
|
assert(references.count(path) == 0);
|
||||||
return TextInfo {
|
return TextInfo {
|
||||||
th,
|
th,
|
||||||
.references = references,
|
/* .references = */ references,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
[&](const FixedOutputHash & foh) -> ContentAddressWithReferences {
|
[&](const FixedOutputHash & foh) -> ContentAddressWithReferences {
|
||||||
|
@ -43,7 +43,7 @@ std::optional<ContentAddressWithReferences> ValidPathInfo::contentAddressWithRef
|
||||||
}
|
}
|
||||||
return FixedOutputInfo {
|
return FixedOutputInfo {
|
||||||
foh,
|
foh,
|
||||||
.references = {
|
/* .references = */ {
|
||||||
.others = std::move(refs),
|
.others = std::move(refs),
|
||||||
.self = hasSelfReference,
|
.self = hasSelfReference,
|
||||||
},
|
},
|
||||||
|
|
|
@ -234,7 +234,7 @@ std::pair<StorePath, Hash> Store::computeStorePathForPath(std::string_view name,
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = h,
|
.hash = h,
|
||||||
},
|
},
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
};
|
};
|
||||||
return std::make_pair(makeFixedOutputPath(name, caInfo), h);
|
return std::make_pair(makeFixedOutputPath(name, caInfo), h);
|
||||||
}
|
}
|
||||||
|
@ -443,7 +443,7 @@ ValidPathInfo Store::addToStoreSlow(std::string_view name, const Path & srcPath,
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = hash,
|
.hash = hash,
|
||||||
},
|
},
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
},
|
},
|
||||||
narHash,
|
narHash,
|
||||||
};
|
};
|
||||||
|
|
|
@ -220,7 +220,7 @@ static void opPrintFixedPath(Strings opFlags, Strings opArgs)
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = Hash::parseAny(hash, hashAlgo),
|
.hash = Hash::parseAny(hash, hashAlgo),
|
||||||
},
|
},
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ struct CmdAddToStore : MixDryRun, StoreCommand
|
||||||
.method = std::move(ingestionMethod),
|
.method = std::move(ingestionMethod),
|
||||||
.hash = std::move(hash),
|
.hash = std::move(hash),
|
||||||
},
|
},
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
},
|
},
|
||||||
narHash,
|
narHash,
|
||||||
};
|
};
|
||||||
|
|
|
@ -72,7 +72,7 @@ std::tuple<StorePath, Hash> prefetchFile(
|
||||||
.method = ingestionMethod,
|
.method = ingestionMethod,
|
||||||
.hash = *expectedHash,
|
.hash = *expectedHash,
|
||||||
},
|
},
|
||||||
.references = {},
|
/* .references = */ {},
|
||||||
});
|
});
|
||||||
if (store->isValidPath(*storePath))
|
if (store->isValidPath(*storePath))
|
||||||
hash = expectedHash;
|
hash = expectedHash;
|
||||||
|
|
|
@ -206,7 +206,7 @@ struct ProfileManifest
|
||||||
.method = FileIngestionMethod::Recursive,
|
.method = FileIngestionMethod::Recursive,
|
||||||
.hash = narHash,
|
.hash = narHash,
|
||||||
},
|
},
|
||||||
.references = {
|
/* .references = */ {
|
||||||
.others = std::move(references),
|
.others = std::move(references),
|
||||||
.self = false,
|
.self = false,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue