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:27 UTC
[2/6] TS-1820 Introduce TS_UNUSED,
and migrate most of the code to use either C++ style unused
parameters, or this new macro
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/plugins/stats_over_http/stats_over_http.c
----------------------------------------------------------------------
diff --git a/plugins/stats_over_http/stats_over_http.c b/plugins/stats_over_http/stats_over_http.c
index 0b7bb8e..da320a0 100644
--- a/plugins/stats_over_http/stats_over_http.c
+++ b/plugins/stats_over_http/stats_over_http.c
@@ -33,6 +33,8 @@
#include <inttypes.h>
+#include "ink_defs.h"
+
typedef struct stats_state_t
{
TSVConn net_vc;
@@ -122,7 +124,7 @@ stats_process_read(TSCont contp, TSEvent event, stats_state * my_state)
} while(0)
static void
-json_out_stat(TSRecordType rec_type, void *edata, int registered,
+json_out_stat(TSRecordType rec_type ATS_UNUSED, void *edata, int registered ATS_UNUSED,
const char *name, TSRecordDataType data_type,
TSRecordData *datum) {
stats_state *my_state = edata;
@@ -193,7 +195,7 @@ stats_dostuff(TSCont contp, TSEvent event, void *edata)
}
static int
-stats_origin(TSCont contp, TSEvent event, void *edata)
+stats_origin(TSCont contp ATS_UNUSED, TSEvent event ATS_UNUSED, void *edata)
{
TSCont icontp;
stats_state *my_state;
@@ -269,7 +271,7 @@ check_ts_version()
}
void
-TSPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
{
TSPluginRegistrationInfo info;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/proxy/CacheControl.cc
----------------------------------------------------------------------
diff --git a/proxy/CacheControl.cc b/proxy/CacheControl.cc
index cd51f88..d0cbc74 100644
--- a/proxy/CacheControl.cc
+++ b/proxy/CacheControl.cc
@@ -202,7 +202,7 @@ getCacheControl(CacheControlResult *result, HttpRequestData *rdata, OverridableH
}
bool
-getClusterCacheLocal(URL *url, char *hostname)
+getClusterCacheLocal(URL *url, char *) // UNUSED char *hostname
{
HttpRequestData rdata;
CacheControlResult result;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/proxy/ControlBase.cc
----------------------------------------------------------------------
diff --git a/proxy/ControlBase.cc b/proxy/ControlBase.cc
index 9a55495..14c83fd 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 ** error ) {
+PrefixMod::make(char * value, char const **) { // UNUSED const **error
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 ** error ) {
+SuffixMod::make(char * value, char const **) { // UNUSED const **error
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 ** error ) {
+TagMod::make(char * value, char const **) { // UNUSED const **error
TagMod* mod = new TagMod;
mod->text.set(ats_strdup(value), strlen(value));
return mod;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index fd8258e..f7e4206 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 bufp, MIMEHdrImpl *mh)
+sdk_alloc_field_handle(TSMBuffer, MIMEHdrImpl *mh) // UNUSED TSMBuffer bufp
{
MIMEFieldSDKHandle *handle = mHandleAllocator.alloc();
@@ -1979,7 +1979,7 @@ TSUrlCreate(TSMBuffer bufp, TSMLoc *locp)
}
TSReturnCode
-TSUrlDestroy(TSMBuffer bufp, TSMLoc url_loc)
+TSUrlDestroy(TSMBuffer, TSMLoc) // UNUSED TSMBuffer bufp, TSMLoc url_loc
{
return TS_SUCCESS;
}
@@ -5889,7 +5889,7 @@ TSHttpTxnClientRespBodyBytesGet(TSHttpTxn txnp)
}
int
-TSHttpTxnPushedRespHdrBytesGet(TSHttpTxn txnp, int *bytes)
+TSHttpTxnPushedRespHdrBytesGet(TSHttpTxn txnp, int *) // UNUSED int *bytes
{
sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
@@ -8164,7 +8164,7 @@ TSPortDescriptorParse(const char * descriptor)
}
TSReturnCode
-TSPortDescriptorAccept(TSPortDescriptor descp, TSCont contp)
+TSPortDescriptorAccept(TSPortDescriptor descp, TSCont) // UNUSED TSCont contp
{
HttpProxyPort * port = (HttpProxyPort *)descp;
return start_HttpProxyPort(*port, 0 /* nthreads */) ? TS_SUCCESS : TS_ERROR;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/proxy/InkAPITest.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 9b81b5d..e521cf7 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 atype, int *pstatus)
+REGRESSION_TEST(SDK_API_ENCODING) (RegressionTest * test, int, int *pstatus) // UNUSED int atype
{
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/e343dbbc/proxy/PluginVC.cc
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index 47a285a..29be00b 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -899,7 +899,7 @@ PluginVC::set_remote_addr()
}
int
-PluginVC::set_tcp_init_cwnd(int init_cwnd)
+PluginVC::set_tcp_init_cwnd(int) // UNUSED int init_cwnd
{
return -1;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/proxy/hdrs/MIME.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/MIME.cc b/proxy/hdrs/MIME.cc
index 9f0e8dc..3d2ce9f 100644
--- a/proxy/hdrs/MIME.cc
+++ b/proxy/hdrs/MIME.cc
@@ -1116,8 +1116,9 @@ static inline void relocate(MIMEField *field, MIMEFieldBlockImpl *dest_block, MI
}
}
+// UNUSED int block_count
void
-mime_hdr_field_block_list_adjust(int block_count, MIMEFieldBlockImpl *old_list, MIMEFieldBlockImpl *new_list)
+mime_hdr_field_block_list_adjust(int, 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/e343dbbc/proxy/http/HttpBodyFactory.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpBodyFactory.cc b/proxy/http/HttpBodyFactory.cc
index a256962..a17fb5e 100644
--- a/proxy/http/HttpBodyFactory.cc
+++ b/proxy/http/HttpBodyFactory.cc
@@ -56,6 +56,7 @@
//
////////////////////////////////////////////////////////////////////////
+// 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,
@@ -63,7 +64,7 @@ HttpBodyFactory::fabricate_with_old_api(const char *type, HttpTransact::State *
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)
+ HTTPStatus, const char *, const char *format, va_list ap)
{
char *buffer = NULL;
const char *lang_ptr = NULL;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/proxy/http/HttpUpdateTester.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpUpdateTester.cc b/proxy/http/HttpUpdateTester.cc
index c5c1829..f5ddea5 100644
--- a/proxy/http/HttpUpdateTester.cc
+++ b/proxy/http/HttpUpdateTester.cc
@@ -43,8 +43,8 @@ private:
#endif
};
-UpTest::UpTest(FILE * f, ProxyMutex * amutex):
-Continuation(amutex), active_req(0)
+UpTest::UpTest(FILE *, ProxyMutex * amutex) // UNUSED FILE *f
+ : Continuation(amutex), active_req(0)
#ifdef GO_AWAY
, total_req(0), file(f)
#endif
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/proxy/logcat.cc
----------------------------------------------------------------------
diff --git a/proxy/logcat.cc b/proxy/logcat.cc
index 6f0ea84..99c4e03 100644
--- a/proxy/logcat.cc
+++ b/proxy/logcat.cc
@@ -222,7 +222,7 @@ open_output_file(char *output_file)
-------------------------------------------------------------------------*/
int
-main(int argc, char *argv[])
+main(int, char *argv[]) // UNUSED int argc
{
enum
{
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/proxy/logstats.cc
----------------------------------------------------------------------
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index 4676e52..5389db4 100644
--- a/proxy/logstats.cc
+++ b/proxy/logstats.cc
@@ -2244,7 +2244,7 @@ open_main_log(ExitStatus& status)
///////////////////////////////////////////////////////////////////////////////
// main
int
-main(int argc, char *argv[])
+main(int, char *argv[]) // UNUSED int argc
{
ExitStatus exit_status;
int res, cnt;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/proxy/sac.cc
----------------------------------------------------------------------
diff --git a/proxy/sac.cc b/proxy/sac.cc
index 04dd5fd..43b4238 100644
--- a/proxy/sac.cc
+++ b/proxy/sac.cc
@@ -78,7 +78,7 @@ int n_argument_descriptions = SIZE(argument_descriptions);
-------------------------------------------------------------------------*/
int
-main(int argc, char *argv[])
+main(int, char *argv[]) // UNUSED int argc
{
// build the application information structure
//
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e343dbbc/tools/http_load/http_load.c
----------------------------------------------------------------------
diff --git a/tools/http_load/http_load.c b/tools/http_load/http_load.c
index 4e7b31a..0c7a072 100644
--- a/tools/http_load/http_load.c
+++ b/tools/http_load/http_load.c
@@ -1128,7 +1128,7 @@ start_socket(int url_num, int cnum, struct timeval *nowP)
}
static int
-cert_verify_callback(int ok, X509_STORE_CTX *ctx)
+cert_verify_callback(int ok __attribute__ ((unused)), X509_STORE_CTX *ctx __attribute__ ((unused)))
{
return 1;
}
@@ -2765,7 +2765,7 @@ handle_read(int cnum, struct timeval *nowP)
static void
-idle_connection(ClientData client_data, struct timeval *nowP)
+idle_connection(ClientData client_data, struct timeval *nowP __attribute__ ((unused)))
{
int cnum;
struct timeval tv;
@@ -2793,7 +2793,7 @@ idle_connection(ClientData client_data, struct timeval *nowP)
static void
-wakeup_connection(ClientData client_data, struct timeval *nowP)
+wakeup_connection(ClientData client_data, struct timeval *nowP __attribute__ ((unused)))
{
int cnum;
@@ -2889,7 +2889,7 @@ close_connection(int cnum)
static void
-progress_report(ClientData client_data, struct timeval *nowP)
+progress_report(ClientData client_data __attribute__ ((unused)), struct timeval *nowP __attribute__ ((unused)))
{
float elapsed;
@@ -2901,7 +2901,7 @@ progress_report(ClientData client_data, struct timeval *nowP)
static void
-start_timer(ClientData client_data, struct timeval *nowP)
+start_timer(ClientData client_data __attribute__ ((unused)), struct timeval *nowP __attribute__ ((unused)))
{
start_connection(nowP);
if (do_jitter)
@@ -2910,7 +2910,7 @@ start_timer(ClientData client_data, struct timeval *nowP)
static void
-end_timer(ClientData client_data, struct timeval *nowP)
+end_timer(ClientData client_data __attribute__ ((unused)), struct timeval *nowP __attribute__ ((unused)))
{
finish(nowP);
}