diff --git a/core/Identity.hpp b/core/Identity.hpp index a65aa4f58..37aedb4e3 100644 --- a/core/Identity.hpp +++ b/core/Identity.hpp @@ -264,7 +264,6 @@ public: { return ZT_IDENTITY_MARSHAL_SIZE_MAX; } int marshal(uint8_t data[ZT_IDENTITY_MARSHAL_SIZE_MAX], bool includePrivate = false) const noexcept; - int unmarshal(const uint8_t *data, int len) noexcept; private: diff --git a/core/Network.cpp b/core/Network.cpp index d5865dc74..0ac00ec3a 100644 --- a/core/Network.cpp +++ b/core/Network.cpp @@ -635,8 +635,7 @@ bool Network::filterOutgoingPacket( Member *membership; if (ztDest) { Map::iterator mm(m_memberships.find(ztDest)); - if (mm != m_memberships.end()) - membership = &(mm->second); + membership = (mm == m_memberships.end()) ? nullptr : &(mm->second); } else { membership = nullptr; } diff --git a/core/Tests.cpp b/core/Tests.cpp index f4c249693..2788332aa 100644 --- a/core/Tests.cpp +++ b/core/Tests.cpp @@ -802,7 +802,7 @@ extern "C" const char *ZTT_general() return "Identity test failed: v0 unmarshal"; } if (id != id2) { - ZT_T_PRINTF("FAILED (v0 unmarshal !=)" ZT_EOL_S); + ZT_T_PRINTF("FAILED (v0 unmarshal %s != %s)" ZT_EOL_S, id.toString(true).c_str(), id2.toString(true).c_str()); return "Identity test failed: v0 unmarshal !="; } ms = id.marshal(idm, false); diff --git a/core/Utils.hpp b/core/Utils.hpp index aac6d734d..7868e2b21 100644 --- a/core/Utils.hpp +++ b/core/Utils.hpp @@ -672,7 +672,7 @@ static ZT_INLINE void copy(void *dest, const void *src) noexcept { #if defined(ZT_ARCH_X64) && defined(__GNUC__) uintptr_t l = L; - asm volatile ("cld ; rep movsb" : "+c"(l), "+S"(src), "+D"(dest)); + __asm__ __volatile__ ("cld ; rep movsb" : "+c"(l), "+S"(src), "+D"(dest) :: "memory"); #else memcpy(dest, src, L); #endif @@ -688,7 +688,7 @@ static ZT_INLINE void copy(void *dest, const void *src) noexcept static ZT_INLINE void copy(void *dest, const void *src, unsigned long len) noexcept { #if defined(ZT_ARCH_X64) && defined(__GNUC__) - asm volatile ("cld ; rep movsb" : "+c"(len), "+S"(src), "+D"(dest)); + __asm__ __volatile__ ("cld ; rep movsb" : "+c"(len), "+S"(src), "+D"(dest) :: "memory"); #else memcpy(dest, src, len); #endif @@ -705,7 +705,7 @@ static ZT_INLINE void zero(void *dest) noexcept { #if defined(ZT_ARCH_X64) && defined(__GNUC__) uintptr_t l = L; - asm volatile ("cld ; rep stosb" :"+c" (l), "+D" (dest) : "a" (0)); + __asm__ __volatile__ ("cld ; rep stosb" :"+c" (l), "+D" (dest) : "a" (0) : "memory"); #else memset(dest, 0, L); #endif @@ -720,7 +720,7 @@ static ZT_INLINE void zero(void *dest) noexcept static ZT_INLINE void zero(void *dest, unsigned long len) noexcept { #if defined(ZT_ARCH_X64) && defined(__GNUC__) - asm volatile ("cld ; rep stosb" :"+c" (len), "+D" (dest) : "a" (0)); + __asm__ __volatile__ ("cld ; rep stosb" :"+c" (len), "+D" (dest) : "a" (0) : "memory"); #else memset(dest, 0, len); #endif @@ -735,7 +735,7 @@ static ZT_INLINE void zero(void *dest, unsigned long len) noexcept * @param len Length of data * @return FNV1a checksum */ -uint32_t fnv1a32(const void *const data, const unsigned int len) noexcept; +uint32_t fnv1a32(const void *data, unsigned int len) noexcept; /** * Mix bits in a 64-bit integer (non-cryptographic, for hash tables)