LINT fix
authorLoïc Blot <loic.blot@unix-experience.fr>
Fri, 15 Feb 2019 11:27:29 +0000 (12:27 +0100)
committerLoïc Blot <loic.blot@unix-experience.fr>
Fri, 15 Feb 2019 11:27:29 +0000 (12:27 +0100)
src/network/address.cpp
src/unittest/test_address.cpp

index fce3b48f01a29a332a31e669c23462b64a20c294..896b2431730c394015c2a31220a6de3537165f21 100644 (file)
@@ -272,7 +272,8 @@ void Address::print(std::ostream *s) const
                *s << serializeString() << ":" << m_port;
 }
 
-bool Address::isLocalhost() const {
+bool Address::isLocalhost() const
+{
        if (isIPv6()) {
                static const unsigned char localhost_bytes[] = {
                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
@@ -281,8 +282,10 @@ bool Address::isLocalhost() const {
 
                auto addr = m_address.ipv6.sin6_addr.s6_addr;
 
+// clang-format off
                return memcmp(addr, localhost_bytes, 16) == 0 ||
                        memcmp(addr, mapped_ipv4_localhost, 13) == 0;
+// clang-format on
        }
 
        return (m_address.ipv4.sin_addr.s_addr & 0xFF) == 0x7f;
index 000a648f1ff298571a8e041c9a05efe003390af8..35d4effb66eccaaef0767d4127b1d8c6c65fae00 100644 (file)
@@ -23,12 +23,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "settings.h"
 #include "network/socket.h"
 
-class TestAddress : public TestBase {
+class TestAddress : public TestBase
+{
 public:
-       TestAddress()
-       {
-               TestManager::registerTestModule(this);
-       }
+       TestAddress() { TestManager::registerTestModule(this); }
 
        const char *getName() { return "TestAddress"; }