aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-12-13 12:38:33 +0100
committerGitHub <noreply@github.com>2022-12-13 12:38:33 +0100
commit1315133b50fd836f5b8bafc8bf63c85aef475a04 (patch)
treeeee18fc184e8eef0a876d3a9ed8a06d2c6634009 /src/libexpr
parentb3fdab28a216683365f7f04bfa9bbc5cd122d753 (diff)
Improve cast safety
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index b5e0051ac..adf928949 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -823,7 +823,7 @@ void EvalState::runDebugRepl(const Error * error, const Env & env, const Expr &
? std::make_unique<DebugTraceStacker>(
*this,
DebugTrace {
- .pos = error->info().errPos ? error->info().errPos : (std::shared_ptr<AbstractPos>) positions[expr.getPos()],
+ .pos = error->info().errPos ? error->info().errPos : static_cast<std::shared_ptr<AbstractPos>>(positions[expr.getPos()]),
.expr = expr,
.env = env,
.hint = error->info().msg,
@@ -1246,7 +1246,7 @@ void EvalState::cacheFile(
*this,
*e,
this->baseEnv,
- e->getPos() ? (std::shared_ptr<AbstractPos>) positions[e->getPos()] : nullptr,
+ e->getPos() ? static_cast<std::shared_ptr<AbstractPos>>(positions[e->getPos()] : nullptr),
"while evaluating the file '%1%':", resolvedPath)
: nullptr;