]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove last remains of TidyPointer
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 25 Jun 2016 18:02:09 +0000 (06:02 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 25 Jun 2016 18:02:09 +0000 (06:02 +1200)
src/base/CtoCppDtor.h [moved from src/base/TidyPointer.h with 83% similarity]
src/base/Makefile.am
src/security/Session.h
src/ssl/gadgets.h

similarity index 83%
rename from src/base/TidyPointer.h
rename to src/base/CtoCppDtor.h
index 7b2866d60fdc906af274c24f19fb2d7fb630dee4..31f8bfb0065943d9b6615f8c87b8a909bf528949 100644 (file)
@@ -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 <memory>
 
-#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
 
index 86b515ca622e48164640bd16d5ecc080be6cd6ff..1c03ae7351162c3bcc6d9a9cb17c253c8241bf93 100644 (file)
@@ -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
index 8c60efb517397659e800f4d998be8164d37fcbfb..2781c2b09e0315dcbe01370d387fed4b9c5cf976 100644 (file)
@@ -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<struct gnutls_session_int, Security::gnutls_deinit_cpp> SessionPointer;
+typedef std::unique_ptr<struct gnutls_session_int, Security::gnutls_deinit_cpp> SessionPointer;
 
 #else
 // use void* so we can check against NULL
 typedef void* SessionPtr;
 // use nullptr_t so default_delete works
-typedef TidyPointer<nullptr_t> SessionPointer;
+typedef std::unique_ptr<nullptr_t> SessionPointer;
 
 #endif
 
index ab9b5317707babd30f7cf7c8f89deed9110933c3..4ee85160af78989d81e3adadd682230128029355 100644 (file)
@@ -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<STACK_OF(X509), sk_X509_free_wrapper> X509_STACK_Pointer;
+typedef std::unique_ptr<STACK_OF(X509), sk_X509_free_wrapper> X509_STACK_Pointer;
 
 CtoCpp1(EVP_PKEY_free, EVP_PKEY *)
 typedef Security::LockingPointer<EVP_PKEY, EVP_PKEY_free_cpp, CRYPTO_LOCK_EVP_PKEY> EVP_PKEY_Pointer;
 
 CtoCppDtor(BN_free, BIGNUM *);
-typedef TidyPointer<BIGNUM, BN_free_cpp> BIGNUM_Pointer;
+typedef std::unique_ptr<BIGNUM, BN_free_cpp> BIGNUM_Pointer;
 
 CtoCppDtor(BIO_free, BIO *);
-typedef TidyPointer<BIO, BIO_free_cpp> BIO_Pointer;
+typedef std::unique_ptr<BIO, BIO_free_cpp> BIO_Pointer;
 
 CtoCppDtor(ASN1_INTEGER_free, ASN1_INTEGER *);
-typedef TidyPointer<ASN1_INTEGER, ASN1_INTEGER_free_cpp> ASN1_INT_Pointer;
+typedef std::unique_ptr<ASN1_INTEGER, ASN1_INTEGER_free_cpp> ASN1_INT_Pointer;
 
 CtoCppDtor(ASN1_OCTET_STRING_free, ASN1_OCTET_STRING *);
-typedef TidyPointer<ASN1_OCTET_STRING, ASN1_OCTET_STRING_free_cpp> ASN1_OCTET_STRING_Pointer;
+typedef std::unique_ptr<ASN1_OCTET_STRING, ASN1_OCTET_STRING_free_cpp> ASN1_OCTET_STRING_Pointer;
 
 CtoCppDtor(TXT_DB_free, TXT_DB *);
-typedef TidyPointer<TXT_DB, TXT_DB_free_cpp> TXT_DB_Pointer;
+typedef std::unique_ptr<TXT_DB, TXT_DB_free_cpp> TXT_DB_Pointer;
 
 CtoCppDtor(X509_NAME_free, X509_NAME *);
-typedef TidyPointer<X509_NAME, X509_NAME_free_cpp> X509_NAME_Pointer;
+typedef std::unique_ptr<X509_NAME, X509_NAME_free_cpp> X509_NAME_Pointer;
 
 CtoCppDtor(RSA_free, RSA *);
-typedef TidyPointer<RSA, RSA_free_cpp> RSA_Pointer;
+typedef std::unique_ptr<RSA, RSA_free_cpp> RSA_Pointer;
 
 CtoCppDtor(X509_REQ_free, X509_REQ *);
-typedef TidyPointer<X509_REQ, X509_REQ_free_cpp> X509_REQ_Pointer;
+typedef std::unique_ptr<X509_REQ, X509_REQ_free_cpp> X509_REQ_Pointer;
 
 sk_dtor_wrapper(sk_X509_NAME, STACK_OF(X509_NAME) *, X509_NAME_free);
-typedef TidyPointer<STACK_OF(X509_NAME), sk_X509_NAME_free_wrapper> X509_NAME_STACK_Pointer;
+typedef std::unique_ptr<STACK_OF(X509_NAME), sk_X509_NAME_free_wrapper> X509_NAME_STACK_Pointer;
 
 CtoCppDtor(AUTHORITY_KEYID_free, AUTHORITY_KEYID *);
-typedef TidyPointer<AUTHORITY_KEYID, AUTHORITY_KEYID_free_cpp> AUTHORITY_KEYID_Pointer;
+typedef std::unique_ptr<AUTHORITY_KEYID, AUTHORITY_KEYID_free_cpp> AUTHORITY_KEYID_Pointer;
 
 sk_dtor_wrapper(sk_GENERAL_NAME, STACK_OF(GENERAL_NAME) *, GENERAL_NAME_free);
-typedef TidyPointer<STACK_OF(GENERAL_NAME), sk_GENERAL_NAME_free_wrapper> GENERAL_NAME_STACK_Pointer;
+typedef std::unique_ptr<STACK_OF(GENERAL_NAME), sk_GENERAL_NAME_free_wrapper> GENERAL_NAME_STACK_Pointer;
 
 CtoCppDtor(GENERAL_NAME_free, GENERAL_NAME *);
-typedef TidyPointer<GENERAL_NAME, GENERAL_NAME_free_cpp> GENERAL_NAME_Pointer;
+typedef std::unique_ptr<GENERAL_NAME, GENERAL_NAME_free_cpp> GENERAL_NAME_Pointer;
 
 CtoCppDtor(X509_EXTENSION_free, X509_EXTENSION *);
-typedef TidyPointer<X509_EXTENSION, X509_EXTENSION_free_cpp> X509_EXTENSION_Pointer;
+typedef std::unique_ptr<X509_EXTENSION, X509_EXTENSION_free_cpp> X509_EXTENSION_Pointer;
 
 /**
  \ingroup SslCrtdSslAPI