You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/04/20 01:19:31 UTC
[6/6] git commit: TS-1820 Cleanup the comments some,
and eliminate a few unused parameters where it was obvious
TS-1820 Cleanup the comments some, and eliminate a few unused parameters where it was obvious
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c88d6153
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c88d6153
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c88d6153
Branch: refs/heads/master
Commit: c88d6153e0850a5c5f633ae8afd7947773b65d99
Parents: c6dd66e
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Apr 17 10:30:42 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Apr 19 17:17:53 2013 -0600
----------------------------------------------------------------------
cop/TrafficCop.cc | 2 +-
example/cache-scan/cache-scan.cc | 4 +-
example/replace-header/replace-header.c | 6 ++--
example/response-header-1/response-header-1.c | 7 ++--
example/server-transform/server-transform.c | 17 +---------
iocore/cache/CacheWrite.cc | 4 +-
iocore/cluster/ClusterProcessor.cc | 3 +-
iocore/cluster/ClusterVConnection.cc | 2 +-
iocore/net/Connection.cc | 2 +-
iocore/net/I_NetProcessor.h | 7 ++--
iocore/net/SSLCertLookup.cc | 4 +-
iocore/net/SSLNetVConnection.cc | 4 +-
iocore/net/UnixNet.cc | 8 ++--
iocore/net/UnixUDPNet.cc | 2 +-
lib/cpp11api/cpp11api.cc | 8 ++---
lib/ts/IpMapTest.cc | 6 ++--
lib/ts/ink_defs.h | 3 +-
lib/ts/ink_memory.cc | 6 ++--
lib/ts/ink_queue_ext.cc | 9 ++---
lib/ts/ink_resource.cc | 6 ---
lib/ts/ink_resource.h | 1 -
lib/ts/ink_stack_trace.cc | 4 +-
lib/ts/ink_stack_trace.h | 2 +-
lib/ts/lockfile.cc | 3 +-
lib/tsconfig/TsErrataUtil.cc | 4 +-
lib/wccp/WccpStatic.cc | 4 +-
mgmt/Main.cc | 2 +-
mgmt/ProxyConfig.h | 6 ++--
mgmt/api/INKMgmtAPI.cc | 8 ++--
mgmt/api/remote/APITestCliRemote.cc | 4 +-
mgmt/cli/ConfigCmd.cc | 26 +++++++-------
mgmt/tools/ConfigAPI.cc | 6 ++--
mgmt/tools/SysAPI.cc | 24 +++++++-------
plugins/conf_remap/conf_remap.cc | 4 +-
plugins/experimental/authproxy/authproxy.cc | 20 ++++++------
.../experimental/channel_stats/channel_stats.cc | 8 ++--
.../custom_redirect/custom_redirect.cc | 2 +-
plugins/experimental/esi/combo_handler.cc | 4 +-
plugins/experimental/esi/esi.cc | 4 +-
.../experimental/esi/test/TestHandlerManager.cc | 2 +-
plugins/experimental/gzip/gzip.cc | 10 +++---
plugins/experimental/gzip/misc.cc | 10 +++---
plugins/experimental/header_rewrite/conditions.cc | 14 ++++----
plugins/experimental/header_rewrite/conditions.h | 8 ++--
.../experimental/header_rewrite/header_rewrite.cc | 2 +-
plugins/experimental/header_rewrite/matcher.h | 10 +++---
plugins/experimental/header_rewrite/operators.h | 2 +-
plugins/experimental/lua/lutil.cc | 2 +-
plugins/experimental/lua/remap.cc | 6 ++--
plugins/experimental/metalink/metalink.cc | 20 ++++++------
plugins/experimental/tcp_info/tcp_info.cc | 2 +-
plugins/header_filter/header_filter.cc | 4 +-
plugins/regex_remap/regex_remap.cc | 2 +-
proxy/CacheControl.cc | 2 +-
proxy/ControlBase.cc | 6 ++--
proxy/InkAPI.cc | 8 ++--
proxy/InkAPITest.cc | 2 +-
proxy/Main.cc | 2 +-
proxy/PluginVC.cc | 2 +-
proxy/hdrs/MIME.cc | 4 +-
proxy/http/HttpBodyFactory.cc | 9 ++---
proxy/http/HttpBodyFactory.h | 21 +++++-------
proxy/http/HttpTransact.cc | 6 +---
proxy/http/HttpUpdateTester.cc | 2 +-
proxy/logcat.cc | 2 +-
proxy/logstats.cc | 2 +-
proxy/sac.cc | 2 +-
proxy/signals.cc | 6 ++--
tools/jtest/jtest.cc | 6 ++--
69 files changed, 192 insertions(+), 230 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/cop/TrafficCop.cc
----------------------------------------------------------------------
diff --git a/cop/TrafficCop.cc b/cop/TrafficCop.cc
index a595f4d..55b0a0e 100644
--- a/cop/TrafficCop.cc
+++ b/cop/TrafficCop.cc
@@ -1104,7 +1104,7 @@ read_manager_string(const char *variable, char *value, size_t val_len)
return -1;
}
- ink_strlcpy(value, p, val_len);
+ ink_strlcpy(value, p, MIN((size_t)(e - p + 1), val_len));
return 0;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/example/cache-scan/cache-scan.cc
----------------------------------------------------------------------
diff --git a/example/cache-scan/cache-scan.cc b/example/cache-scan/cache-scan.cc
index 4d2cf78..ea0d310 100644
--- a/example/cache-scan/cache-scan.cc
+++ b/example/cache-scan/cache-scan.cc
@@ -257,7 +257,7 @@ cleanup(TSCont contp)
//----------------------------------------------------------------------------
static int
-handle_io(TSCont contp, TSEvent event, void *) // UNUSED void* edata
+handle_io(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
{
cache_scan_state *cstate = (cache_scan_state *) TSContDataGet(contp);
@@ -491,7 +491,7 @@ cache_print_plugin(TSCont contp, TSEvent event, void *edata)
//----------------------------------------------------------------------------
void
-TSPluginInit(int, const char *[]) // UNUSED int argc, const char *argv[]
+TSPluginInit(int /* argc ATS_UNUSED */, const char */* argv ATS_UNUSED */[])
{
global_contp = TSContCreate(cache_print_plugin, TSMutexCreate());
TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, global_contp);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/example/replace-header/replace-header.c
----------------------------------------------------------------------
diff --git a/example/replace-header/replace-header.c b/example/replace-header/replace-header.c
index 8b1d182..0b7c7df 100644
--- a/example/replace-header/replace-header.c
+++ b/example/replace-header/replace-header.c
@@ -40,7 +40,7 @@
#include "ink_defs.h"
static void
-replace_header(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
+replace_header(TSHttpTxn txnp)
{
TSMBuffer resp_bufp;
TSMLoc resp_loc;
@@ -79,13 +79,13 @@ done:
}
static int
-replace_header_plugin(TSCont contp, TSEvent event, void *edata)
+replace_header_plugin(TSCont contp ATS_UNUSED, TSEvent event, void *edata)
{
TSHttpTxn txnp = (TSHttpTxn) edata;
switch (event) {
case TS_EVENT_HTTP_READ_RESPONSE_HDR:
- replace_header(txnp, contp);
+ replace_header(txnp);
return 0;
default:
break;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/example/response-header-1/response-header-1.c
----------------------------------------------------------------------
diff --git a/example/response-header-1/response-header-1.c b/example/response-header-1/response-header-1.c
index 3444049..73aff35 100644
--- a/example/response-header-1/response-header-1.c
+++ b/example/response-header-1/response-header-1.c
@@ -68,7 +68,7 @@ static TSMLoc field_loc;
static TSMLoc value_loc;
static void
-modify_header(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
+modify_header(TSHttpTxn txnp)
{
TSMBuffer resp_bufp;
TSMBuffer cached_bufp;
@@ -215,15 +215,14 @@ modify_header(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
static int
-modify_response_header_plugin(TSCont contp, TSEvent event, void *edata)
+modify_response_header_plugin(TSCont contp ATS_UNUSED, TSEvent event, void *edata)
{
-
TSHttpTxn txnp = (TSHttpTxn) edata;
switch (event) {
case TS_EVENT_HTTP_READ_RESPONSE_HDR:
TSDebug("resphdr", "Called back with TS_EVENT_HTTP_READ_RESPONSE_HDR");
- modify_header(txnp, contp);
+ modify_header(txnp);
TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
/* fall through */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/example/server-transform/server-transform.c
----------------------------------------------------------------------
diff --git a/example/server-transform/server-transform.c b/example/server-transform/server-transform.c
index 5f130d4..930d3b8 100644
--- a/example/server-transform/server-transform.c
+++ b/example/server-transform/server-transform.c
@@ -86,23 +86,9 @@ typedef struct
int content_length;
} TransformData;
-static TSCont transform_create(TSHttpTxn txnp);
-static void transform_destroy(TSCont contp);
-static int transform_connect(TSCont contp, TransformData * data);
-static int transform_write(TSCont contp, TransformData * data);
-static int transform_read_status(TSCont contp, TransformData * data);
-static int transform_read(TSCont contp, TransformData * data);
-static int transform_bypass(TSCont contp, TransformData * data);
-static int transform_buffer_event(TSCont contp, TransformData * data, TSEvent event, void *edata);
-static int transform_connect_event(TSCont contp, TransformData * data, TSEvent event, void *edata);
-static int transform_write_event(TSCont contp, TransformData * data, TSEvent event, void *edata);
-static int transform_read_status_event(TSCont contp, TransformData * data, TSEvent event, void *edata);
-static int transform_read_event(TSCont contp, TransformData * data, TSEvent event, void *edata);
-static int transform_bypass_event(TSCont contp, TransformData * data, TSEvent event, void *edata);
static int transform_handler(TSCont contp, TSEvent event, void *edata);
static in_addr_t server_ip;
-
static int server_port;
static TSCont
@@ -301,8 +287,7 @@ transform_bypass(TSCont contp, TransformData * data)
}
static int
-transform_buffer_event(TSCont contp, TransformData * data, TSEvent event ATS_UNUSED,
- void *edata ATS_UNUSED)
+transform_buffer_event(TSCont contp, TransformData * data, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
{
TSVIO write_vio;
int towrite;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/cache/CacheWrite.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc
index c725430..15e4183 100644
--- a/iocore/cache/CacheWrite.cc
+++ b/iocore/cache/CacheWrite.cc
@@ -831,7 +831,7 @@ agg_copy(char *p, CacheVC *vc)
// move data
if (vc->write_len) {
{
- ProxyMutex ATS_UNUSED *mutex = vc->vol->mutex;
+ ProxyMutex *mutex ATS_UNUSED = vc->vol->mutex;
ink_debug_assert(mutex->thread_holding == this_ethread());
CACHE_DEBUG_SUM_DYN_STAT(cache_write_bytes_stat, vc->write_len);
}
@@ -870,7 +870,7 @@ agg_copy(char *p, CacheVC *vc)
// for evacuated documents, copy the data, and update directory
Doc *doc = (Doc *) vc->buf->data();
int l = vc->vol->round_to_approx_size(doc->len);
- ProxyMutex ATS_UNUSED *mutex = vc->vol->mutex;
+ ProxyMutex *mutex ATS_UNUSED = vc->vol->mutex;
ink_debug_assert(mutex->thread_holding == this_ethread());
CACHE_DEBUG_INCREMENT_DYN_STAT(cache_gc_frags_evacuated_stat);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/cluster/ClusterProcessor.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterProcessor.cc b/iocore/cluster/ClusterProcessor.cc
index cda58a7..30e7505 100644
--- a/iocore/cluster/ClusterProcessor.cc
+++ b/iocore/cluster/ClusterProcessor.cc
@@ -224,9 +224,8 @@ ClusterProcessor::free_remote_data(char *p, int l)
ccl->freeall();
}
-// UNUSED ClusterMachine *m
ClusterVConnection *
-ClusterProcessor::open_local(Continuation * cont, ClusterMachine *, ClusterVCToken & token, int options)
+ClusterProcessor::open_local(Continuation * cont, ClusterMachine */* m ATS_UNUSED */, ClusterVCToken & token, int options)
{
//
// New connect protocol.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/cluster/ClusterVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterVConnection.cc b/iocore/cluster/ClusterVConnection.cc
index 58f212b..74d387e 100644
--- a/iocore/cluster/ClusterVConnection.cc
+++ b/iocore/cluster/ClusterVConnection.cc
@@ -450,7 +450,7 @@ ClusterVConnection::set_type(int options)
}
// Overide functions in base class VConnection.
-bool ClusterVConnection::get_data(int id, void *) // UNUSED void* data
+bool ClusterVConnection::get_data(int id, void * /* data ATS_UNUSED */)
{
switch (id) {
case CACHE_DATA_HTTP_INFO:
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/net/Connection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/Connection.cc b/iocore/net/Connection.cc
index 180d648..15ad2af 100644
--- a/iocore/net/Connection.cc
+++ b/iocore/net/Connection.cc
@@ -135,7 +135,7 @@ Connection::close()
}
static int
-add_http_filter(int) { // UNUSED_PARAMETER fd
+add_http_filter(int /* fd ATS_UNUSED */) {
int err = -1;
#if defined(SOL_FILTER) && defined(FIL_ATTACH)
err = setsockopt(fd, SOL_FILTER, FIL_ATTACH, "httpfilt", 9);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/net/I_NetProcessor.h
----------------------------------------------------------------------
diff --git a/iocore/net/I_NetProcessor.h b/iocore/net/I_NetProcessor.h
index 8498783..25b12f7 100644
--- a/iocore/net/I_NetProcessor.h
+++ b/iocore/net/I_NetProcessor.h
@@ -183,9 +183,10 @@ public:
port becomes free immediately.
*/
- // UNUSED:
- virtual Action *main_accept(Continuation * cont, SOCKET listen_socket_in, sockaddr *,
- int *, bool = false, bool localhost_only = false,
+ virtual Action *main_accept(Continuation * cont, SOCKET listen_socket_in,
+ sockaddr * /* bound_sockaddr ATS_UNUSED = NULL */,
+ int */*bound_sockaddr_size ATS_UNUSED = NULL */,
+ bool /* accept_only ATS_UNUSED = false */, bool localhost_only = false,
AcceptOptions const& opt = DEFAULT_ACCEPT_OPTIONS)
{
AcceptOptions new_opt = opt;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/net/SSLCertLookup.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLCertLookup.cc b/iocore/net/SSLCertLookup.cc
index b859859..5715cdf 100644
--- a/iocore/net/SSLCertLookup.cc
+++ b/iocore/net/SSLCertLookup.cc
@@ -286,7 +286,7 @@ SSLContextStorage::lookup(const char * name) const
#if TS_HAS_TESTS
-REGRESSION_TEST(SSLWildcardMatch)(RegressionTest * t, int, int * pstatus) // UNUSED atype int
+REGRESSION_TEST(SSLWildcardMatch)(RegressionTest * t, int /* atype ATS_UNUSED */, int * pstatus)
{
TestBox box(t, pstatus);
ats_wildcard_matcher wildcard;
@@ -300,7 +300,7 @@ REGRESSION_TEST(SSLWildcardMatch)(RegressionTest * t, int, int * pstatus) // UNU
box.check(wildcard.match("") == false, "'' is not a wildcard");
}
-REGRESSION_TEST(SSLReverseHostname)(RegressionTest * t, int, int * pstatus) // UNUSED atype int
+REGRESSION_TEST(SSLReverseHostname)(RegressionTest * t, int /* atype ATS_UNUSED */, int * pstatus)
{
TestBox box(t, pstatus);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/net/SSLNetVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index edfce68..26fc96b 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -633,9 +633,9 @@ SSLNetVConnection::registerNextProtocolSet(const SSLNextProtocolSet * s)
this->npnSet = s;
}
-// UNUSED void* arg
int
-SSLNetVConnection::advertise_next_protocol(SSL *ssl, const unsigned char **out, unsigned int *outlen, void *)
+SSLNetVConnection::advertise_next_protocol(SSL *ssl, const unsigned char **out, unsigned int *outlen,
+ void * /*arg ATS_UNUSED */)
{
SSLNetVConnection * netvc = (SSLNetVConnection *)SSL_get_app_data(ssl);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/net/UnixNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index 32f4e61..9e4933c 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -164,10 +164,10 @@ static void
net_signal_hook_callback(EThread *thread) {
#if TS_HAS_EVENTFD
uint64_t counter;
- NOWARN_UNUSED_RETURN(read(thread->evfd, &counter, sizeof(uint64_t)));
+ ATS_UNUSED_RETURN(read(thread->evfd, &counter, sizeof(uint64_t)));
#else
char dummy[1024];
- NOWARN_UNUSED_RETURN(read(thread->evpipe[0], &dummy[0], 1024));
+ ATS_UNUSED_RETURN(read(thread->evpipe[0], &dummy[0], 1024));
#endif
}
@@ -175,10 +175,10 @@ static void
net_signal_hook_function(EThread *thread) {
#if TS_HAS_EVENTFD
uint64_t counter = 1;
- NOWARN_UNUSED_RETURN(write(thread->evfd, &counter, sizeof(uint64_t)));
+ ATS_UNUSED_RETURN(write(thread->evfd, &counter, sizeof(uint64_t)));
#else
char dummy = 1;
- NOWARN_UNUSED_RETURN(write(thread->evpipe[1], &dummy, 1));
+ ATS_UNUSED_RETURN(write(thread->evpipe[1], &dummy, 1));
#endif
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/net/UnixUDPNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixUDPNet.cc b/iocore/net/UnixUDPNet.cc
index 4e5fe88..7ec85d0 100644
--- a/iocore/net/UnixUDPNet.cc
+++ b/iocore/net/UnixUDPNet.cc
@@ -741,7 +741,7 @@ sendPackets:
}
void
-UDPQueue::SendUDPPacket(UDPPacketInternal *p, int32_t) // UNUSED int32_t pktLen
+UDPQueue::SendUDPPacket(UDPPacketInternal *p, int32_t /* pktLen ATS_UNUSED */)
{
IOBufferBlock *b;
struct msghdr msg;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/cpp11api/cpp11api.cc
----------------------------------------------------------------------
diff --git a/lib/cpp11api/cpp11api.cc b/lib/cpp11api/cpp11api.cc
index 34b6882..e29fea2 100644
--- a/lib/cpp11api/cpp11api.cc
+++ b/lib/cpp11api/cpp11api.cc
@@ -404,7 +404,7 @@ void ats::api::SetRequestUrlPath(Transaction &t, const std::string &path) {
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
}
-static int GlobalContinuationHandler(TSCont contp, TSEvent, void *edata) { // UNUSED TSEvent event
+static int GlobalContinuationHandler(TSCont contp, TSEvent /* event ATS_UNUSED */, void *edata) {
TSHttpTxn txnp = static_cast<TSHttpTxn>(edata);
Transaction transaction;
@@ -853,14 +853,12 @@ ats::api::headers::HeaderVector ats::api::headers::GetServerResponseHeaders(Tran
return hv;
}
-// UNUSED Transaction &t
-inline ats::api::headers::Header GetHeader(Transaction &, const std::string& hdr_name,
+inline ats::api::headers::Header GetHeader(Transaction & /* t ATS_UNUSED */, const std::string& hdr_name,
const ats::api::headers::HeaderVector &hdrs) {
ats::api::headers::Header hdr;
-
ats::api::headers::HeaderVector::const_iterator ii = std::find_if(hdrs.begin(), hdrs.end(),
- ats::api::headers::HeaderName(hdr_name));
+ ats::api::headers::HeaderName(hdr_name));
if (ii != hdrs.end()) {
hdr = *ii;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/ts/IpMapTest.cc
----------------------------------------------------------------------
diff --git a/lib/ts/IpMapTest.cc b/lib/ts/IpMapTest.cc
index 329bfd9..ead0d48 100644
--- a/lib/ts/IpMapTest.cc
+++ b/lib/ts/IpMapTest.cc
@@ -38,7 +38,7 @@ IpMapTestPrint(IpMap& map) {
printf("\n");
}
-REGRESSION_TEST(IpMap_Basic)(RegressionTest* t, int, int* pstatus) { // UNUSED int atype
+REGRESSION_TEST(IpMap_Basic)(RegressionTest* t, int /* atype ATS_UNUSED */, int* pstatus) {
TestBox tb(t, pstatus);
IpMap map;
@@ -105,7 +105,7 @@ REGRESSION_TEST(IpMap_Basic)(RegressionTest* t, int, int* pstatus) { // UNUSED i
tb.check(map.getCount() == 1, "IpMap: Full range fill left extra ranges.");
}
-REGRESSION_TEST(IpMap_Unmark)(RegressionTest* t, int, int* pstatus) { // UNUSED int atype
+REGRESSION_TEST(IpMap_Unmark)(RegressionTest* t, int /* atype ATS_UNUSED */, int* pstatus) {
TestBox tb(t, pstatus);
IpMap map;
// ip_text_buffer ipb1, ipb2;
@@ -153,7 +153,7 @@ REGRESSION_TEST(IpMap_Unmark)(RegressionTest* t, int, int* pstatus) { // UNUSED
tb.check(map.contains(&a_0_0_0_17), "IpMap Unmark: Range unmark zero bounded range max+1 removed.");
}
-REGRESSION_TEST(IpMap_Fill)(RegressionTest* t, int, int* pstatus) { // UNUSED int atype
+REGRESSION_TEST(IpMap_Fill)(RegressionTest* t, int /* atype ATS_UNUSED */, int* pstatus) {
TestBox tb(t, pstatus);
IpMap map;
ip_text_buffer ipb1, ipb2;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/ts/ink_defs.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_defs.h b/lib/ts/ink_defs.h
index 357310f..a4dd48c 100644
--- a/lib/ts/ink_defs.h
+++ b/lib/ts/ink_defs.h
@@ -43,12 +43,11 @@
#endif
#define ATS_UNUSED __attribute__ ((unused))
-#define NOWARN_UNUSED_RETURN(x) if (x) {}
+#define ATS_WARN_IF_UNUSED __attribute__ ((warn_unused_result))
#define ATS_UNUSED_RETURN(x) if (x) {}
#define NOWARN_UNUSED(x) (void)(x)
-#define ATS_WARN_IF_UNUSED __attribute__ ((warn_unused_result))
#ifndef likely
#define likely(x) __builtin_expect (!!(x), 1)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/ts/ink_memory.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_memory.cc b/lib/ts/ink_memory.cc
index ea0096d..90450c6 100644
--- a/lib/ts/ink_memory.cc
+++ b/lib/ts/ink_memory.cc
@@ -48,7 +48,7 @@ ats_malloc(size_t size)
// ink_stack_trace_dump();
if (likely(size > 0)) {
if (unlikely((ptr = malloc(size)) == NULL)) {
- xdump();
+ ink_stack_trace_dump();
ink_fatal(1, "ats_malloc: couldn't allocate %zu bytes", size);
}
}
@@ -60,7 +60,7 @@ ats_calloc(size_t nelem, size_t elsize)
{
void *ptr = calloc(nelem, elsize);
if (unlikely(ptr == NULL)) {
- xdump();
+ ink_stack_trace_dump();
ink_fatal(1, "ats_calloc: couldn't allocate %zu %zu byte elements", nelem, elsize);
}
return ptr;
@@ -71,7 +71,7 @@ ats_realloc(void *ptr, size_t size)
{
void *newptr = realloc(ptr, size);
if (unlikely(newptr == NULL)) {
- xdump();
+ ink_stack_trace_dump();
ink_fatal(1, "ats_realloc: couldn't reallocate %zu bytes", size);
}
return newptr;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/ts/ink_queue_ext.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_queue_ext.cc b/lib/ts/ink_queue_ext.cc
index f607a21..a89bdd9 100644
--- a/lib/ts/ink_queue_ext.cc
+++ b/lib/ts/ink_queue_ext.cc
@@ -192,8 +192,8 @@ mmap_align(size_t size, size_t alignment) {
MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0);
if (result == MAP_FAILED) {
- xdump();
- ink_fatal(1, "Failed to mmap %zu bytes, %s", size, strerror(errno));
+ ink_stack_trace_dump();
+ ink_fatal(1, "Failed to mmap %zu bytes, %s", size, strerror(errno));
}
/* adjust the return memory so it is aligned */
@@ -280,9 +280,8 @@ ink_chunk_delete(InkFreeList *f, InkThreadCache *pCache, InkChunkInfo *pChunk)
pCache->nr_free_chunks--;
if (unlikely(munmap(chunk_addr, f->chunk_byte_size))) {
- xdump();
- ink_fatal(1, "Failed to munmap %u bytes, %s", f->chunk_byte_size,
- strerror(errno));
+ ink_stack_trace_dump()();
+ ink_fatal(1, "Failed to munmap %u bytes, %s", f->chunk_byte_size, strerror(errno));
}
ink_atomic_increment((int *)&f->count, -f->chunk_size);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/ts/ink_resource.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_resource.cc b/lib/ts/ink_resource.cc
index 5c183d2..52d6588 100644
--- a/lib/ts/ink_resource.cc
+++ b/lib/ts/ink_resource.cc
@@ -58,9 +58,3 @@ res_lookup(const char *path)
NOWARN_UNUSED(path);
return NULL;
}
-
-void
-xdump(void)
-{
- ink_stack_trace_dump();
-}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/ts/ink_resource.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_resource.h b/lib/ts/ink_resource.h
index a7a6217..ace22e7 100644
--- a/lib/ts/ink_resource.h
+++ b/lib/ts/ink_resource.h
@@ -54,7 +54,6 @@ struct Resource
#define RES_TRACK_MEMORY_DEFAULT 0 /* default value for res_track_memory variable */
char *_xstrdup(const char *str, int length, const char *path);
-void xdump(void);
#if defined(__cplusplus)
/** Locally scoped holder for a chunk of memory allocated via these functions.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/ts/ink_stack_trace.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_stack_trace.cc b/lib/ts/ink_stack_trace.cc
index eacaf3b..3e194dd 100644
--- a/lib/ts/ink_stack_trace.cc
+++ b/lib/ts/ink_stack_trace.cc
@@ -35,7 +35,7 @@
#include <signal.h>
void
-ink_stack_trace_dump(int) // UNUSED int sighandler_frame
+ink_stack_trace_dump()
{
int btl;
@@ -59,7 +59,7 @@ ink_stack_trace_dump(int) // UNUSED int sighandler_frame
#else /* !TS_HAS_BACKTRACE */
void
-ink_stack_trace_dump(int sighandler_frame)
+ink_stack_trace_dump()
{
const char msg[] = "ink_stack_trace_dump not implemented on this operating system\n";
if (write(2, msg, sizeof(msg) - 1) == -1)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/ts/ink_stack_trace.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_stack_trace.h b/lib/ts/ink_stack_trace.h
index 2b32228..7490cb8 100644
--- a/lib/ts/ink_stack_trace.h
+++ b/lib/ts/ink_stack_trace.h
@@ -32,7 +32,7 @@ extern "C"
{
#endif
/* dumps the current back trace to stderr */
- void ink_stack_trace_dump(int sighandler_frame = 0);
+ void ink_stack_trace_dump();
#ifdef __cplusplus
}
#endif
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/ts/lockfile.cc
----------------------------------------------------------------------
diff --git a/lib/ts/lockfile.cc b/lib/ts/lockfile.cc
index 5105cf8..f6e9587 100644
--- a/lib/ts/lockfile.cc
+++ b/lib/ts/lockfile.cc
@@ -194,9 +194,8 @@ Lockfile::Close(void)
// of the process just don't want to go away.
//-------------------------------------------------------------------------
-// UNUSED const char *pname
static void
-lockfile_kill_internal(pid_t init_pid, int init_sig, pid_t pid, const char *, int sig)
+lockfile_kill_internal(pid_t init_pid, int init_sig, pid_t pid, const char * /* pname ATS_UNUSED */, int sig)
{
int err;
int status;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/tsconfig/TsErrataUtil.cc
----------------------------------------------------------------------
diff --git a/lib/tsconfig/TsErrataUtil.cc b/lib/tsconfig/TsErrataUtil.cc
index a234dcf..8b0602d 100644
--- a/lib/tsconfig/TsErrataUtil.cc
+++ b/lib/tsconfig/TsErrataUtil.cc
@@ -126,7 +126,7 @@ Errata
log_errno(Errata::Code code, char const* text) {
static size_t const SIZE = 1024;
char buffer[SIZE];
- NOWARN_UNUSED_RETURN(strerror_r(errno, buffer, SIZE));
+ ATS_UNUSED_RETURN(strerror_r(errno, buffer, SIZE));
return logf(code, "%s [%d] %s", text, errno, buffer);
}
@@ -141,7 +141,7 @@ vlogf_errno(Errata& errata, Errata::Id id, Errata::Code code, char const* format
n = vsnprintf(t_buffer, T_SIZE, format, rest);
if (0 <= n && n < T_SIZE) { // still have room.
- NOWARN_UNUSED_RETURN(strerror_r(e, e_buffer, E_SIZE));
+ ATS_UNUSED_RETURN(strerror_r(e, e_buffer, E_SIZE));
n += snprintf(t_buffer + n, T_SIZE - n, "[%d] %s", e, e_buffer);
}
errata.push(id, code, t_buffer);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/lib/wccp/WccpStatic.cc
----------------------------------------------------------------------
diff --git a/lib/wccp/WccpStatic.cc b/lib/wccp/WccpStatic.cc
index 87bf4a3..6c32cca 100644
--- a/lib/wccp/WccpStatic.cc
+++ b/lib/wccp/WccpStatic.cc
@@ -155,7 +155,7 @@ ts::Errata
log_errno(ts::Errata::Code code, char const* text) {
static size_t const SIZE = 1024;
char buffer[SIZE];
- NOWARN_UNUSED_RETURN(strerror_r(errno, buffer, SIZE));
+ ATS_UNUSED_RETURN(strerror_r(errno, buffer, SIZE));
return logf(code, "%s [%d] %s", text, errno, buffer);
}
@@ -171,7 +171,7 @@ vlogf_errno(ts::Errata::Code code, char const* format, va_list& rest) {
n = vsnprintf(t_buffer, T_SIZE, format, rest);
if (0 <= n && n < T_SIZE) { // still have room.
- NOWARN_UNUSED_RETURN(strerror_r(e, e_buffer, E_SIZE));
+ ATS_UNUSED_RETURN(strerror_r(e, e_buffer, E_SIZE));
n += snprintf(t_buffer + n, T_SIZE - n, "[%d] %s", e, e_buffer);
}
err.push(ts::Errata::Id(0), code, t_buffer);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/mgmt/Main.cc
----------------------------------------------------------------------
diff --git a/mgmt/Main.cc b/mgmt/Main.cc
index da80cad..895ea06 100644
--- a/mgmt/Main.cc
+++ b/mgmt/Main.cc
@@ -771,7 +771,7 @@ main(int argc, char **argv)
}
// Check for SIGUSR2
if (sigUsr2Notifier != 0) {
- xdump();
+ ink_stack_trace_dump();
sigUsr2Notifier = 0;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/mgmt/ProxyConfig.h
----------------------------------------------------------------------
diff --git a/mgmt/ProxyConfig.h b/mgmt/ProxyConfig.h
index 98bddb6..8fd6aa9 100644
--- a/mgmt/ProxyConfig.h
+++ b/mgmt/ProxyConfig.h
@@ -129,10 +129,10 @@ struct ConfigUpdateHandler
}
private:
-
- // UNUSED RecDataT data_type, RecData data
- static int update(const char * name, RecDataT, RecData, void * cookie) {
+ static int update(const char * name, RecDataT /* data_type ATS_UNUSED */, RecData /* data ATS_UNUSED */,
+ void * cookie) {
ConfigUpdateHandler * self = static_cast<ConfigUpdateHandler *>(cookie);
+
Debug("config", "%s(%s)", __PRETTY_FUNCTION__, name);
return ConfigScheduleUpdate<UpdateClass>(self->mutex);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/mgmt/api/INKMgmtAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/INKMgmtAPI.cc b/mgmt/api/INKMgmtAPI.cc
index 2cd0323..69d2454 100644
--- a/mgmt/api/INKMgmtAPI.cc
+++ b/mgmt/api/INKMgmtAPI.cc
@@ -50,19 +50,19 @@ void init_pdss_format(TSPdSsFormat * info);
* API Memory Management
***************************************************************************/
void *
-_TSmalloc(unsigned int size, const char *) // UNUSED const char *path
+_TSmalloc(unsigned int size, const char * /* path ATS_UNUSED */ )
{
return ats_malloc(size);
}
void *
-_TSrealloc(void *ptr, unsigned int size, const char *) // UNUSED const char *path
+_TSrealloc(void *ptr, unsigned int size, const char * /* path ATS_UNUSED */)
{
return ats_realloc(ptr, size);
}
char *
-_TSstrdup(const char *str, int length, const char *) // UNUSED const char *path
+_TSstrdup(const char *str, int length, const char * /* path ATS_UNUSED */)
{
return ats_strndup(str, length);
}
@@ -2446,7 +2446,7 @@ closeAllFds()
FILE *fd = popen(command, "r");
if (fd) {
while (!feof(fd)) {
- NOWARN_UNUSED_RETURN(fgets(buffer, BUFFLEN, fd));
+ ATS_UNUSED_RETURN(fgets(buffer, BUFFLEN, fd));
num = atoi(buffer);
if (num != fileno(fd) && num != 0 && num != 1 && num != 2) { // for out put
//printf("closing fd (%d)\n", num); fflush(stdout);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/mgmt/api/remote/APITestCliRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/remote/APITestCliRemote.cc b/mgmt/api/remote/APITestCliRemote.cc
index 32e5b5a..a1b438a 100644
--- a/mgmt/api/remote/APITestCliRemote.cc
+++ b/mgmt/api/remote/APITestCliRemote.cc
@@ -2347,7 +2347,7 @@ runInteractive()
printf("api_cli-> ");
// get input from command line
- NOWARN_UNUSED_RETURN(fgets(buf, 512, stdin));
+ ATS_UNUSED_RETURN(fgets(buf, 512, stdin));
// check status of 'stdin' after reading
if (feof(stdin) != 0) {
@@ -2453,7 +2453,7 @@ runInteractive()
* clean up on exit, and gets the interactive command-line running
*/
int
-main(int, char **) // UNUSED int argc, char ** argv
+main(int /* argc ATS_UNUSED */, char ** /* argv ATS_UNUSED */)
{
TSError ret;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/mgmt/cli/ConfigCmd.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/ConfigCmd.cc b/mgmt/cli/ConfigCmd.cc
index 75ba2e9..2315275 100644
--- a/mgmt/cli/ConfigCmd.cc
+++ b/mgmt/cli/ConfigCmd.cc
@@ -2789,7 +2789,7 @@ ConfigTimezone(int index, int setvar)
printf("can not open the file\n");
return CLI_ERROR;
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
while (!feof(fp)) {
if (buffer[0] != '#') {
strtok(buffer, " \t");
@@ -2800,15 +2800,15 @@ ConfigTimezone(int index, int setvar)
}
fprintf(tmp, "%s\n", zone);
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
}
fclose(fp);
fclose(tmp);
remove("/tmp/zonetab");
- NOWARN_UNUSED_RETURN(system("/bin/sort /tmp/zonetab.tmp > /tmp/zonetab"));
+ ATS_UNUSED_RETURN(system("/bin/sort /tmp/zonetab.tmp > /tmp/zonetab"));
fp = fopen("/tmp/zonetab", "r");
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
int i = 0;
while (!feof(fp)) {
zone = buffer;
@@ -2820,7 +2820,7 @@ ConfigTimezone(int index, int setvar)
ink_strlcpy(new_zone, zone, sizeof(new_zone));
}
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
i++;
}
fclose(fp);
@@ -2857,7 +2857,7 @@ ConfigTimezone(int index, int setvar)
fp = fopen("/etc/sysconfig/clock", "r");
tmp = fopen("/tmp/clock.tmp", "w");
- NOWARN_UNUSED_RETURN(fgets(buffer, 256, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 256, fp));
while (!feof(fp)) {
if (strstr(buffer, "ZONE") != NULL) {
fprintf(tmp, "ZONE=\"%s\"\n", new_zone);
@@ -2866,7 +2866,7 @@ ConfigTimezone(int index, int setvar)
} else {
fputs(buffer, tmp);
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 256, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 256, fp));
}
fclose(fp);
fclose(tmp);
@@ -2901,7 +2901,7 @@ ConfigTimezoneList()
printf("can not open the file\n");
return CLI_ERROR;
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
while (!feof(fp)) {
if (buffer[0] != '#') {
strtok(buffer, " \t");
@@ -2912,7 +2912,7 @@ ConfigTimezoneList()
}
fprintf(tmp, "%s\n", zone);
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
}
fclose(fp);
fclose(tmp);
@@ -2923,7 +2923,7 @@ ConfigTimezoneList()
}
fp = fopen("/tmp/zonetab", "r");
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
int i = 0;
while (!feof(fp)) {
zone = buffer;
@@ -2935,7 +2935,7 @@ ConfigTimezoneList()
} else {
Cli_Printf("%d %s\n", i, zone);
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
i++;
}
fclose(fp);
@@ -4920,7 +4920,7 @@ find_value(const char *pathname, const char *key, char *value, int value_len, co
}
// coverity[toctou]
if ((fp = fopen(pathname, "r")) != NULL) {
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
while (!feof(fp)) {
if (strstr(buffer, key) != NULL) {
if (counter != no) {
@@ -4944,7 +4944,7 @@ find_value(const char *pathname, const char *key, char *value, int value_len, co
break;
}
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 80, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 80, fp));
}
fclose(fp);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/mgmt/tools/ConfigAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/tools/ConfigAPI.cc b/mgmt/tools/ConfigAPI.cc
index db10252..0f4d801 100644
--- a/mgmt/tools/ConfigAPI.cc
+++ b/mgmt/tools/ConfigAPI.cc
@@ -1208,7 +1208,7 @@ Config_FloppyNetRestore()
}
i = 0;
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, tmp_floppy_config));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, tmp_floppy_config));
fclose(tmp_floppy_config);
while (!isspace(buffer[i])) {
mount_dir[i] = buffer[i];
@@ -1220,11 +1220,11 @@ Config_FloppyNetRestore()
// Unmount floppy and then use /tmp/net_config.xml to restore the
// settings. This is required as a restart of traffic_manager
// might hinder unmount of floppy
- NOWARN_UNUSED_RETURN(system("rm -f /tmp/net_config.xml"));
+ ATS_UNUSED_RETURN(system("rm -f /tmp/net_config.xml"));
char xml_temp_dir[256];
snprintf(xml_temp_dir, sizeof(xml_temp_dir), "/bin/cp -f %s/net_config.xml /tmp/net_config.xml", mount_dir);
- NOWARN_UNUSED_RETURN(system(xml_temp_dir));
+ ATS_UNUSED_RETURN(system(xml_temp_dir));
uMountFloppy(net_floppy_config); //umount the floppy
//sprintf(floppy_config_file, "%s/net_config.xml", mount_dir);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/mgmt/tools/SysAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/tools/SysAPI.cc b/mgmt/tools/SysAPI.cc
index 37f80b6..bc57b37 100644
--- a/mgmt/tools/SysAPI.cc
+++ b/mgmt/tools/SysAPI.cc
@@ -583,7 +583,7 @@ find_value(const char *pathname, const char *key, char *value, size_t value_len,
}
// coverity[toctou]
if ((fp = fopen(pathname, "r")) != NULL) {
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
while (!feof(fp)) {
if (!isLineCommented(buffer) && // skip if line is commented
@@ -629,7 +629,7 @@ find_value(const char *pathname, const char *key, char *value, size_t value_len,
break;
}
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
}
fclose(fp);
}
@@ -824,7 +824,7 @@ Net_GetDefaultRouter(char *router, size_t router_len)
char *gw_start;
bool find_UG = false;
- NOWARN_UNUSED_RETURN(fgets(buffer, 256, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 256, fp));
while (!feof(fp)) {
if (strstr(buffer, "UG") != NULL) {
find_UG = true;
@@ -832,7 +832,7 @@ Net_GetDefaultRouter(char *router, size_t router_len)
gw_start = strtok(NULL, " \t");
break;
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 256, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 256, fp));
}
if (find_UG) {
ink_strlcpy(router, gw_start, router_len);
@@ -1019,7 +1019,7 @@ Net_GetNIC_IP(char *interface, char *ip, size_t ip_len)
}
char *pos, *addr_end, *addr_start = NULL;
- NOWARN_UNUSED_RETURN(fgets(buffer, 256, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 256, fp));
while (!feof(fp)) {
if (strstr(buffer, "inet addr:") != NULL) {
pos = strchr(buffer, ':');
@@ -1028,7 +1028,7 @@ Net_GetNIC_IP(char *interface, char *ip, size_t ip_len)
*addr_end = '\0';
break;
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 256, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 256, fp));
}
if (addr_start)
@@ -1077,7 +1077,7 @@ Net_GetNIC_Netmask(char *interface, char *netmask, size_t netmask_len)
}
char *pos, *mask_end, *mask_start = NULL;
- NOWARN_UNUSED_RETURN(fgets(buffer, 256, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 256, fp));
while (!feof(fp)) {
if (strstr(buffer, "Mask:") != NULL) {
pos = strstr(buffer, "Mask:");
@@ -1086,7 +1086,7 @@ Net_GetNIC_Netmask(char *interface, char *netmask, size_t netmask_len)
*mask_end = '\0';
break;
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 256, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 256, fp));
}
if (mask_start)
@@ -1217,7 +1217,7 @@ Time_SortTimezone()
DPRINTF(("[Time_SortTimezone] Can not open the file\n"));
return -1;
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
while (!feof(fp)) {
if (buffer[0] != '#') {
strtok(buffer, " \t");
@@ -1228,12 +1228,12 @@ Time_SortTimezone()
}
fprintf(tmp, "%s\n", zone);
}
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
}
fclose(fp);
fclose(tmp);
remove("/tmp/zonetab");
- NOWARN_UNUSED_RETURN(system("/bin/sort /tmp/zonetab.tmp > /tmp/zonetab"));
+ ATS_UNUSED_RETURN(system("/bin/sort /tmp/zonetab.tmp > /tmp/zonetab"));
remove("/tmp/zonetab.tmp");
return 0;
@@ -1284,7 +1284,7 @@ Time_GetNTP_Status(char *status, size_t status_len)
status[0] = 0;
fp = popen("/etc/init.d/ntpd status", "r");
- NOWARN_UNUSED_RETURN(fgets(buffer, 1024, fp));
+ ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
if (strstr(buffer, "running") != NULL) {
ink_strlcpy(status, "on", status_len);
} else {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/conf_remap/conf_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/conf_remap/conf_remap.cc b/plugins/conf_remap/conf_remap.cc
index c2ec072..9055dbf 100644
--- a/plugins/conf_remap/conf_remap.cc
+++ b/plugins/conf_remap/conf_remap.cc
@@ -197,7 +197,7 @@ TSRemapInit(TSRemapInterface* api_info, char *errbuf, int errbuf_size)
TSReturnCode
-TSRemapNewInstance(int argc, char* argv[], void** ih, char*, int) // UNUSED char* errbuf, int errbuf_size)
+TSRemapNewInstance(int argc, char* argv[], void** ih, char* /* errbuf ATS_UNUSED */, int /* errbuf_size ATS_UNUSED */)
{
if (argc < 3) {
TSError("Unable to create remap instance, need configuration file");
@@ -234,7 +234,7 @@ TSRemapDeleteInstance(void* ih)
// Main entry point when used as a remap plugin.
//
TSRemapStatus
-TSRemapDoRemap(void* ih, TSHttpTxn rh, TSRemapRequestInfo *) // UNUSED TSRemapRequestInfo *rri
+TSRemapDoRemap(void* ih, TSHttpTxn rh, TSRemapRequestInfo * /* rri ATS_UNUSED */)
{
if (NULL != ih) {
RemapConfigs* conf = static_cast<RemapConfigs*>(ih);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/authproxy/authproxy.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/authproxy/authproxy.cc b/plugins/experimental/authproxy/authproxy.cc
index 391cadc..4254879 100644
--- a/plugins/experimental/authproxy/authproxy.cc
+++ b/plugins/experimental/authproxy/authproxy.cc
@@ -267,7 +267,7 @@ AuthChainAuthorizationResponse(AuthRequestContext * auth)
// Transform the client request into a HEAD request and write it out.
static bool
-AuthWriteHeadRequest(AuthRequestContext * auth, const sockaddr *) // UNUSED const sockaddr * saddr
+AuthWriteHeadRequest(AuthRequestContext * auth, const sockaddr * /* saddr ATS_UNUSED */)
{
HttpHeader rq;
TSMBuffer mbuf;
@@ -451,7 +451,7 @@ StateAuthProxyConnect(AuthRequestContext * auth, void * edata)
}
static TSEvent
-StateAuthProxyCompleteHeaders(AuthRequestContext * auth, void *) // UNUSED void *edata
+StateAuthProxyCompleteHeaders(AuthRequestContext * auth, void * /* edata ATS_UNUSED */)
{
TSHttpStatus status;
unsigned nbytes;
@@ -490,7 +490,7 @@ StateAuthProxyCompleteHeaders(AuthRequestContext * auth, void *) // UNUSED void
}
static TSEvent
-StateAuthProxySendResponse(AuthRequestContext * auth, void *) // UNUSED void *edata
+StateAuthProxySendResponse(AuthRequestContext * auth, void * /* edata ATS_UNUSED */)
{
TSMBuffer mbuf;
TSMLoc mhdr;
@@ -518,7 +518,7 @@ StateAuthProxySendResponse(AuthRequestContext * auth, void *) // UNUSED void *ed
}
static TSEvent
-StateAuthProxyReadHeaders(AuthRequestContext * auth, void *) // UNUSED void *edata
+StateAuthProxyReadHeaders(AuthRequestContext * auth, void * /* edata ATS_UNUSED */)
{
TSIOBufferBlock blk;
ssize_t consumed = 0;
@@ -567,7 +567,7 @@ StateAuthProxyReadHeaders(AuthRequestContext * auth, void *) // UNUSED void *eda
}
static TSEvent
-StateAuthProxyWriteComplete(AuthRequestContext * auth, void *) // UNUSED void *edata
+StateAuthProxyWriteComplete(AuthRequestContext * auth, void * /* edata ATS_UNUSED */)
{
// We finished writing the auth proxy request. Kick off a read to get the response.
auth->iobuf.reset();
@@ -580,7 +580,7 @@ StateAuthProxyWriteComplete(AuthRequestContext * auth, void *) // UNUSED void *e
}
static TSEvent
-StateAuthProxyReadContent(AuthRequestContext * auth, void *) // UNUSED void *edata
+StateAuthProxyReadContent(AuthRequestContext * auth, void * /* edata ATS_UNUSED */)
{
unsigned needed;
int64_t avail = 0;
@@ -600,7 +600,7 @@ StateAuthProxyReadContent(AuthRequestContext * auth, void *) // UNUSED void *eda
}
static TSEvent
-StateAuthProxyCompleteContent(AuthRequestContext * auth, void *) // UNUSED void *edata
+StateAuthProxyCompleteContent(AuthRequestContext * auth, void * /* edata ATS_UNUSED */)
{
unsigned needed;
int64_t avail;
@@ -665,7 +665,7 @@ AuthRequestIsTagged(TSHttpTxn txn)
}
static int
-AuthProxyGlobalHook(TSCont, TSEvent event, void * edata) // UNUSED TSCont cont
+AuthProxyGlobalHook(TSCont /* cont ATS_UNUSED */, TSEvent event, void * edata)
{
AuthRequestContext * auth;
union {
@@ -808,7 +808,7 @@ TSRemapInit(TSRemapInterface * api, char * err, int errsz)
}
TSReturnCode
-TSRemapNewInstance(int argc, char * argv[], void ** instance, char *, int) // UNUSED char * err, int errsz
+TSRemapNewInstance(int argc, char * argv[], void ** instance, char * /* err ATS_UNUSED */, int /* errsz ATS_UNUSED */)
{
AuthOptions * options;
@@ -833,7 +833,7 @@ TSRemapDeleteInstance(void * instance)
}
TSRemapStatus
-TSRemapDoRemap(void * instance, TSHttpTxn txn, TSRemapRequestInfo *) // UNUSED TSRemapRequestInfo * rri
+TSRemapDoRemap(void * instance, TSHttpTxn txn, TSRemapRequestInfo * /* rri ATS_UNUSED */)
{
AuthOptions * options = (AuthOptions *)instance;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/channel_stats/channel_stats.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/channel_stats/channel_stats.cc b/plugins/experimental/channel_stats/channel_stats.cc
index 3696cb2..c10456b 100644
--- a/plugins/experimental/channel_stats/channel_stats.cc
+++ b/plugins/experimental/channel_stats/channel_stats.cc
@@ -275,7 +275,7 @@ get_api_params(TSMBuffer bufp,
}
static void
-handle_read_req(TSCont, TSHttpTxn txnp) // UNUSED TSCont contp
+handle_read_req(TSCont /* contp ATS_UNUSED */, TSHttpTxn txnp)
{
TSMBuffer bufp;
TSMLoc hdr_loc = NULL;
@@ -467,7 +467,7 @@ get_txn_user_speed(TSHttpTxn txnp, uint64_t body_bytes)
}
static void
-handle_txn_close(TSCont, TSHttpTxn txnp) // UNUSED TSCont contp
+handle_txn_close(TSCont /* contp ATS_UNUSED */, TSHttpTxn txnp)
{
TSMBuffer bufp;
TSMLoc hdr_loc;
@@ -623,9 +623,9 @@ stats_process_read(TSCont contp, TSEvent event, intercept_state * api_state)
APPEND(b); \
} while(0)
-// UNUSED: TSRecordType rec_type , int registered,
static void
-json_out_stat(TSRecordType, void *edata, int, const char *name, TSRecordDataType data_type, TSRecordData *datum) {
+json_out_stat(TSRecordType /* rec_type ATS_UNUSED */, void *edata, int /* registered ATS_UNUSED */, const char *name,
+ TSRecordDataType data_type, TSRecordData *datum) {
intercept_state *api_state = (intercept_state *) edata;
switch(data_type) {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/custom_redirect/custom_redirect.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/custom_redirect/custom_redirect.cc b/plugins/experimental/custom_redirect/custom_redirect.cc
index 17694fd..6baf1a6 100644
--- a/plugins/experimental/custom_redirect/custom_redirect.cc
+++ b/plugins/experimental/custom_redirect/custom_redirect.cc
@@ -39,7 +39,7 @@ static int redirect_url_header_len = 0;
static int return_code = TS_HTTP_STATUS_NONE;
static void
-handle_response (TSHttpTxn txnp, TSCont) // UNUSED TSCont contp
+handle_response (TSHttpTxn txnp, TSCont /* contp ATS_UNUSED */)
{
TSMBuffer resp_bufp;
TSMLoc resp_loc;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/esi/combo_handler.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/combo_handler.cc b/plugins/experimental/esi/combo_handler.cc
index 19e17e9..2e5643b 100644
--- a/plugins/experimental/esi/combo_handler.cc
+++ b/plugins/experimental/esi/combo_handler.cc
@@ -220,7 +220,7 @@ TSPluginInit(int argc, const char *argv[])
}
static int
-handleReadRequestHeader(TSCont contp, TSEvent event, void *edata)
+handleReadRequestHeader(TSCont /* contp ATS_UNUSED */, TSEvent event, void *edata)
{
TSAssert(event == TS_EVENT_HTTP_READ_REQUEST_HDR);
@@ -295,7 +295,7 @@ isComboHandlerRequest(TSMBuffer bufp, TSMLoc hdr_loc, TSMLoc url_loc)
}
static bool
-getDefaultBucket(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc hdr_obj, ClientRequest &creq)
+getDefaultBucket(TSHttpTxn /* txnp ATS_UNUSED */, TSMBuffer bufp, TSMLoc hdr_obj, ClientRequest &creq)
{
LOG_DEBUG("In getDefaultBucket");
TSMLoc field_loc;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/esi/esi.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/esi.cc b/plugins/experimental/esi/esi.cc
index d35f455..8611268 100644
--- a/plugins/experimental/esi/esi.cc
+++ b/plugins/experimental/esi/esi.cc
@@ -494,7 +494,7 @@ ContData::~ContData()
}
}
-static int removeCacheHandler(TSCont contp, TSEvent, void *) { // UNUSED: TSEvent event, void *edata
+static int removeCacheHandler(TSCont contp, TSEvent /* event ATS_UNUSED */, void * /* edata ATS_UNUSED */) {
//TSDebug(DEBUG_TAG, "[%s] event: %d", __FUNCTION__, (int)event);
TSContDestroy(contp);
//just ignore cache remove message
@@ -1783,7 +1783,7 @@ TSRemapDeleteInstance(void* ih)
// Main entry point when used as a remap plugin.
//
TSRemapStatus
-TSRemapDoRemap(void* ih, TSHttpTxn txnp, TSRemapRequestInfo *) // UNUSED TSRemapRequestInfo *rri
+TSRemapDoRemap(void* ih, TSHttpTxn txnp, TSRemapRequestInfo * /* rri ATS_UNUSED */)
{
if (NULL != ih) {
TSCont contp = static_cast<TSCont>(ih);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/esi/test/TestHandlerManager.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/test/TestHandlerManager.cc b/plugins/experimental/esi/test/TestHandlerManager.cc
index 6cf4881..9d85471 100644
--- a/plugins/experimental/esi/test/TestHandlerManager.cc
+++ b/plugins/experimental/esi/test/TestHandlerManager.cc
@@ -27,7 +27,7 @@
using namespace EsiLib;
void
-HandlerManager::loadObjects(const Utils::KeyValueMap &) { // UNUSED handlers
+HandlerManager::loadObjects(const Utils::KeyValueMap & /* handlers ATS_UNUSED */) {
}
SpecialIncludeHandler *
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/gzip/gzip.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/gzip/gzip.cc b/plugins/experimental/gzip/gzip.cc
index eee205c..a061b4c 100644
--- a/plugins/experimental/gzip/gzip.cc
+++ b/plugins/experimental/gzip/gzip.cc
@@ -421,7 +421,7 @@ gzip_transform_do(TSCont contp)
static int
-gzip_transform(TSCont contp, TSEvent event, void *) // UNUSED void *edata
+gzip_transform(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
{
if (TSVConnClosedGet(contp)) {
gzip_data_destroy((GzipData*)TSContDataGet(contp));
@@ -571,7 +571,7 @@ gzip_transformable(TSHttpTxn txnp, int server, HostConfiguration * host_configur
static void
-gzip_transform_add(TSHttpTxn txnp, int, HostConfiguration * hc, int compress_type) // UNUSED int server
+gzip_transform_add(TSHttpTxn txnp, int /* server ATS_UNUSED */, HostConfiguration * hc, int compress_type)
{
int *tmp = (int *) TSHttpTxnArgGet(txnp, arg_idx_hooked);
if (tmp) {
@@ -624,7 +624,7 @@ cache_transformable(TSHttpTxn txnp)
}
HostConfiguration *
-find_host_configuration(TSHttpTxn, TSMBuffer bufp, TSMLoc locp) // UNUSED TSHttpTxn txnp
+find_host_configuration(TSHttpTxn /* txnp ATS_UNUSED */, TSMBuffer bufp, TSMLoc locp)
{
TSMLoc fieldp = TSMimeHdrFieldFind(bufp, locp, TS_MIME_FIELD_HOST, TS_MIME_LEN_HOST);
@@ -642,7 +642,7 @@ find_host_configuration(TSHttpTxn, TSMBuffer bufp, TSMLoc locp) // UNUSED TSHttp
static int
-transform_plugin(TSCont, TSEvent event, void *edata) // UNUSED TSCont contp
+transform_plugin(TSCont /* contp ATS_UNUSED */, TSEvent event, void *edata)
{
TSHttpTxn txnp = (TSHttpTxn) edata;
int compress_type = COMPRESSION_TYPE_DEFLATE;
@@ -751,7 +751,7 @@ read_configuration(TSCont contp) {
}
static int
-management_update(TSCont contp, TSEvent event, void *) // UNUSED void *edata
+management_update(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
{
TSReleaseAssert(event == TS_EVENT_MGMT_UPDATE);
info("management update event received");
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/gzip/misc.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/gzip/misc.cc b/plugins/experimental/gzip/misc.cc
index bd0658c..918d41f 100644
--- a/plugins/experimental/gzip/misc.cc
+++ b/plugins/experimental/gzip/misc.cc
@@ -28,19 +28,19 @@
#include "debug_macros.h"
voidpf
-gzip_alloc(voidpf, uInt items, uInt size) // UNUSED voidpf opaque
+gzip_alloc(voidpf /* opaque ATS_UNUSED */, uInt items, uInt size)
{
return (voidpf) TSmalloc(items * size);
}
void
-gzip_free(voidpf, voidpf address) // UNUSED voidpf opaque
+gzip_free(voidpf /* opaque ATS_UNUSED */, voidpf address)
{
TSfree(address);
}
void
-normalize_accept_encoding(TSHttpTxn, TSMBuffer reqp, TSMLoc hdr_loc) // UNUSED TSHttpTxn txnp
+normalize_accept_encoding(TSHttpTxn /* txnp ATS_UNUSED */, TSMBuffer reqp, TSMLoc hdr_loc)
{
TSMLoc field = TSMimeHdrFieldFind(reqp, hdr_loc, TS_MIME_FIELD_ACCEPT_ENCODING, TS_MIME_LEN_ACCEPT_ENCODING);
int deflate = 0;
@@ -93,7 +93,7 @@ normalize_accept_encoding(TSHttpTxn, TSMBuffer reqp, TSMLoc hdr_loc) // UNUSED T
}
void
-hide_accept_encoding(TSHttpTxn, TSMBuffer reqp, TSMLoc hdr_loc, const char * hidden_header_name) //UNUSED TSHttpTxn txnp
+hide_accept_encoding(TSHttpTxn /* txnp ATS_UNUSED */, TSMBuffer reqp, TSMLoc hdr_loc, const char * hidden_header_name)
{
TSMLoc field = TSMimeHdrFieldFind(reqp, hdr_loc, TS_MIME_FIELD_ACCEPT_ENCODING, TS_MIME_LEN_ACCEPT_ENCODING);
while (field) {
@@ -106,7 +106,7 @@ hide_accept_encoding(TSHttpTxn, TSMBuffer reqp, TSMLoc hdr_loc, const char * hid
}
void
-restore_accept_encoding(TSHttpTxn, TSMBuffer reqp, TSMLoc hdr_loc, const char * hidden_header_name) //UNUSED TSHttpTxn txnp
+restore_accept_encoding(TSHttpTxn /* txnp ATS_UNUSED */, TSMBuffer reqp, TSMLoc hdr_loc, const char * hidden_header_name)
{
TSMLoc field = TSMimeHdrFieldFind(reqp, hdr_loc, hidden_header_name, -1);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/header_rewrite/conditions.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/header_rewrite/conditions.cc b/plugins/experimental/header_rewrite/conditions.cc
index be7fae6..84ad1f0 100644
--- a/plugins/experimental/header_rewrite/conditions.cc
+++ b/plugins/experimental/header_rewrite/conditions.cc
@@ -86,14 +86,14 @@ ConditionRandom::initialize(Parser& p)
bool
-ConditionRandom::eval(const Resources&) { // UNUSED Resources &res
+ConditionRandom::eval(const Resources& /* res ATS_UNUSED */) {
TSDebug(PLUGIN_NAME, "Evaluating RANDOM(%d)", _max);
return static_cast<const Matchers<unsigned int>*>(_matcher)->test(rand_r(&_seed) % _max);
}
void
-ConditionRandom::append_value(std::string& s, const Resources&) // UNUSED Resources &res
+ConditionRandom::append_value(std::string& s, const Resources& /* res ATS_UNUSED */)
{
s += boost::lexical_cast<std::string>(rand_r(&_seed) % _max);
TSDebug(PLUGIN_NAME, "Appending RANDOM(%d) to evaluation value -> %s", _max, s.c_str());
@@ -127,7 +127,7 @@ ConditionAccess::append_value(std::string& s, const Resources& res)
bool
-ConditionAccess::eval(const Resources&) // UNUSED Resources &res
+ConditionAccess::eval(const Resources& /* res ATS_UNUSED */)
{
struct timeval tv;
@@ -282,7 +282,7 @@ ConditionQuery::eval(const Resources& res)
// ConditionUrl: request or response header. TODO: This is not finished, at all!!!
void
-ConditionUrl::initialize(Parser&) // UNUSED: Parser &p
+ConditionUrl::initialize(Parser& /* p ATS_UNUSED */)
{
}
@@ -296,13 +296,13 @@ ConditionUrl::set_qualifier(const std::string& q) {
void
-ConditionUrl::append_value(std::string&, const Resources&) // UNUSED std;:string &s, Resources &res
+ConditionUrl::append_value(std::string& /* s ATS_UNUSED */, const Resources& /* res ATS_UNUSED */)
{
}
bool
-ConditionUrl::eval(const Resources&) // UNUSED Resources &res
+ConditionUrl::eval(const Resources& /* res ATS_UNUSED */)
{
bool ret = false;
@@ -338,7 +338,7 @@ ConditionDBM::initialize(Parser& p)
void
-ConditionDBM::append_value(std::string&, const Resources&) // UNUSED std::string& s, Resources &res
+ConditionDBM::append_value(std::string& /* s ATS_UNUSED */, const Resources& /* res ATS_UNUSED */)
{
// std::string key;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/header_rewrite/conditions.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/header_rewrite/conditions.h b/plugins/experimental/header_rewrite/conditions.h
index 87ccd0c..904533d 100644
--- a/plugins/experimental/header_rewrite/conditions.h
+++ b/plugins/experimental/header_rewrite/conditions.h
@@ -46,10 +46,10 @@ public:
TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionTrue");
}
- void append_value(std::string& s, const Resources&) { s += "TRUE"; } // UNUSED Resources& res
+ void append_value(std::string& s, const Resources& /* res ATS_UNUSED */) { s += "TRUE"; }
protected:
- bool eval(const Resources&) { // UNUSED Resources &res
+ bool eval(const Resources& /* res ATS_UNUSED */) {
TSDebug(PLUGIN_NAME, "Evaluating TRUE()");
return true;
}
@@ -67,10 +67,10 @@ public:
{
TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionFalse");
}
- void append_value(std::string& s, const Resources&) { s += "FALSE"; } // UNUSED Resources &res
+ void append_value(std::string& s, const Resources& /* res ATS_UNUSED */) { s += "FALSE"; }
protected:
- bool eval(const Resources&) { // UNUSED Resources &res
+ bool eval(const Resources& /* res ATS_UNUSED */) {
TSDebug(PLUGIN_NAME, "Evaluating FALSE()");
return false;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/header_rewrite/header_rewrite.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/header_rewrite/header_rewrite.cc b/plugins/experimental/header_rewrite/header_rewrite.cc
index 781e732..1300742 100644
--- a/plugins/experimental/header_rewrite/header_rewrite.cc
+++ b/plugins/experimental/header_rewrite/header_rewrite.cc
@@ -278,7 +278,7 @@ TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
TSReturnCode
-TSRemapNewInstance(int argc, char *argv[], void **ih, char *, int) // UNUSED: char *errbuf, int errbuf_size)
+TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSED */, int /* errbuf_size ATS_UNUSED */)
{
TSDebug(PLUGIN_NAME, "initializing the remap plugin header_rewrite");
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/header_rewrite/matcher.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/header_rewrite/matcher.h b/plugins/experimental/header_rewrite/matcher.h
index 598460c..d9648c8 100644
--- a/plugins/experimental/header_rewrite/matcher.h
+++ b/plugins/experimental/header_rewrite/matcher.h
@@ -80,7 +80,7 @@ public:
// Getters / setters
const T get() const { return _data; };
- void setRegex(const std::string) // UNUSED std::string data
+ void setRegex(const std::string /* data ATS_UNUSED */)
{
if (!helper.setRegexMatch(_data)) {
std::cout<<"Invalid regex:failed to precompile"<<std::endl;
@@ -89,8 +89,8 @@ public:
TSDebug(PLUGIN_NAME,"Regex precompiled successfully");
}
- void setRegex(const unsigned int) { return; } // UNUSED unsigned int t
- void setRegex(const TSHttpStatus) { return; } // UNUSED TSHttpStatus t
+ void setRegex(const unsigned int /* t ATS_UNUSED */) { return; }
+ void setRegex(const TSHttpStatus /* t ATS_UNUSED */) { return; }
void set (const T d)
{
@@ -137,12 +137,12 @@ private:
return t > _data;
}
- bool test_reg(const unsigned int) const { // UNUSED usigned int t
+ bool test_reg(const unsigned int /* t ATS_UNUSED */) const {
// Not supported
return false;
}
- bool test_reg(const TSHttpStatus) const { // UNUSED TSHttpStatus t
+ bool test_reg(const TSHttpStatus /* t ATS_UNUSED */) const {
// Not supported
return false;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/header_rewrite/operators.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/header_rewrite/operators.h b/plugins/experimental/header_rewrite/operators.h
index 62269b1..f43858f 100644
--- a/plugins/experimental/header_rewrite/operators.h
+++ b/plugins/experimental/header_rewrite/operators.h
@@ -167,7 +167,7 @@ public:
}
protected:
- void exec(const Resources&) const { }; // UNUSED Resources &res
+ void exec(const Resources& /* res ATS_UNUSED */) const { };
private:
DISALLOW_COPY_AND_ASSIGN(OperatorNoOp);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/lua/lutil.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/lutil.cc b/plugins/experimental/lua/lutil.cc
index 19649ba..dfe1783 100644
--- a/plugins/experimental/lua/lutil.cc
+++ b/plugins/experimental/lua/lutil.cc
@@ -27,7 +27,7 @@ int LuaHttpArgIndex;
#if !defined(LUAJIT_VERSION)
static void *
-LuaAllocate(void * ud, void * ptr, size_t, size_t nsize) // UNUSED: size_t osize
+LuaAllocate(void * ud, void * ptr, size_t /* osize ATS_UNUSED */, size_t nsize)
{
TSReleaseAssert(ud == NULL);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/lua/remap.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/remap.cc b/plugins/experimental/lua/remap.cc
index 2d950df..1911c64 100644
--- a/plugins/experimental/lua/remap.cc
+++ b/plugins/experimental/lua/remap.cc
@@ -53,9 +53,9 @@ LuaPluginRemap(lua_State * lua, TSHttpTxn txn, TSRemapRequestInfo * rri)
return rq->status;
}
-// UNUSED: TSRemapInterface * api_info, char * errbuf, int errbuf_size
TSReturnCode
-TSRemapInit(TSRemapInterface *, char *, int)
+TSRemapInit(TSRemapInterface * /* api_info ATS_UNUSED */, char * /* errbuf ATS_UNUSED */,
+ int /* errbuf_size ATS_UNUSED */)
{
LuaLogDebug("loading lua plugin");
@@ -66,7 +66,7 @@ TSRemapInit(TSRemapInterface *, char *, int)
}
TSReturnCode
-TSRemapNewInstance(int argc, char * argv[], void ** ih, char *, int) // UNUSED char * errbuf, int errsz
+TSRemapNewInstance(int argc, char * argv[], void ** ih, char * /* errbuf ATS_UNUSED */, int /* errsz ATS_UNUSED */)
{
instanceid_t instanceid;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/metalink/metalink.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/metalink/metalink.cc b/plugins/experimental/metalink/metalink.cc
index 6c97c8f..4b9f829 100644
--- a/plugins/experimental/metalink/metalink.cc
+++ b/plugins/experimental/metalink/metalink.cc
@@ -83,7 +83,7 @@ typedef struct {
} SendData;
static int
-write_vconn_write_complete(TSCont contp, void *) // UNUSED void* edata
+write_vconn_write_complete(TSCont contp, void * /* edata ATS_UNUSED */)
{
WriteData *data = (WriteData *) TSContDataGet(contp);
TSContDestroy(contp);
@@ -168,7 +168,7 @@ cache_open_write(TSCont contp, void *edata)
}
static int
-cache_open_write_failed(TSCont contp, void *) // UNUSED void *edata
+cache_open_write_failed(TSCont contp, void * /* edata ATS_UNUSED */)
{
TransformData *data = (TransformData *) TSContDataGet(contp);
@@ -178,7 +178,7 @@ cache_open_write_failed(TSCont contp, void *) // UNUSED void *edata
}
static int
-vconn_write_ready(TSCont contp, void *) // UNUSED void *edata
+vconn_write_ready(TSCont contp, void * /* edata ATS_UNUSED */)
{
const char *value;
int64_t length;
@@ -263,7 +263,7 @@ vconn_write_ready(TSCont contp, void *) // UNUSED void *edata
}
static int
-transform_vconn_write_complete(TSCont contp, void *) // UNUSED void *edata
+transform_vconn_write_complete(TSCont contp, void * /* edata ATS_UNUSED */)
{
TransformData *data = (TransformData *) TSContDataGet(contp);
@@ -303,7 +303,7 @@ transform_handler(TSCont contp, TSEvent event, void *edata)
}
static int
-rewrite_handler(TSCont contp, TSEvent event, void *) // UNUSED void *edata
+rewrite_handler(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
{
const char *value;
int length;
@@ -352,7 +352,7 @@ cache_open_read(TSCont contp, void *edata)
}
static int
-cache_open_read_failed(TSCont contp, void *) // UNUSED void *edata
+cache_open_read_failed(TSCont contp, void * /* edata ATS_UNUSED */)
{
SendData *data = (SendData *) TSContDataGet(contp);
TSContDestroy(contp);
@@ -370,7 +370,7 @@ cache_open_read_failed(TSCont contp, void *) // UNUSED void *edata
}
static int
-vconn_read_ready(TSCont contp, void *) // UNUSED void *edata
+vconn_read_ready(TSCont contp, void * /* edata ATS_UNUSED */)
{
const char *value;
int64_t length;
@@ -445,7 +445,7 @@ digest_handler(TSCont contp, TSEvent event, void *edata)
/* Check if "Location: ..." URL already exist in cache */
static int
-location_handler(TSCont contp, TSEvent event, void *) // UNUSED void *edata
+location_handler(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
{
SendData *data = (SendData *) TSContDataGet(contp);
TSContDestroy(contp);
@@ -501,7 +501,7 @@ location_handler(TSCont contp, TSEvent event, void *) // UNUSED void *edata
/* Compute SHA-256 digest, write to cache, and store there the request URL */
static int
-http_read_response_hdr(TSCont, void *edata) // UNUSED TSCont contp
+http_read_response_hdr(TSCont /* contp ATS_UNUSED */, void *edata)
{
TransformData *data = (TransformData *) TSmalloc(sizeof(TransformData));
data->txnp = (TSHttpTxn) edata;
@@ -650,7 +650,7 @@ handler(TSCont contp, TSEvent event, void *edata)
}
void
-TSPluginInit(int, const char *[]) // UNUSED int argc, char *argv[]
+TSPluginInit(int /* argc ATS_UNUSED */, const char */* argv ATS_UNUSED */[])
{
TSPluginRegistrationInfo info;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/experimental/tcp_info/tcp_info.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/tcp_info/tcp_info.cc b/plugins/experimental/tcp_info/tcp_info.cc
index a9e083a..c261467 100644
--- a/plugins/experimental/tcp_info/tcp_info.cc
+++ b/plugins/experimental/tcp_info/tcp_info.cc
@@ -175,7 +175,7 @@ log_tcp_info(const char* event_name, const char* client_ip, const char* server_i
static int
-tcp_info_hook(TSCont, TSEvent event, void *edata) // UNUSED TSCont contp
+tcp_info_hook(TSCont /* contp ATS_UNUSED */, TSEvent event, void *edata)
{
TSHttpSsn ssnp = NULL;
TSHttpTxn txnp = NULL;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/header_filter/header_filter.cc
----------------------------------------------------------------------
diff --git a/plugins/header_filter/header_filter.cc b/plugins/header_filter/header_filter.cc
index 60955d6..33713e9 100644
--- a/plugins/header_filter/header_filter.cc
+++ b/plugins/header_filter/header_filter.cc
@@ -43,7 +43,7 @@ int arg_idx;
// Continuation
//
static int
-cont_header_filter(TSCont, TSEvent event, void *edata) // UNUSED TSCont contp
+cont_header_filter(TSCont /* contp ATS_UNUSED */, TSEvent event, void *edata)
{
TSHttpTxn txnp = (TSHttpTxn) edata;
TSHttpHookID hook = TS_HTTP_LAST_HOOK;
@@ -156,7 +156,7 @@ TSRemapInit(TSRemapInterface* api_info, char *errbuf, int errbuf_size)
TSReturnCode
-TSRemapNewInstance(int argc, char* argv[], void** ih, char*, int) // UNUSED char* errbuf, int errbuf_size
+TSRemapNewInstance(int argc, char* argv[], void** ih, char* /* errbuf ATS_UNUSED */, int /* errbuf_size */)
{
if (argc < 3) {
TSError("Unable to create remap instance, need rules file");
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/plugins/regex_remap/regex_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/regex_remap/regex_remap.cc b/plugins/regex_remap/regex_remap.cc
index 45b4954..8b637f6 100644
--- a/plugins/regex_remap/regex_remap.cc
+++ b/plugins/regex_remap/regex_remap.cc
@@ -563,7 +563,7 @@ TSRemapInit(TSRemapInterface* api_info, char *errbuf, int errbuf_size)
// We don't have any specific "instances" here, at least not yet.
//
TSReturnCode
-TSRemapNewInstance(int argc, char* argv[], void** ih, char*, int) // UNUSED char* errbuf, int errbuf_size
+TSRemapNewInstance(int argc, char* argv[], void** ih, char* /* errbuf ATS_UNUSED */, int /* errbuf_sizeATS_UNUSED */)
{
const char* error;
int erroffset;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/CacheControl.cc
----------------------------------------------------------------------
diff --git a/proxy/CacheControl.cc b/proxy/CacheControl.cc
index d0cbc74..37a3a4e 100644
--- a/proxy/CacheControl.cc
+++ b/proxy/CacheControl.cc
@@ -202,7 +202,7 @@ getCacheControl(CacheControlResult *result, HttpRequestData *rdata, OverridableH
}
bool
-getClusterCacheLocal(URL *url, char *) // UNUSED char *hostname
+getClusterCacheLocal(URL *url, char * /* hostname ATS_UNUSED */)
{
HttpRequestData rdata;
CacheControlResult result;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/ControlBase.cc
----------------------------------------------------------------------
diff --git a/proxy/ControlBase.cc b/proxy/ControlBase.cc
index 14c83fd..37e6ac6 100644
--- a/proxy/ControlBase.cc
+++ b/proxy/ControlBase.cc
@@ -408,7 +408,7 @@ bool PrefixMod::check(HttpRequestData* req) const {
return zret;
}
PrefixMod*
-PrefixMod::make(char * value, char const **) { // UNUSED const **error
+PrefixMod::make(char * value, char const ** /* error ATS_UNUSED */) {
PrefixMod* mod = new PrefixMod;
// strip leading slashes because get_path which is used later
// doesn't include them from the URL.
@@ -436,7 +436,7 @@ bool SuffixMod::check(HttpRequestData* req) const {
;
}
SuffixMod*
-SuffixMod::make(char * value, char const **) { // UNUSED const **error
+SuffixMod::make(char * value, char const ** /* error ATS_UNUSED */) {
SuffixMod* mod = new SuffixMod;
mod->text.set(ats_strdup(value), strlen(value));
return mod;
@@ -458,7 +458,7 @@ bool TagMod::check(HttpRequestData* req) const {
return 0 == strcmp(req->tag, text.data());
}
TagMod*
-TagMod::make(char * value, char const **) { // UNUSED const **error
+TagMod::make(char * value, char const ** /* error ATS_UNUSED */) {
TagMod* mod = new TagMod;
mod->text.set(ats_strdup(value), strlen(value));
return mod;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index f7e4206..cf374af 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -660,7 +660,7 @@ isWriteable(TSMBuffer bufp)
/* Allocators for field handles and standalone fields */
/******************************************************/
static MIMEFieldSDKHandle *
-sdk_alloc_field_handle(TSMBuffer, MIMEHdrImpl *mh) // UNUSED TSMBuffer bufp
+sdk_alloc_field_handle(TSMBuffer /* bufp ATS_UNUSED */, MIMEHdrImpl *mh)
{
MIMEFieldSDKHandle *handle = mHandleAllocator.alloc();
@@ -1979,7 +1979,7 @@ TSUrlCreate(TSMBuffer bufp, TSMLoc *locp)
}
TSReturnCode
-TSUrlDestroy(TSMBuffer, TSMLoc) // UNUSED TSMBuffer bufp, TSMLoc url_loc
+TSUrlDestroy(TSMBuffer /* bufp ATS_UNUSED */, TSMLoc /* url_loc ATS_UNUSED */)
{
return TS_SUCCESS;
}
@@ -5889,7 +5889,7 @@ TSHttpTxnClientRespBodyBytesGet(TSHttpTxn txnp)
}
int
-TSHttpTxnPushedRespHdrBytesGet(TSHttpTxn txnp, int *) // UNUSED int *bytes
+TSHttpTxnPushedRespHdrBytesGet(TSHttpTxn txnp, int * /* bytes ATS_UNUSED */)
{
sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
@@ -8164,7 +8164,7 @@ TSPortDescriptorParse(const char * descriptor)
}
TSReturnCode
-TSPortDescriptorAccept(TSPortDescriptor descp, TSCont) // UNUSED TSCont contp
+TSPortDescriptorAccept(TSPortDescriptor descp, TSCont /* contp ATS_UNUSED */)
{
HttpProxyPort * port = (HttpProxyPort *)descp;
return start_HttpProxyPort(*port, 0 /* nthreads */) ? TS_SUCCESS : TS_ERROR;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/InkAPITest.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index e521cf7..be37202 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -7485,7 +7485,7 @@ REGRESSION_TEST(SDK_API_OVERRIDABLE_CONFIGS) (RegressionTest * test, int atype,
// TSStringPercentDecode
////////////////////////////////////////////////
-REGRESSION_TEST(SDK_API_ENCODING) (RegressionTest * test, int, int *pstatus) // UNUSED int atype
+REGRESSION_TEST(SDK_API_ENCODING) (RegressionTest * test, int /* atype ATS_UNUSED */, int *pstatus)
{
const char *url = "http://www.example.com/foo?fie= \"#%<>[]\\^`{}~&bar={test}&fum=Apache Traffic Server";
const char *url_encoded =
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index c9da002..6497a3b 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -1278,7 +1278,7 @@ change_uid_gid(const char *user)
char *buf = (char *)ats_malloc(buflen);
if (0 != geteuid() && 0 == getuid())
- NOWARN_UNUSED_RETURN(seteuid(0)); // revert euid if possible.
+ ATS_UNUSED_RETURN(seteuid(0)); // revert euid if possible.
if (0 != geteuid()) {
// Not root so can't change user ID. Logging isn't operational yet so
// we have to write directly to stderr. Perhaps this should be fatal?
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/PluginVC.cc
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index 29be00b..c1debab 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -899,7 +899,7 @@ PluginVC::set_remote_addr()
}
int
-PluginVC::set_tcp_init_cwnd(int) // UNUSED int init_cwnd
+PluginVC::set_tcp_init_cwnd(int /* init_cwnd ATS_UNUSED */)
{
return -1;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/hdrs/MIME.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/MIME.cc b/proxy/hdrs/MIME.cc
index 3d2ce9f..2f78d54 100644
--- a/proxy/hdrs/MIME.cc
+++ b/proxy/hdrs/MIME.cc
@@ -1116,9 +1116,9 @@ static inline void relocate(MIMEField *field, MIMEFieldBlockImpl *dest_block, MI
}
}
-// UNUSED int block_count
void
-mime_hdr_field_block_list_adjust(int, MIMEFieldBlockImpl *old_list, MIMEFieldBlockImpl *new_list)
+mime_hdr_field_block_list_adjust(int /* block_count ATS_UNUSED */, MIMEFieldBlockImpl *old_list,
+ MIMEFieldBlockImpl *new_list)
{
for (MIMEFieldBlockImpl *new_blk = new_list; new_blk; new_blk = new_blk->m_next)
for (MIMEField *field = new_blk->m_field_slots, *end=field + new_blk->m_freetop; field != end; ++field)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/http/HttpBodyFactory.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpBodyFactory.cc b/proxy/http/HttpBodyFactory.cc
index a17fb5e..755cdb0 100644
--- a/proxy/http/HttpBodyFactory.cc
+++ b/proxy/http/HttpBodyFactory.cc
@@ -56,15 +56,12 @@
//
////////////////////////////////////////////////////////////////////////
-// UNUSED HTTPStatus status_code, const char* reason_or_null
char *
HttpBodyFactory::fabricate_with_old_api(const char *type, HttpTransact::State * context,
int64_t max_buffer_length, int64_t *resulting_buffer_length,
- char* content_language_out_buf,
- size_t content_language_buf_size,
- char* content_type_out_buf,
- size_t content_type_buf_size,
- HTTPStatus, const char *, const char *format, va_list ap)
+ char* content_language_out_buf, size_t content_language_buf_size,
+ char* content_type_out_buf, size_t content_type_buf_size,
+ const char *format, va_list ap)
{
char *buffer = NULL;
const char *lang_ptr = NULL;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/http/HttpBodyFactory.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpBodyFactory.h b/proxy/http/HttpBodyFactory.h
index 52ab68c..b13ac85 100644
--- a/proxy/http/HttpBodyFactory.h
+++ b/proxy/http/HttpBodyFactory.h
@@ -162,23 +162,20 @@ public:
size_t content_language_buf_size,
char* content_type_out_buf,
size_t content_type_buf_size,
- HTTPStatus status_code, const char *reason_or_null, const char *format, va_list ap);
+ const char *format, va_list ap);
char *fabricate_with_old_api_build_va(const char *type, HttpTransact::State * context,
int64_t max_buffer_length, int64_t *resulting_buffer_length,
- char* content_language_out_buf,
- size_t content_language_buf_size,
- char* content_type_out_buf,
- size_t content_type_buf_size,
- HTTPStatus status_code, const char *reason_or_null, const char *format, ...)
+ char* content_language_out_buf, size_t content_language_buf_size,
+ char* content_type_out_buf, size_t content_type_buf_size,
+ const char *format, ...)
{
va_list ap;
- va_start(ap, format);
- return (fabricate_with_old_api(type, context, max_buffer_length,
- resulting_buffer_length,
- content_language_out_buf, content_language_buf_size,
- content_type_out_buf, content_type_buf_size,
- status_code, reason_or_null, format, ap));
+
+ va_start(ap, format);
+ return fabricate_with_old_api(type, context, max_buffer_length, resulting_buffer_length,
+ content_language_out_buf, content_language_buf_size,
+ content_type_out_buf, content_type_buf_size, format, ap);
}
void dump_template_tables(FILE * fp = stderr);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 3e466f0..135c2c1 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -8013,7 +8013,7 @@ HttpTransact::build_error_response(State *s, HTTPStatus status_code, const char
&s->internal_msg_buffer_size,
body_language, sizeof(body_language),
body_type, sizeof(body_type),
- status_code, reason_phrase, format, ap);
+ format, ap);
s->hdr_info.client_response.value_set(MIME_FIELD_CONTENT_TYPE, MIME_LEN_CONTENT_TYPE, body_type, strlen(body_type));
s->hdr_info.client_response.value_set(MIME_FIELD_CONTENT_LANGUAGE, MIME_LEN_CONTENT_LANGUAGE, body_language,
@@ -8059,7 +8059,6 @@ HttpTransact::build_redirect_response(State* s)
const char *new_url = NULL;
int new_url_len;
char *to_free = NULL;
-
char body_language[256], body_type[256];
HTTPStatus status_code = HTTP_STATUS_MOVED_TEMPORARILY;
@@ -8101,13 +8100,10 @@ HttpTransact::build_redirect_response(State* s)
free_internal_msg_buffer(s->internal_msg_buffer, s->internal_msg_buffer_fast_allocator_size);
}
s->internal_msg_buffer_fast_allocator_size = -1;
-
s->internal_msg_buffer = body_factory->fabricate_with_old_api_build_va("redirect#moved_temporarily", s, 8192,
&s->internal_msg_buffer_size,
body_language, sizeof(body_language),
body_type, sizeof(body_type),
- status_code,
- reason_phrase,
"%s <a href=\"%s\">%s</a>. %s.",
"The document you requested is now",
new_url, new_url,
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/http/HttpUpdateTester.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpUpdateTester.cc b/proxy/http/HttpUpdateTester.cc
index f5ddea5..816028a 100644
--- a/proxy/http/HttpUpdateTester.cc
+++ b/proxy/http/HttpUpdateTester.cc
@@ -43,7 +43,7 @@ private:
#endif
};
-UpTest::UpTest(FILE *, ProxyMutex * amutex) // UNUSED FILE *f
+UpTest::UpTest(FILE * /* f ATS_UNUSED */, ProxyMutex * amutex)
: Continuation(amutex), active_req(0)
#ifdef GO_AWAY
, total_req(0), file(f)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/logcat.cc
----------------------------------------------------------------------
diff --git a/proxy/logcat.cc b/proxy/logcat.cc
index 99c4e03..71a02c1 100644
--- a/proxy/logcat.cc
+++ b/proxy/logcat.cc
@@ -222,7 +222,7 @@ open_output_file(char *output_file)
-------------------------------------------------------------------------*/
int
-main(int, char *argv[]) // UNUSED int argc
+main(int /* argc ATS_UNUSED */, char *argv[])
{
enum
{
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/logstats.cc
----------------------------------------------------------------------
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index 5389db4..8b4480c 100644
--- a/proxy/logstats.cc
+++ b/proxy/logstats.cc
@@ -2244,7 +2244,7 @@ open_main_log(ExitStatus& status)
///////////////////////////////////////////////////////////////////////////////
// main
int
-main(int, char *argv[]) // UNUSED int argc
+main(int /* argc ATS_UNUSED */, char *argv[])
{
ExitStatus exit_status;
int res, cnt;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/sac.cc
----------------------------------------------------------------------
diff --git a/proxy/sac.cc b/proxy/sac.cc
index 43b4238..11f9f43 100644
--- a/proxy/sac.cc
+++ b/proxy/sac.cc
@@ -78,7 +78,7 @@ int n_argument_descriptions = SIZE(argument_descriptions);
-------------------------------------------------------------------------*/
int
-main(int, char *argv[]) // UNUSED int argc
+main(int /* argc ATS_UNUSED */, char *argv[])
{
// build the application information structure
//
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/proxy/signals.cc
----------------------------------------------------------------------
diff --git a/proxy/signals.cc b/proxy/signals.cc
index 3accb2b..60e62f7 100644
--- a/proxy/signals.cc
+++ b/proxy/signals.cc
@@ -194,7 +194,7 @@ signal_handler(int sig, siginfo_t * t, void *c)
}
#else
snprintf(sig_msg, sizeof(sig_msg), "NOTE: Traffic Server received Sig %d: %s\n", sig, strsignal(sig));
- NOWARN_UNUSED_RETURN(write(2, sig_msg, strlen(sig_msg)));
+ ATS_UNUSED_RETURN(write(2, sig_msg, strlen(sig_msg)));
//syslog(LOG_ERR, sig_msg);
#endif
@@ -218,11 +218,11 @@ signal_handler(int sig, siginfo_t * t, void *c)
case SIGXCPU:
case SIGXFSZ:
case SIGSEGV:
- ink_stack_trace_dump(2);
+ ink_stack_trace_dump();
signal(sig, SIG_DFL);
return;
case SIGUSR2:
- ink_stack_trace_dump(2);
+ ink_stack_trace_dump();
return;
case SIGABRT:
case SIGUSR1:
Re: [6/6] git commit: TS-1820 Cleanup the comments some, and eliminate
a few unused parameters where it was obvious
Posted by Leif Hedstrom <zw...@apache.org>.
On 4/20/13 4:41 AM, Igor Galić wrote:
>
> ----- Original Message -----
>> TS-1820 Cleanup the comments some, and eliminate a few unused
>> parameters where it was obvious
> [snip]
>> //----------------------------------------------------------------------------
>> void
>> -TSPluginInit(int, const char *[]) // UNUSED int argc, const char *argv[]
>> +TSPluginInit(int /* argc ATS_UNUSED */, const char */* argv ATS_UNUSED */[])
>> {
>> global_contp = TSContCreate(cache_print_plugin, TSMutexCreate());
>> TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, global_contp);
>
> I'm confused, I thought that's the way to pass parameters to a plugin via the config.
> Has Phil taught me wrong?
No why? This plugin simply isn't using the arguments.
-- Leif
Re: [6/6] git commit: TS-1820 Cleanup the comments some, and
eliminate a few unused parameters where it was obvious
Posted by Igor Galić <i....@brainsware.org>.
----- Original Message -----
> TS-1820 Cleanup the comments some, and eliminate a few unused
> parameters where it was obvious
[snip]
> //----------------------------------------------------------------------------
> void
> -TSPluginInit(int, const char *[]) // UNUSED int argc, const char *argv[]
> +TSPluginInit(int /* argc ATS_UNUSED */, const char */* argv ATS_UNUSED */[])
> {
> global_contp = TSContCreate(cache_print_plugin, TSMutexCreate());
> TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, global_contp);
I'm confused, I thought that's the way to pass parameters to a plugin via the config.
Has Phil taught me wrong?
-- i
Igor Galić
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE
Re: [6/6] git commit: TS-1820 Cleanup the comments some, and eliminate
a few unused parameters where it was obvious
Posted by Leif Hedstrom <zw...@apache.org>.
On 4/20/13 5:03 AM, Igor Galić wrote:
>
> ----- Original Message -----
>> TS-1820 Cleanup the comments some, and eliminate a few unused
>> parameters where it was obvious
> [snip]
>> Commit: c88d6153e0850a5c5f633ae8afd7947773b65d99
>> Parents: c6dd66e
> [snip]
>> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/cache/CacheWrite.cc
>> ----------------------------------------------------------------------
>> diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc
>> index c725430..15e4183 100644
>> --- a/iocore/cache/CacheWrite.cc
>> +++ b/iocore/cache/CacheWrite.cc
>> @@ -831,7 +831,7 @@ agg_copy(char *p, CacheVC *vc)
>> // move data
>> if (vc->write_len) {
>> {
>> - ProxyMutex ATS_UNUSED *mutex = vc->vol->mutex;
>> + ProxyMutex *mutex ATS_UNUSED = vc->vol->mutex;
>> ink_debug_assert(mutex->thread_holding == this_ethread());
>> CACHE_DEBUG_SUM_DYN_STAT(cache_write_bytes_stat,
>> vc->write_len);
> Can someone please enlighten me as to how it makes sense that the
> ProxyMutex in the CacheWrite class, that is assigned here, is not unused?
> If this piece of code is not critical to warant a mutex lock, why not remove completely?
Yes. It's because CACHE_DEBUG_SUM_DYN_STAT uses other macros, which expects
a local variable named "mutex".... It's kinda wonky, but just the way it is
:-/. So in reality, mutex *is* used, the compiler is just not smart enough
to realize it I think.
-- Leif
Re: [6/6] git commit: TS-1820 Cleanup the comments some, and
eliminate a few unused parameters where it was obvious
Posted by Igor Galić <i....@brainsware.org>.
----- Original Message -----
> TS-1820 Cleanup the comments some, and eliminate a few unused
> parameters where it was obvious
[snip]
> Commit: c88d6153e0850a5c5f633ae8afd7947773b65d99
> Parents: c6dd66e
[snip]
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/cache/CacheWrite.cc
> ----------------------------------------------------------------------
> diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc
> index c725430..15e4183 100644
> --- a/iocore/cache/CacheWrite.cc
> +++ b/iocore/cache/CacheWrite.cc
> @@ -831,7 +831,7 @@ agg_copy(char *p, CacheVC *vc)
> // move data
> if (vc->write_len) {
> {
> - ProxyMutex ATS_UNUSED *mutex = vc->vol->mutex;
> + ProxyMutex *mutex ATS_UNUSED = vc->vol->mutex;
> ink_debug_assert(mutex->thread_holding == this_ethread());
> CACHE_DEBUG_SUM_DYN_STAT(cache_write_bytes_stat,
> vc->write_len);
Can someone please enlighten me as to how it makes sense that the
ProxyMutex in the CacheWrite class, that is assigned here, is not unused?
If this piece of code is not critical to warant a mutex lock, why not remove completely?
-- i
Igor Galić
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE