You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2017/06/06 19:07:23 UTC
[trafficserver] branch master updated (959ab14 -> 92b168d)
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.
from 959ab14 adds autest gitignore enhancements
new 15961e7 Ran clang-tidy with modernize-use-using
new 92b168d Cleanup after running clang-tidy modernize-use-using
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
cmd/traffic_ctl/alarm.cc | 4 ++--
cmd/traffic_ctl/config.cc | 2 +-
example/cache_scan/cache_scan.cc | 2 +-
example/disable_http2/disable_http2.cc | 2 +-
example/ssl-preaccept/ssl-preaccept.cc | 2 +-
iocore/dns/DNS.cc | 2 +-
iocore/hostdb/HostDB.cc | 10 +++++-----
iocore/net/SSLClientUtils.cc | 2 +-
iocore/net/UnixConnection.cc | 4 ++--
iocore/net/UnixNetAccept.cc | 2 +-
iocore/net/UnixNetPages.cc | 2 +-
iocore/net/UnixUDPNet.cc | 2 +-
lib/cppapi/Transaction.cc | 2 +-
lib/ts/HostLookup.cc | 2 +-
lib/ts/IpMap.cc | 14 +++++++-------
lib/ts/X509HostnameValidator.cc | 2 +-
lib/ts/test_Map.cc | 12 ++++++------
lib/ts/test_PriorityQueue.cc | 4 ++--
lib/ts/test_Scalar.cc | 16 ++++++++--------
mgmt/FileManager.cc | 2 +-
mgmt/api/EventControlMain.cc | 2 +-
plugins/authproxy/authproxy.cc | 4 ++--
plugins/esi/combo_handler.cc | 2 +-
plugins/experimental/balancer/hash.cc | 4 ++--
plugins/experimental/buffer_upload/buffer_upload.cc | 4 ++--
plugins/experimental/cache_promote/cache_promote.cc | 2 +-
plugins/experimental/ssl_cert_loader/ssl-cert-loader.cc | 2 +-
plugins/experimental/sslheaders/expand.cc | 2 +-
plugins/experimental/stream_editor/stream_editor.cc | 8 ++++----
proxy/CacheControl.cc | 2 +-
proxy/InkAPI.cc | 4 ++--
proxy/Plugin.cc | 2 +-
proxy/ReverseProxy.cc | 2 +-
proxy/SocksProxy.cc | 4 ++--
proxy/http2/Http2ConnectionState.cc | 2 +-
proxy/http2/test_Http2DependencyTree.cc | 2 +-
proxy/logging/Log.cc | 2 +-
37 files changed, 70 insertions(+), 70 deletions(-)
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].
[trafficserver] 01/02: Ran clang-tidy with modernize-use-using
Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 15961e770e685ecd1dc91838fc103954ed8cdb88
Author: Bryan Call <bc...@apache.org>
AuthorDate: Sun May 28 19:53:48 2017 -0700
Ran clang-tidy with modernize-use-using
---
cmd/traffic_ctl/alarm.cc | 4 ++--
cmd/traffic_ctl/config.cc | 2 +-
example/cache_scan/cache_scan.cc | 2 +-
example/disable_http2/disable_http2.cc | 2 +-
example/ssl-preaccept/ssl-preaccept.cc | 2 +-
iocore/dns/DNS.cc | 2 +-
iocore/hostdb/HostDB.cc | 10 +++++-----
iocore/net/SSLClientUtils.cc | 2 +-
iocore/net/UnixConnection.cc | 4 ++--
iocore/net/UnixNetAccept.cc | 2 +-
iocore/net/UnixNetPages.cc | 2 +-
iocore/net/UnixUDPNet.cc | 2 +-
lib/cppapi/Transaction.cc | 2 +-
lib/ts/HostLookup.cc | 2 +-
lib/ts/IpMap.cc | 14 +++++++-------
lib/ts/X509HostnameValidator.cc | 2 +-
lib/ts/test_Map.cc | 12 ++++++------
lib/ts/test_PriorityQueue.cc | 4 ++--
lib/ts/test_Scalar.cc | 16 ++++++++--------
mgmt/FileManager.cc | 2 +-
mgmt/api/EventControlMain.cc | 2 +-
plugins/authproxy/authproxy.cc | 4 ++--
plugins/esi/combo_handler.cc | 2 +-
plugins/experimental/balancer/hash.cc | 4 ++--
plugins/experimental/buffer_upload/buffer_upload.cc | 4 ++--
plugins/experimental/cache_promote/cache_promote.cc | 2 +-
plugins/experimental/ssl_cert_loader/ssl-cert-loader.cc | 2 +-
plugins/experimental/sslheaders/expand.cc | 2 +-
plugins/experimental/stream_editor/stream_editor.cc | 8 ++++----
proxy/CacheControl.cc | 2 +-
proxy/InkAPI.cc | 4 ++--
proxy/Plugin.cc | 2 +-
proxy/ReverseProxy.cc | 2 +-
proxy/SocksProxy.cc | 4 ++--
proxy/http2/Http2ConnectionState.cc | 2 +-
proxy/http2/test_Http2DependencyTree.cc | 2 +-
proxy/logging/Log.cc | 2 +-
37 files changed, 70 insertions(+), 70 deletions(-)
diff --git a/cmd/traffic_ctl/alarm.cc b/cmd/traffic_ctl/alarm.cc
index 5b014a4..d3229f3 100644
--- a/cmd/traffic_ctl/alarm.cc
+++ b/cmd/traffic_ctl/alarm.cc
@@ -24,7 +24,7 @@
#include "traffic_ctl.h"
struct AlarmListPolicy {
- typedef char *entry_type;
+ using entry_type = char *;
static void
free(entry_type e)
@@ -39,7 +39,7 @@ struct AlarmListPolicy {
}
};
-typedef CtrlMgmtList<AlarmListPolicy> CtrlAlarmList;
+using CtrlAlarmList = CtrlMgmtList<AlarmListPolicy>;
static int
alarm_list(unsigned argc, const char **argv)
diff --git a/cmd/traffic_ctl/config.cc b/cmd/traffic_ctl/config.cc
index 660174b..cc846db 100644
--- a/cmd/traffic_ctl/config.cc
+++ b/cmd/traffic_ctl/config.cc
@@ -27,7 +27,7 @@
#include <P_RecUtils.h>
struct RecordDescriptionPolicy {
- typedef TSConfigRecordDescription *entry_type;
+ using entry_type = TSConfigRecordDescription *;
static void
free(entry_type e)
diff --git a/example/cache_scan/cache_scan.cc b/example/cache_scan/cache_scan.cc
index cd73dd5..9121771 100644
--- a/example/cache_scan/cache_scan.cc
+++ b/example/cache_scan/cache_scan.cc
@@ -59,7 +59,7 @@ struct cache_scan_state_t {
bool write_pending;
};
-typedef struct cache_scan_state_t cache_scan_state;
+using cache_scan_state = struct cache_scan_state_t;
//----------------------------------------------------------------------------
static int
diff --git a/example/disable_http2/disable_http2.cc b/example/disable_http2/disable_http2.cc
index 18b2637..6c4ce52 100644
--- a/example/disable_http2/disable_http2.cc
+++ b/example/disable_http2/disable_http2.cc
@@ -39,7 +39,7 @@ typedef std::unordered_map<int, TSNextProtocolSet> AcceptorMapping; // stores pr
AcceptorMapping AcceptorMap;
// Map of domains to tweak.
-typedef std::unordered_set<std::string> DomainSet;
+using DomainSet = std::unordered_set<std::string>;
DomainSet Domains;
int
diff --git a/example/ssl-preaccept/ssl-preaccept.cc b/example/ssl-preaccept/ssl-preaccept.cc
index 3fa703f..42b8115 100644
--- a/example/ssl-preaccept/ssl-preaccept.cc
+++ b/example/ssl-preaccept/ssl-preaccept.cc
@@ -43,7 +43,7 @@ namespace
{
std::string ConfigPath;
typedef std::pair<IpAddr, IpAddr> IpRange;
-typedef std::deque<IpRange> IpRangeQueue;
+using IpRangeQueue = std::deque<IpRange>;
IpRangeQueue ClientBlindTunnelIp;
Configuration Config; // global configuration
diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc
index 8ec00f4..f07775e 100644
--- a/iocore/dns/DNS.cc
+++ b/iocore/dns/DNS.cc
@@ -1711,7 +1711,7 @@ ink_dns_init(ModuleVersion v)
#ifdef TS_HAS_TESTS
struct DNSRegressionContinuation;
-typedef int (DNSRegressionContinuation::*DNSRegContHandler)(int, void *);
+using DNSRegContHandler = int (DNSRegressionContinuation::*)(int, void *);
struct DNSRegressionContinuation : public Continuation {
int hosts;
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index 684cc37..2cb18b9 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -1791,7 +1791,7 @@ HostDBInfo::rr()
}
struct ShowHostDB;
-typedef int (ShowHostDB::*ShowHostDBEventHandler)(int event, Event *data);
+using ShowHostDBEventHandler = int (ShowHostDB::*)(int, Event *);
struct ShowHostDB : public ShowCont {
char *name;
uint16_t port;
@@ -2081,7 +2081,7 @@ register_ShowHostDB(Continuation *c, HTTPHdr *h)
#define HOSTDB_TEST_LENGTH 100000
struct HostDBTestReverse;
-typedef int (HostDBTestReverse::*HostDBTestReverseHandler)(int, void *);
+using HostDBTestReverseHandler = int (HostDBTestReverse::*)(int, void *);
struct HostDBTestReverse : public Continuation {
RegressionTest *test;
int type;
@@ -2186,14 +2186,14 @@ ink_hostdb_init(ModuleVersion v)
/// Pair of IP address and host name from a host file.
struct HostFilePair {
- typedef HostFilePair self;
+ using self = HostFilePair;
IpAddr ip;
const char *name;
};
struct HostDBFileContinuation : public Continuation {
- typedef HostDBFileContinuation self;
- typedef std::vector<INK_MD5> Keys;
+ using self = HostDBFileContinuation;
+ using Keys = std::vector<INK_MD5>;
int idx = 0; ///< Working index.
const char *name = nullptr; ///< Host name (just for debugging)
diff --git a/iocore/net/SSLClientUtils.cc b/iocore/net/SSLClientUtils.cc
index 58df52f..4e46c42 100644
--- a/iocore/net/SSLClientUtils.cc
+++ b/iocore/net/SSLClientUtils.cc
@@ -30,7 +30,7 @@
#include <openssl/pem.h>
#if (OPENSSL_VERSION_NUMBER >= 0x10000000L) // openssl returns a const SSL_METHOD
-typedef const SSL_METHOD *ink_ssl_method_t;
+using ink_ssl_method_t = const SSL_METHOD *;
#else
typedef SSL_METHOD *ink_ssl_method_t;
#endif
diff --git a/iocore/net/UnixConnection.cc b/iocore/net/UnixConnection.cc
index 8f01d46..6516a8c 100644
--- a/iocore/net/UnixConnection.cc
+++ b/iocore/net/UnixConnection.cc
@@ -193,8 +193,8 @@ namespace
@endcode
*/
template <typename T> struct cleaner {
- T *obj; ///< Object instance.
- typedef void (T::*method)(); ///< Method signature.
+ T *obj; ///< Object instance.
+ using method = void (T::*)(); ///< Method signature.
method m;
cleaner(T *_obj, method _method) : obj(_obj), m(_method) {}
diff --git a/iocore/net/UnixNetAccept.cc b/iocore/net/UnixNetAccept.cc
index c47d640..8c47fca 100644
--- a/iocore/net/UnixNetAccept.cc
+++ b/iocore/net/UnixNetAccept.cc
@@ -28,7 +28,7 @@
#endif
#define ROUNDUP(x, y) ((((x) + ((y)-1)) / (y)) * (y))
-typedef int (NetAccept::*NetAcceptHandler)(int, void *);
+using NetAcceptHandler = int (NetAccept::*)(int, void *);
volatile int dummy_volatile = 0;
int accept_till_done = 1;
diff --git a/iocore/net/UnixNetPages.cc b/iocore/net/UnixNetPages.cc
index 288a031..5b97138 100644
--- a/iocore/net/UnixNetPages.cc
+++ b/iocore/net/UnixNetPages.cc
@@ -27,7 +27,7 @@
#include "I_Tasks.h"
struct ShowNet;
-typedef int (ShowNet::*ShowNetEventHandler)(int event, Event *data);
+using ShowNetEventHandler = int (ShowNet::*)(int, Event *);
struct ShowNet : public ShowCont {
int ithread;
IpEndpoint addr;
diff --git a/iocore/net/UnixUDPNet.cc b/iocore/net/UnixUDPNet.cc
index 41bd62d..7ae8b49 100644
--- a/iocore/net/UnixUDPNet.cc
+++ b/iocore/net/UnixUDPNet.cc
@@ -32,7 +32,7 @@
#include "P_Net.h"
#include "P_UDPNet.h"
-typedef int (UDPNetHandler::*UDPNetContHandler)(int, void *);
+using UDPNetContHandler = int (UDPNetHandler::*)(int, void *);
inkcoreapi ClassAllocator<UDPPacketInternal> udpPacketAllocator("udpPacketAllocator");
EventType ET_UDP;
diff --git a/lib/cppapi/Transaction.cc b/lib/cppapi/Transaction.cc
index 5e72eec..a2b7f66 100644
--- a/lib/cppapi/Transaction.cc
+++ b/lib/cppapi/Transaction.cc
@@ -417,7 +417,7 @@ namespace
class initializeHandles
{
public:
- typedef TSReturnCode (*GetterFunction)(TSHttpTxn, TSMBuffer *, TSMLoc *);
+ using GetterFunction = TSReturnCode (*)(TSHttpTxn, TSMBuffer *, TSMLoc *);
initializeHandles(GetterFunction getter) : getter_(getter) {}
bool
operator()(TSHttpTxn txn, TSMBuffer &hdr_buf, TSMLoc &hdr_loc, const char *handles_name)
diff --git a/lib/ts/HostLookup.cc b/lib/ts/HostLookup.cc
index cfa4509..7bec412 100644
--- a/lib/ts/HostLookup.cc
+++ b/lib/ts/HostLookup.cc
@@ -554,7 +554,7 @@ charIndex::iter_next(charIndexIterState *s)
// Since the only iter state is an index into the
// array typedef it
-typedef int hostArrayIterState;
+using hostArrayIterState = int;
class hostArray
{
diff --git a/lib/ts/IpMap.cc b/lib/ts/IpMap.cc
index 8547289..54eb768 100644
--- a/lib/ts/IpMap.cc
+++ b/lib/ts/IpMap.cc
@@ -134,9 +134,9 @@ namespace detail
struct IpMapBase {
friend class ::IpMap;
- typedef IpMapBase<N> self_type; ///< Self reference type.
- typedef typename N::ArgType ArgType; ///< Import type.
- typedef typename N::Metric Metric; ///< Import type.g482
+ using self_type = IpMapBase<N>; ///< Self reference type.
+ using ArgType = typename N::ArgType; ///< Import type.
+ using Metric = typename Ip4Node::Metric; ///< Import type.g482
IpMapBase() : _root(nullptr) {}
~IpMapBase() { this->clear(); }
@@ -745,7 +745,7 @@ namespace detail
friend struct IpMapBase<Ip4Node>;
public:
- typedef Ip4Node self_type; ///< Self reference type.
+ using self_type = ts::detail::Ip4Node; ///< Self reference type.
/// Construct with values.
Ip4Node(ArgType min, ///< Minimum address (host order).
@@ -881,7 +881,7 @@ namespace detail
};
//----------------------------------------------------------------------------
- typedef Interval<sockaddr_in6> Ip6Span;
+ using Ip6Span = Interval<sockaddr_in6>;
/** Node for IPv6 map.
*/
@@ -890,10 +890,10 @@ namespace detail
friend struct IpMapBase<Ip6Node>;
public:
- typedef Ip6Node self_type; ///< Self reference type.
+ using self_type = ts::detail::Ip6Node; ///< Self reference type.
/// Override @c ArgType from @c Interval because the convention
/// is to use a pointer, not a reference.
- typedef Metric const *ArgType;
+ using ArgType = const ts::detail::Interval<sockaddr_in6, const sockaddr_in6 &>::Metric *;
/// Construct from pointers.
Ip6Node(ArgType min, ///< Minimum address (network order).
diff --git a/lib/ts/X509HostnameValidator.cc b/lib/ts/X509HostnameValidator.cc
index 0d1f61d..3e36795 100644
--- a/lib/ts/X509HostnameValidator.cc
+++ b/lib/ts/X509HostnameValidator.cc
@@ -29,7 +29,7 @@
#include "ts/ink_memory.h"
-typedef bool (*equal_fn)(const unsigned char *prefix, size_t prefix_len, const unsigned char *suffix, size_t suffix_len);
+using equal_fn = bool (*)(const unsigned char *, size_t, const unsigned char *, size_t);
/* Return a ptr to a valid wildcard or NULL if not found
*
diff --git a/lib/ts/test_Map.cc b/lib/ts/test_Map.cc
index 9a5ab0e..302656d 100644
--- a/lib/ts/test_Map.cc
+++ b/lib/ts/test_Map.cc
@@ -24,15 +24,15 @@
#include "ts/Map.h"
#include <list>
-typedef const char cchar;
+using cchar = const char;
struct Item {
LINK(Item, m_link);
struct Hash {
- typedef uint32_t ID;
- typedef uint32_t Key;
- typedef Item Value;
- typedef DList(Item, m_link) ListHead;
+ using ID = uint32_t;
+ using Key = uint32_t;
+ using Value = Item;
+ using ListHead = DLL<Item, Item::Link_m_link>;
static ID
hash(Key key)
@@ -61,7 +61,7 @@ Item::Hash::equal(Key lhs, Key rhs)
return lhs == rhs;
}
-typedef TSHashTable<Item::Hash> Table;
+using Table = TSHashTable<Item::Hash>;
void
test_TSHashTable()
diff --git a/lib/ts/test_PriorityQueue.cc b/lib/ts/test_PriorityQueue.cc
index c8ebfb8..73b20f8 100644
--- a/lib/ts/test_PriorityQueue.cc
+++ b/lib/ts/test_PriorityQueue.cc
@@ -45,8 +45,8 @@ public:
string content;
};
-typedef PriorityQueueEntry<N *> Entry;
-typedef PriorityQueue<N *> PQ;
+using Entry = PriorityQueueEntry<N *>;
+using PQ = PriorityQueue<N *>;
// For debug
void
diff --git a/lib/ts/test_Scalar.cc b/lib/ts/test_Scalar.cc
index f021ec1..dece272 100644
--- a/lib/ts/test_Scalar.cc
+++ b/lib/ts/test_Scalar.cc
@@ -39,7 +39,7 @@ typedef ts::Scalar<KB::SCALE * 1024, off_t> MB;
#define FAIL_LINE " line ", __LINE__
struct TestBox {
- typedef TestBox self; ///< Self reference type.
+ using self = TestBox; ///< Self reference type.
std::string _name;
@@ -112,7 +112,7 @@ void
Test_1()
{
constexpr static int SCALE = 4096;
- typedef ts::Scalar<SCALE> PageSize;
+ using PageSize = ts::Scalar<SCALE>;
TestBox test("TS.Scalar basic");
PageSize pg1(1);
@@ -128,8 +128,8 @@ Test_2()
constexpr static int SCALE_1 = 8192;
constexpr static int SCALE_2 = 512;
- typedef ts::Scalar<SCALE_1> Size_1;
- typedef ts::Scalar<SCALE_2> Size_2;
+ using Size_1 = ts::Scalar<SCALE_1>;
+ using Size_2 = ts::Scalar<SCALE_2>;
TestBox test("TS.Scalar Conversion of scales of multiples");
Size_2 sz_a(2);
@@ -170,8 +170,8 @@ Test_3()
constexpr static int SCALE_1 = 30;
constexpr static int SCALE_2 = 20;
- typedef ts::Scalar<SCALE_1> Size_1;
- typedef ts::Scalar<SCALE_2> Size_2;
+ using Size_1 = ts::Scalar<SCALE_1>;
+ using Size_2 = ts::Scalar<SCALE_2>;
TestBox test("TS.Scalar common factor conversions");
Size_2 sz_a(2);
@@ -220,10 +220,10 @@ Test_5()
{
TestBox test("TS.Scalar: arithmetics");
- typedef ts::Scalar<1024> KBytes;
+ using KBytes = ts::Scalar<1024>;
typedef ts::Scalar<1024, long int> KiBytes;
typedef ts::Scalar<1, int64_t> Bytes;
- typedef ts::Scalar<1024 * KBytes::SCALE> MBytes;
+ using MBytes = ts::Scalar<1024 * KBytes::SCALE>;
Bytes bytes(96);
KBytes kbytes(2);
diff --git a/mgmt/FileManager.cc b/mgmt/FileManager.cc
index 968cc9d..78cb8ff 100644
--- a/mgmt/FileManager.cc
+++ b/mgmt/FileManager.cc
@@ -36,7 +36,7 @@
#define DIR_MODE S_IRWXU
#define FILE_MODE S_IRWXU
-typedef fileEntry snapshot;
+using snapshot = fileEntry;
FileManager::FileManager()
{
diff --git a/mgmt/api/EventControlMain.cc b/mgmt/api/EventControlMain.cc
index 96d9d93..d08652e 100644
--- a/mgmt/api/EventControlMain.cc
+++ b/mgmt/api/EventControlMain.cc
@@ -516,7 +516,7 @@ done:
return ret;
}
-typedef TSMgmtError (*event_message_handler)(EventClientT *, void *, size_t);
+using event_message_handler = TSMgmtError (*)(EventClientT *, void *, size_t);
static const event_message_handler handlers[] = {
nullptr, // FILE_READ
diff --git a/plugins/authproxy/authproxy.cc b/plugins/authproxy/authproxy.cc
index ebeb77f..da422dd 100644
--- a/plugins/authproxy/authproxy.cc
+++ b/plugins/authproxy/authproxy.cc
@@ -44,7 +44,7 @@ using std::strlen;
struct AuthRequestContext;
-typedef bool (*AuthRequestTransform)(AuthRequestContext *auth);
+using AuthRequestTransform = bool (*)(AuthRequestContext *);
const static int MAX_HOST_LENGTH = 4096;
@@ -73,7 +73,7 @@ static AuthOptions *AuthGlobalOptions;
// TS_EVENT_CONTINUE Continue the state machine, returning to the ATS event loop
// TS_EVENT_NONE Stop processing (because a nested dispatch occurred)
// Anything else Continue the state machine with this event
-typedef TSEvent (*StateHandler)(struct AuthRequestContext *, void *edata);
+using StateHandler = TSEvent (*)(struct AuthRequestContext *, void *);
struct StateTransition {
TSEvent event;
diff --git a/plugins/esi/combo_handler.cc b/plugins/esi/combo_handler.cc
index 15fe99e..1c658c9 100644
--- a/plugins/esi/combo_handler.cc
+++ b/plugins/esi/combo_handler.cc
@@ -70,7 +70,7 @@ static int COMBO_HANDLER_PATH_SIZE;
TSDebug(DEBUG_TAG, "[%s:%d] [%s] DEBUG: " fmt, __FILE__, __LINE__, __FUNCTION__, ##args); \
} while (0)
-typedef list<string> StringList;
+using StringList = int;
struct ClientRequest {
TSHttpStatus status;
diff --git a/plugins/experimental/balancer/hash.cc b/plugins/experimental/balancer/hash.cc
index a624d71..d08df3a 100644
--- a/plugins/experimental/balancer/hash.cc
+++ b/plugins/experimental/balancer/hash.cc
@@ -69,7 +69,7 @@ struct md5_key {
unsigned char key[MD5_DIGEST_LENGTH];
};
-typedef void (*HashComponent)(TSHttpTxn txn, TSRemapRequestInfo *, MD5_CTX *);
+using HashComponent = void (*)(TSHttpTxn, TSRemapRequestInfo *, MD5_CTX *);
// Hash on the source (client) IP address.
void
@@ -146,7 +146,7 @@ done:
struct HashBalancer : public BalancerInstance {
typedef std::map<md5_key, BalancerTarget> hash_ring_type;
- typedef std::vector<HashComponent> hash_part_type;
+ using hash_part_type = std::vector<HashComponent>;
enum {
iterations = 10,
diff --git a/plugins/experimental/buffer_upload/buffer_upload.cc b/plugins/experimental/buffer_upload/buffer_upload.cc
index 8e8c26d..c2c4c37 100644
--- a/plugins/experimental/buffer_upload/buffer_upload.cc
+++ b/plugins/experimental/buffer_upload/buffer_upload.cc
@@ -76,7 +76,7 @@ struct upload_config_t {
int thread_num;
};
-typedef struct upload_config_t upload_config;
+using upload_config = struct upload_config_t;
enum config_type {
TYPE_INT,
@@ -135,7 +135,7 @@ struct pvc_state_t {
TSHttpTxn http_txnp;
};
-typedef struct pvc_state_t pvc_state;
+using pvc_state = struct pvc_state_t;
// print IOBuffer for test purpose
/*
diff --git a/plugins/experimental/cache_promote/cache_promote.cc b/plugins/experimental/cache_promote/cache_promote.cc
index 9455b8f..4023e01 100644
--- a/plugins/experimental/cache_promote/cache_promote.cc
+++ b/plugins/experimental/cache_promote/cache_promote.cc
@@ -187,7 +187,7 @@ struct LRUHashHasher {
};
typedef std::pair<LRUHash, unsigned> LRUEntry;
-typedef std::list<LRUEntry> LRUList;
+using LRUList = std::list<LRUEntry>;
typedef std::unordered_map<const LRUHash *, LRUList::iterator, LRUHashHasher, LRUHashHasher> LRUMap;
static LRUEntry NULL_LRU_ENTRY; // Used to create an "empty" new LRUEntry
diff --git a/plugins/experimental/ssl_cert_loader/ssl-cert-loader.cc b/plugins/experimental/ssl_cert_loader/ssl-cert-loader.cc
index 8b02d77..8ed0906 100644
--- a/plugins/experimental/ssl_cert_loader/ssl-cert-loader.cc
+++ b/plugins/experimental/ssl_cert_loader/ssl-cert-loader.cc
@@ -78,7 +78,7 @@ public:
std::string ConfigPath;
typedef std::pair<IpAddr, IpAddr> IpRange;
-typedef std::deque<IpRange> IpRangeQueue;
+using IpRangeQueue = std::deque<IpRange>;
Configuration Config; // global configuration
diff --git a/plugins/experimental/sslheaders/expand.cc b/plugins/experimental/sslheaders/expand.cc
index 059ca42..142a98e 100644
--- a/plugins/experimental/sslheaders/expand.cc
+++ b/plugins/experimental/sslheaders/expand.cc
@@ -22,7 +22,7 @@
#include <openssl/x509.h>
#include <openssl/pem.h>
-typedef void (*x509_expansion)(X509 *, BIO *);
+using x509_expansion = void (*)(X509 *, BIO *);
static void
x509_expand_none(X509 *, BIO *)
diff --git a/plugins/experimental/stream_editor/stream_editor.cc b/plugins/experimental/stream_editor/stream_editor.cc
index 35db91f..5d78e8b 100644
--- a/plugins/experimental/stream_editor/stream_editor.cc
+++ b/plugins/experimental/stream_editor/stream_editor.cc
@@ -101,8 +101,8 @@
#include "ts/ts.h"
struct edit_t;
-typedef std::set<edit_t> editset_t;
-typedef editset_t::const_iterator edit_p;
+using editset_t = std::set<edit_t>;
+using edit_p = editset_t::const_iterator;
struct edit_t {
const size_t start;
@@ -547,8 +547,8 @@ public:
}
}
};
-typedef std::vector<rule_t> ruleset_t;
-typedef ruleset_t::const_iterator rule_p;
+using ruleset_t = std::vector<rule_t>;
+using rule_p = ruleset_t::const_iterator;
typedef struct contdata_t {
TSCont cont;
diff --git a/proxy/CacheControl.cc b/proxy/CacheControl.cc
index cff81f9..271c296 100644
--- a/proxy/CacheControl.cc
+++ b/proxy/CacheControl.cc
@@ -75,7 +75,7 @@ CC_delete_table()
// a timeout
//
struct CC_FreerContinuation;
-typedef int (CC_FreerContinuation::*CC_FreerContHandler)(int, void *);
+using CC_FreerContHandler = int (CC_FreerContinuation::*)(int, void *);
struct CC_FreerContinuation : public Continuation {
CC_table *p;
int
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index c3f40fe..9457ac7 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -2133,8 +2133,8 @@ TSUrlStringGet(TSMBuffer bufp, TSMLoc obj, int *length)
return url_string_get(url_impl, nullptr, length, nullptr);
}
-typedef const char *(URL::*URLPartGetF)(int *length);
-typedef void (URL::*URLPartSetF)(const char *value, int length);
+using URLPartGetF = const char *(URL::*)(int *);
+using URLPartSetF = void (URL::*)(const char *, int);
static const char *
URLPartGet(TSMBuffer bufp, TSMLoc obj, int *length, URLPartGetF url_f)
diff --git a/proxy/Plugin.cc b/proxy/Plugin.cc
index 1ca60c7..240574b 100644
--- a/proxy/Plugin.cc
+++ b/proxy/Plugin.cc
@@ -36,7 +36,7 @@
static const char *plugin_dir = ".";
-typedef void (*init_func_t)(int argc, char *argv[]);
+using init_func_t = void (*)(int, char **);
// Plugin registration vars
//
diff --git a/proxy/ReverseProxy.cc b/proxy/ReverseProxy.cc
index 729f345..ef3d876 100644
--- a/proxy/ReverseProxy.cc
+++ b/proxy/ReverseProxy.cc
@@ -119,7 +119,7 @@ response_url_remap(HTTPHdr *response_header)
/** Used to read the remap.config file after the manager signals a change. */
struct UR_UpdateContinuation;
-typedef int (UR_UpdateContinuation::*UR_UpdContHandler)(int, void *);
+using UR_UpdContHandler = int (UR_UpdateContinuation::*)(int, void *);
struct UR_UpdateContinuation : public Continuation {
int
file_update_handler(int /* etype ATS_UNUSED */, void * /* data ATS_UNUSED */)
diff --git a/proxy/SocksProxy.cc b/proxy/SocksProxy.cc
index fcda651..0ef6f6b 100644
--- a/proxy/SocksProxy.cc
+++ b/proxy/SocksProxy.cc
@@ -43,7 +43,7 @@ static RecRawStatBlock *socksproxy_stat_block;
#define SOCKSPROXY_INC_STAT(x) RecIncrRawStat(socksproxy_stat_block, mutex->thread_holding, x)
struct SocksProxy : public Continuation {
- typedef int (SocksProxy::*EventHandler)(int event, void *data);
+ using EventHandler = int (SocksProxy::*)(int, void *);
enum {
SOCKS_INIT = 1,
@@ -481,7 +481,7 @@ new_SocksProxy(NetVConnection *netVC)
}
struct SocksAccepter : public Continuation {
- typedef int (SocksAccepter::*SocksAccepterHandler)(int, void *);
+ using SocksAccepterHandler = int (SocksAccepter::*)(int, void *);
int
mainEvent(int event, NetVConnection *netVC)
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 306c2e0..16ed21d 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -33,7 +33,7 @@
#define DebugHttp2Stream(ua_session, stream_id, fmt, ...) \
DebugSsn(ua_session, "http2_con", "[%" PRId64 "] [%u] " fmt, ua_session->connection_id(), stream_id, ##__VA_ARGS__);
-typedef Http2Error (*http2_frame_dispatch)(Http2ConnectionState &, const Http2Frame &);
+using http2_frame_dispatch = Http2Error (*)(Http2ConnectionState &, const Http2Frame &);
static const int buffer_size_index[HTTP2_FRAME_TYPE_MAX] = {
BUFFER_SIZE_INDEX_16K, // HTTP2_FRAME_TYPE_DATA
diff --git a/proxy/http2/test_Http2DependencyTree.cc b/proxy/http2/test_Http2DependencyTree.cc
index 5e12f18..d5afc5d 100644
--- a/proxy/http2/test_Http2DependencyTree.cc
+++ b/proxy/http2/test_Http2DependencyTree.cc
@@ -31,7 +31,7 @@
using namespace std;
-typedef Http2DependencyTree<string *> Tree;
+using Tree = Http2DependencyTree<std::__cxx11::string *>;
/**
* Exclusive Dependency Creation
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 317b3cb..79b1cdb 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -171,7 +171,7 @@ Log::change_configuration()
-------------------------------------------------------------------------*/
struct PeriodicWakeup;
-typedef int (PeriodicWakeup::*PeriodicWakeupHandler)(int, void *);
+using PeriodicWakeupHandler = int (PeriodicWakeup::*)(int, void *);
struct PeriodicWakeup : Continuation {
int m_preproc_threads;
int m_flush_threads;
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 02/02: Cleanup after running clang-tidy
modernize-use-using
Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 92b168d984304415e61237c5be013c07f260b0b1
Author: Bryan Call <bc...@apache.org>
AuthorDate: Sun May 28 20:11:44 2017 -0700
Cleanup after running clang-tidy modernize-use-using
---
lib/ts/IpMap.cc | 6 +++---
plugins/esi/combo_handler.cc | 2 +-
proxy/http2/test_Http2DependencyTree.cc | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/ts/IpMap.cc b/lib/ts/IpMap.cc
index 54eb768..88d0a4b 100644
--- a/lib/ts/IpMap.cc
+++ b/lib/ts/IpMap.cc
@@ -134,9 +134,9 @@ namespace detail
struct IpMapBase {
friend class ::IpMap;
- using self_type = IpMapBase<N>; ///< Self reference type.
- using ArgType = typename N::ArgType; ///< Import type.
- using Metric = typename Ip4Node::Metric; ///< Import type.g482
+ using self_type = IpMapBase<N>; ///< Self reference type.
+ using ArgType = typename N::ArgType; ///< Import type.
+ using Metric = typename N::Metric; ///< Import type.g482
IpMapBase() : _root(nullptr) {}
~IpMapBase() { this->clear(); }
diff --git a/plugins/esi/combo_handler.cc b/plugins/esi/combo_handler.cc
index 1c658c9..64d4e85 100644
--- a/plugins/esi/combo_handler.cc
+++ b/plugins/esi/combo_handler.cc
@@ -70,7 +70,7 @@ static int COMBO_HANDLER_PATH_SIZE;
TSDebug(DEBUG_TAG, "[%s:%d] [%s] DEBUG: " fmt, __FILE__, __LINE__, __FUNCTION__, ##args); \
} while (0)
-using StringList = int;
+using StringList = list<string>;
struct ClientRequest {
TSHttpStatus status;
diff --git a/proxy/http2/test_Http2DependencyTree.cc b/proxy/http2/test_Http2DependencyTree.cc
index d5afc5d..5056cbd 100644
--- a/proxy/http2/test_Http2DependencyTree.cc
+++ b/proxy/http2/test_Http2DependencyTree.cc
@@ -31,7 +31,7 @@
using namespace std;
-using Tree = Http2DependencyTree<std::__cxx11::string *>;
+using Tree = Http2DependencyTree<std::string *>;
/**
* Exclusive Dependency Creation
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.