summaryrefslogtreecommitdiff
path: root/server/NetworkController.cpp
diff options
context:
space:
mode:
authorBernie Innocenti <codewiz@google.com>2019-06-14 19:52:49 +0900
committerBernie Innocenti <codewiz@google.com>2019-08-21 15:59:41 +0900
commit762dcf48a2fef596d677d9e8d6ec655d58303211 (patch)
tree60beab7ae8e436cbd080f6492ca36739040f666f /server/NetworkController.cpp
parentcf6f710b67a8a5f35d47b2b20fee61395f79236d (diff)
Use C++17's [[nodiscard]] instead of WARN_UNUSED_RESULT
No functionality change. Also remove some header guards along the way. Test: m Change-Id: I1afdcaea95a3dd56f392c4e61d7670f43615792a
Diffstat (limited to 'server/NetworkController.cpp')
-rw-r--r--server/NetworkController.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/server/NetworkController.cpp b/server/NetworkController.cpp
index 1e4894fa..2c778301 100644
--- a/server/NetworkController.cpp
+++ b/server/NetworkController.cpp
@@ -47,8 +47,7 @@
using android::netdutils::DumpWriter;
-namespace android {
-namespace net {
+namespace android::net {
namespace {
@@ -67,21 +66,21 @@ const unsigned MAX_NET_ID = 65535;
// setPermissionForNetworks).
// TODO: use std::mutex and GUARDED_BY instead of manual inspection.
class NetworkController::DelegateImpl : public PhysicalNetwork::Delegate {
-public:
+ public:
explicit DelegateImpl(NetworkController* networkController);
virtual ~DelegateImpl();
- int modifyFallthrough(unsigned vpnNetId, const std::string& physicalInterface,
- Permission permission, bool add) WARN_UNUSED_RESULT;
+ [[nodiscard]] int modifyFallthrough(unsigned vpnNetId, const std::string& physicalInterface,
+ Permission permission, bool add);
-private:
- int addFallthrough(const std::string& physicalInterface,
- Permission permission) override WARN_UNUSED_RESULT;
- int removeFallthrough(const std::string& physicalInterface,
- Permission permission) override WARN_UNUSED_RESULT;
+ private:
+ [[nodiscard]] int addFallthrough(const std::string& physicalInterface,
+ Permission permission) override;
+ [[nodiscard]] int removeFallthrough(const std::string& physicalInterface,
+ Permission permission) override;
- int modifyFallthrough(const std::string& physicalInterface, Permission permission,
- bool add) WARN_UNUSED_RESULT;
+ [[nodiscard]] int modifyFallthrough(const std::string& physicalInterface, Permission permission,
+ bool add);
NetworkController* const mNetworkController;
};
@@ -850,5 +849,4 @@ void NetworkController::updateTcpSocketMonitorPolling() {
}
}
-} // namespace net
-} // namespace android
+} // namespace android::net