From 3e183772e5336068253e8be1ce39408c3b747edb Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 31 Jul 2022 20:31:17 +0100 Subject: Work around oddity with cppcheck --- netfs/fuse/fuseAppBase.h | 9 +++++---- 1 file 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(-EIO); } } catch (...) { fuseApp->logf(LOG_ERR, "Unknown exception calling %s", typeid(bfunc).name()); - return -EIO; + return static_cast(-EIO); } } }; -- cgit v1.2.3