From b56753ea9f86cd4c4ea749cdd6647a94b7ff0063 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 25 Mar 2019 11:45:32 -0700 Subject: [PATCH] Get rid of some mem* calls that are bad C++ form (but worked fine) and cause warnings. --- node/CertificateOfMembership.hpp | 15 ++------------- node/Revocation.hpp | 11 +++++++++-- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/node/CertificateOfMembership.hpp b/node/CertificateOfMembership.hpp index 64fe10192..457b4c1f4 100644 --- a/node/CertificateOfMembership.hpp +++ b/node/CertificateOfMembership.hpp @@ -112,14 +112,9 @@ public: /** * Create an empty certificate of membership */ - CertificateOfMembership() + CertificateOfMembership() : + _qualifierCount(0) { - memset(this,0,sizeof(CertificateOfMembership)); - } - - CertificateOfMembership(const CertificateOfMembership &c) - { - memcpy(this,&c,sizeof(CertificateOfMembership)); } /** @@ -145,12 +140,6 @@ public: memset(_signature.data,0,ZT_C25519_SIGNATURE_LEN); } - inline CertificateOfMembership &operator=(const CertificateOfMembership &c) - { - memcpy(this,&c,sizeof(CertificateOfMembership)); - return *this; - } - /** * Create from binary-serialized COM in buffer * diff --git a/node/Revocation.hpp b/node/Revocation.hpp index 0a43981c8..46a5d4f8a 100644 --- a/node/Revocation.hpp +++ b/node/Revocation.hpp @@ -58,9 +58,16 @@ class Revocation : public Credential public: static inline Credential::Type credentialType() { return Credential::CREDENTIAL_TYPE_REVOCATION; } - Revocation() + Revocation() : + _id(0), + _credentialId(0), + _networkId(0), + _threshold(0), + _flags(0), + _target(), + _signedBy(), + _type(Credential::CREDENTIAL_TYPE_NULL) { - memset(this,0,sizeof(Revocation)); } /**