From: Amos Jeffries Date: Sat, 25 Jun 2016 18:02:09 +0000 (+1200) Subject: Remove last remains of TidyPointer X-Git-Tag: SQUID_4_0_13~39^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3662819a5539a19292e8767d2f841e8ffe2556f7;p=thirdparty%2Fsquid.git Remove last remains of TidyPointer --- diff --git a/src/base/TidyPointer.h b/src/base/CtoCppDtor.h similarity index 83% rename from src/base/TidyPointer.h rename to src/base/CtoCppDtor.h index 7b2866d60f..31f8bfb006 100644 --- a/src/base/TidyPointer.h +++ b/src/base/CtoCppDtor.h @@ -6,13 +6,11 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ -#ifndef SQUID_BASE_TIDYPOINTER_H -#define SQUID_BASE_TIDYPOINTER_H +#ifndef SQUID_BASE_CTOCPPDTOR_H +#define SQUID_BASE_CTOCPPDTOR_H #include -#define TidyPointer std::unique_ptr - // Macro to be used to define the C++ equivalent functor of an extern "C" // function. The C++ functor is suffixed with the _cpp extension #define CtoCppDtor(function, argument_type) \ @@ -23,5 +21,5 @@ /// DeAllocator functor for pointers that need free(3) from the std C library CtoCppDtor(xfree, char *); -#endif // SQUID_BASE_TIDYPOINTER_H +#endif // SQUID_BASE_CTOCPPDTOR_H diff --git a/src/base/Makefile.am b/src/base/Makefile.am index 86b515ca62..1c03ae7351 100644 --- a/src/base/Makefile.am +++ b/src/base/Makefile.am @@ -24,6 +24,7 @@ libbase_la_SOURCES = \ CbDataList.h \ CharacterSet.h \ CharacterSet.cc \ + CtoCppDtor.h \ EnumIterator.h \ InstanceId.h \ Lock.h \ @@ -38,5 +39,4 @@ libbase_la_SOURCES = \ Subscription.h \ TextException.cc \ TextException.h \ - TidyPointer.h \ YesNoNone.h diff --git a/src/security/Session.h b/src/security/Session.h index 8c60efb517..2781c2b09e 100644 --- a/src/security/Session.h +++ b/src/security/Session.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_SECURITY_SESSION_H #define SQUID_SRC_SECURITY_SESSION_H -#include "base/TidyPointer.h" +#include "base/CtoCppDtor.h" #include "security/LockingPointer.h" #if USE_OPENSSL @@ -38,13 +38,13 @@ CtoCppDtor(gnutls_deinit, gnutls_session_t); // Locks can be implemented attaching locks counter to gnutls_session_t // objects using the gnutls_session_set_ptr()/gnutls_session_get_ptr () // library functions -typedef TidyPointer SessionPointer; +typedef std::unique_ptr SessionPointer; #else // use void* so we can check against NULL typedef void* SessionPtr; // use nullptr_t so default_delete works -typedef TidyPointer SessionPointer; +typedef std::unique_ptr SessionPointer; #endif diff --git a/src/ssl/gadgets.h b/src/ssl/gadgets.h index ab9b531770..4ee85160af 100644 --- a/src/ssl/gadgets.h +++ b/src/ssl/gadgets.h @@ -39,52 +39,52 @@ typedef SSL_METHOD * ContextMethod; #endif /** - * TidyPointer typedefs for common SSL objects + * std::unique_ptr typedefs for common SSL objects */ sk_dtor_wrapper(sk_X509, STACK_OF(X509) *, X509_free); -typedef TidyPointer X509_STACK_Pointer; +typedef std::unique_ptr X509_STACK_Pointer; CtoCpp1(EVP_PKEY_free, EVP_PKEY *) typedef Security::LockingPointer EVP_PKEY_Pointer; CtoCppDtor(BN_free, BIGNUM *); -typedef TidyPointer BIGNUM_Pointer; +typedef std::unique_ptr BIGNUM_Pointer; CtoCppDtor(BIO_free, BIO *); -typedef TidyPointer BIO_Pointer; +typedef std::unique_ptr BIO_Pointer; CtoCppDtor(ASN1_INTEGER_free, ASN1_INTEGER *); -typedef TidyPointer ASN1_INT_Pointer; +typedef std::unique_ptr ASN1_INT_Pointer; CtoCppDtor(ASN1_OCTET_STRING_free, ASN1_OCTET_STRING *); -typedef TidyPointer ASN1_OCTET_STRING_Pointer; +typedef std::unique_ptr ASN1_OCTET_STRING_Pointer; CtoCppDtor(TXT_DB_free, TXT_DB *); -typedef TidyPointer TXT_DB_Pointer; +typedef std::unique_ptr TXT_DB_Pointer; CtoCppDtor(X509_NAME_free, X509_NAME *); -typedef TidyPointer X509_NAME_Pointer; +typedef std::unique_ptr X509_NAME_Pointer; CtoCppDtor(RSA_free, RSA *); -typedef TidyPointer RSA_Pointer; +typedef std::unique_ptr RSA_Pointer; CtoCppDtor(X509_REQ_free, X509_REQ *); -typedef TidyPointer X509_REQ_Pointer; +typedef std::unique_ptr X509_REQ_Pointer; sk_dtor_wrapper(sk_X509_NAME, STACK_OF(X509_NAME) *, X509_NAME_free); -typedef TidyPointer X509_NAME_STACK_Pointer; +typedef std::unique_ptr X509_NAME_STACK_Pointer; CtoCppDtor(AUTHORITY_KEYID_free, AUTHORITY_KEYID *); -typedef TidyPointer AUTHORITY_KEYID_Pointer; +typedef std::unique_ptr AUTHORITY_KEYID_Pointer; sk_dtor_wrapper(sk_GENERAL_NAME, STACK_OF(GENERAL_NAME) *, GENERAL_NAME_free); -typedef TidyPointer GENERAL_NAME_STACK_Pointer; +typedef std::unique_ptr GENERAL_NAME_STACK_Pointer; CtoCppDtor(GENERAL_NAME_free, GENERAL_NAME *); -typedef TidyPointer GENERAL_NAME_Pointer; +typedef std::unique_ptr GENERAL_NAME_Pointer; CtoCppDtor(X509_EXTENSION_free, X509_EXTENSION *); -typedef TidyPointer X509_EXTENSION_Pointer; +typedef std::unique_ptr X509_EXTENSION_Pointer; /** \ingroup SslCrtdSslAPI