summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-07-31 20:31:17 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-07-31 20:31:17 +0100
commit3e183772e5336068253e8be1ce39408c3b747edb (patch)
treedb8c334d4025862b40a04516437da99346fbd48a
parentAllow passedByValue on ICE interface implementations (diff)
downloadnetfs-3e183772e5336068253e8be1ce39408c3b747edb.tar.bz2
netfs-3e183772e5336068253e8be1ce39408c3b747edb.tar.xz
netfs-3e183772e5336068253e8be1ce39408c3b747edb.zip
Work around oddity with cppcheck
-rw-r--r--netfs/fuse/fuseAppBase.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/netfs/fuse/fuseAppBase.h b/netfs/fuse/fuseAppBase.h
index 035af21..480bac6 100644
--- a/netfs/fuse/fuseAppBase.h
+++ b/netfs/fuse/fuseAppBase.h
@@ -94,7 +94,8 @@ protected:
getHelper()
{
if constexpr (Implemented) {
- return [](auto... a) -> decltype((fuseApp->*bfunc)(a...)) {
+ return [](auto... a) {
+ using Return = decltype((fuseApp->*bfunc)(a...));
for (int t = 0;; ++t) {
try {
fuseApp->beforeOperation();
@@ -103,19 +104,19 @@ protected:
}
catch (const std::exception & ex) {
if (t < 10) {
- if (int rtn = fuseApp->onError(ex)) {
+ if (Return rtn = fuseApp->onError(ex)) {
return rtn;
}
}
else {
fuseApp->logf(
LOG_ERR, "Retries expired with %s calling %s", ex.what(), typeid(bfunc).name());
- return -EIO;
+ return static_cast<Return>(-EIO);
}
}
catch (...) {
fuseApp->logf(LOG_ERR, "Unknown exception calling %s", typeid(bfunc).name());
- return -EIO;
+ return static_cast<Return>(-EIO);
}
}
};