diff --git a/src/auth/basic/LDAP/basic_ldap_auth.cc b/src/auth/basic/LDAP/basic_ldap_auth.cc index 4d9a78574cb..f79a5b88984 100644 --- a/src/auth/basic/LDAP/basic_ldap_auth.cc +++ b/src/auth/basic/LDAP/basic_ldap_auth.cc @@ -795,7 +795,7 @@ readSecret(const char *filename) if ((e = strrchr(buf, '\r'))) *e = 0; - passwd = (char *) calloc(sizeof(char), strlen(buf) + 1); + passwd = static_cast(calloc(strlen(buf) + 1, sizeof(char))); if (!passwd) { fprintf(stderr, PROGRAM_NAME " ERROR: can not allocate memory\n"); exit(EXIT_FAILURE); diff --git a/src/auth/digest/eDirectory/edir_ldapext.cc b/src/auth/digest/eDirectory/edir_ldapext.cc index f34341c912c..13e7daca67b 100644 --- a/src/auth/digest/eDirectory/edir_ldapext.cc +++ b/src/auth/digest/eDirectory/edir_ldapext.cc @@ -69,7 +69,7 @@ #define NMAS_LDAP_EXT_VERSION 1 -#define SMB_MALLOC_ARRAY(type, nelem) calloc(sizeof(type), nelem) +#define SMB_MALLOC_ARRAY(type, nelem) calloc(nelem, sizeof(type)) #define DEBUG(level, args) /********************************************************************** diff --git a/src/base/InstanceId.h b/src/base/InstanceId.h index a48be882cc4..d3e2ebb2b2e 100644 --- a/src/base/InstanceId.h +++ b/src/base/InstanceId.h @@ -49,6 +49,7 @@ class InstanceId typedef ValueType Value; ///< id storage type InstanceId() {change();} + InstanceId(InstanceId &&) = delete; // no copying/moving of any kind operator Value() const { return value; } bool operator ==(const InstanceId &o) const { return value == o.value; } @@ -67,10 +68,6 @@ class InstanceId public: Value value = Value(); ///< instance identifier - -private: - InstanceId(const InstanceId &); ///< not implemented; IDs are unique - InstanceId& operator=(const InstanceId &); ///< not implemented }; /// An InstanceIdDefinitions() helper. Avoid direct use.