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
diff --git a/server/DummyNetwork.h b/server/DummyNetwork.h
index 32584aa..5823ce5 100644
--- a/server/DummyNetwork.h
+++ b/server/DummyNetwork.h
@@ -14,27 +14,22 @@
* limitations under the License.
*/
-#ifndef NETD_SERVER_DUMMY_NETWORK_H
-#define NETD_SERVER_DUMMY_NETWORK_H
+#pragma once
#include "Network.h"
-namespace android {
-namespace net {
+namespace android::net {
class DummyNetwork : public Network {
-public:
+ public:
static const char* INTERFACE_NAME;
explicit DummyNetwork(unsigned netId);
virtual ~DummyNetwork();
-private:
+ private:
Type getType() const override;
- int addInterface(const std::string& interface) override WARN_UNUSED_RESULT;
- int removeInterface(const std::string& interface) override WARN_UNUSED_RESULT;
+ [[nodiscard]] int addInterface(const std::string& interface) override;
+ [[nodiscard]] int removeInterface(const std::string& interface) override;
};
-} // namespace net
-} // namespace android
-
-#endif // NETD_SERVER_DUMMY_NETWORK_H
+} // namespace android::net