Addresses -Wdeprecated-declarations warnings

changing all references of std::auto_ptr to std::unique_ptr and changing the implementation of get_directory_contents() to use readdir, which is now reentrant, instead of readdir_r.

Signed-off-by: Andrew Ayer <agwa@andrewayer.name>

  Note: old implementations or readdir might not be re-entrant, but that's OK
  because git-crypt is not multi-threaded.
This commit is contained in:
Adrian Cohea
2017-03-18 17:23:34 -06:00
committed by Andrew Ayer
parent edfa3dcb5f
commit d3bb5aba46
3 changed files with 16 additions and 30 deletions

View File

@@ -63,8 +63,8 @@ Aes_ecb_encryptor::Aes_ecb_encryptor (const unsigned char* raw_key)
Aes_ecb_encryptor::~Aes_ecb_encryptor ()
{
// Note: Explicit destructor necessary because class contains an auto_ptr
// which contains an incomplete type when the auto_ptr is declared.
// Note: Explicit destructor necessary because class contains an unique_ptr
// which contains an incomplete type when the unique_ptr is declared.
explicit_memset(&impl->key, '\0', sizeof(impl->key));
}
@@ -86,8 +86,8 @@ Hmac_sha1_state::Hmac_sha1_state (const unsigned char* key, size_t key_len)
Hmac_sha1_state::~Hmac_sha1_state ()
{
// Note: Explicit destructor necessary because class contains an auto_ptr
// which contains an incomplete type when the auto_ptr is declared.
// Note: Explicit destructor necessary because class contains an unique_ptr
// which contains an incomplete type when the unique_ptr is declared.
HMAC_cleanup(&(impl->ctx));
}