summaryrefslogtreecommitdiff
path: root/netfs/fuse/fuseAppBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'netfs/fuse/fuseAppBase.cpp')
-rw-r--r--netfs/fuse/fuseAppBase.cpp29
1 files changed, 11 insertions, 18 deletions
diff --git a/netfs/fuse/fuseAppBase.cpp b/netfs/fuse/fuseAppBase.cpp
index 3eadd8f..4485aec 100644
--- a/netfs/fuse/fuseAppBase.cpp
+++ b/netfs/fuse/fuseAppBase.cpp
@@ -1,19 +1,13 @@
#include "fuseAppBase.h"
-#include <errno.h>
-#include <assert.h>
-#include <stdio.h>
+#include <cerrno>
+#include <cassert>
+#include <cstdio>
#include <unistd.h>
-#include <stdlib.h>
+#include <cstdlib>
#include <typeinfo>
FuseAppBase * FuseAppBase::fuseApp;
-FuseAppBase::FuseAppBase()
-{
-}
-FuseAppBase::~FuseAppBase()
-{
-}
// LCOV_EXCL_START
// These are all excluded from coverage because it is impossible
// to call them in a realistic manner. They exist only as the default
@@ -21,7 +15,7 @@ FuseAppBase::~FuseAppBase()
// unless it is overridden.
void * FuseAppBase::init(fuse_conn_info*)
{
- return NULL;
+ return nullptr;
}
int FuseAppBase::opt_parse(void*, const char *, int, fuse_args*)
{
@@ -155,6 +149,7 @@ int FuseAppBase::lock(const char *, struct fuse_file_info *, int, struct flock *
{
return -ENOSYS;
}
+// NOLINTNEXTLINE(modernize-avoid-c-arrays)
int FuseAppBase::utimens(const char *, const struct timespec[2])
{
return -ENOSYS;
@@ -188,11 +183,11 @@ int FuseAppBase::fallocate(const char *, int, off_t, off_t, struct fuse_file_inf
return -ENOSYS;
}
// LCOV_EXCL_STOP
-void FuseAppBase::log(int level, const char * message) const throw()
+void FuseAppBase::log(int level, const char * message) const noexcept
{
logf(level, "%s", message);
}
-void FuseAppBase::logf(int level, const char * fmt, ...) const throw()
+void FuseAppBase::logf(int level, const char * fmt, ...) const noexcept
{
va_list args;
va_start(args, fmt);
@@ -200,7 +195,7 @@ void FuseAppBase::logf(int level, const char * fmt, ...) const throw()
va_end(args);
}
-int FuseAppBase::onError(const std::exception & e) throw()
+int FuseAppBase::onError(const std::exception & e) noexcept
{
logf(LOG_ERR, "Unknown exception (what: %s)", e.what());
return -ENOSYS;
@@ -222,12 +217,10 @@ void FuseAppBase::fuseDestroy(void *)
struct fuse_args
FuseAppBase::runint(int argc, char ** argv)
{
- struct fuse_opt fuse_opts[] = {
- { NULL, 0, 0 }
- };
+ std::array<fuse_opt, 1> fuse_opts {};
fuseApp = this;
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
- if (fuse_opt_parse(&args, fuseApp, fuse_opts,
+ if (fuse_opt_parse(&args, fuseApp, fuse_opts.data(),
&internalHelper<decltype(&FuseAppBase::opt_parse), &FuseAppBase::opt_parse>) == -1) {
exit(1);
}