From 9862affd98e411c463d4567284a94c5f2627fd33 Mon Sep 17 00:00:00 2001 From: Oliver Giles Date: Sat, 26 Sep 2020 11:33:36 +1200 Subject: [PATCH] fix warnings under clang++ --- src/http.h | 6 +++--- src/laminar.cpp | 1 - src/laminar.h | 5 ++--- src/rpc.h | 4 ++-- src/server.cpp | 2 +- src/server.h | 8 ++++---- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/http.h b/src/http.h index 85d6469..fc8db5a 100644 --- a/src/http.h +++ b/src/http.h @@ -1,5 +1,5 @@ /// -/// Copyright 2019 Oliver Giles +/// Copyright 2019-2020 Oliver Giles /// /// This file is part of Laminar /// @@ -28,8 +28,8 @@ typedef unsigned int uint; typedef unsigned long ulong; -struct Laminar; -struct Resources; +class Laminar; +class Resources; struct LogWatcher; struct EventPeer; diff --git a/src/laminar.cpp b/src/laminar.cpp index accae10..92dd997 100644 --- a/src/laminar.cpp +++ b/src/laminar.cpp @@ -67,7 +67,6 @@ inline kj::Path operator/(const std::string& p, const T& ext) { typedef std::string str; Laminar::Laminar(Server &server, Settings settings) : - settings(settings), srv(server), homePath(kj::Path::parse(&settings.home[1])), fsHome(kj::newDiskFilesystem()->getRoot().openSubdir(homePath, kj::WriteMode::MODIFY)), diff --git a/src/laminar.h b/src/laminar.h index a47b76e..2b85df3 100644 --- a/src/laminar.h +++ b/src/laminar.h @@ -1,5 +1,5 @@ /// -/// Copyright 2015-2019 Oliver Giles +/// Copyright 2015-2020 Oliver Giles /// /// This file is part of Laminar /// @@ -31,7 +31,7 @@ // Context name to context object map typedef std::unordered_map> ContextMap; -struct Server; +class Server; class Json; class Http; @@ -125,7 +125,6 @@ private: std::unordered_map jobGroups; - Settings settings; RunSet activeJobs; Database* db; Server& srv; diff --git a/src/rpc.h b/src/rpc.h index bb2d096..0f55d2c 100644 --- a/src/rpc.h +++ b/src/rpc.h @@ -1,5 +1,5 @@ /// -/// Copyright 2019 Oliver Giles +/// Copyright 2019-2020 Oliver Giles /// /// This file is part of Laminar /// @@ -23,7 +23,7 @@ #include #include -struct Laminar; +class Laminar; class Rpc { public: diff --git a/src/server.cpp b/src/server.cpp index 0944633..df77b3f 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -95,7 +95,7 @@ kj::Promise Server::onChildExit(kj::Maybe &pid) { Server::PathWatcher& Server::watchPaths(std::function fn) { - struct PathWatcherImpl : public PathWatcher { + struct PathWatcherImpl final : public PathWatcher { PathWatcher& addPath(const char* path) override { inotify_add_watch(fd, path, IN_ONLYDIR | IN_CLOSE_WRITE | IN_CREATE | IN_DELETE); return *this; diff --git a/src/server.h b/src/server.h index e7c0b4f..d0433da 100644 --- a/src/server.h +++ b/src/server.h @@ -1,5 +1,5 @@ /// -/// Copyright 2015-2017 Oliver Giles +/// Copyright 2015-2020 Oliver Giles /// /// This file is part of Laminar /// @@ -26,9 +26,9 @@ #include #include -struct Laminar; -struct Http; -struct Rpc; +class Laminar; +class Http; +class Rpc; // This class manages the program's asynchronous event loop class Server final : public kj::TaskSet::ErrorHandler {