Repository: trafficserver Updated Branches: refs/heads/master 4036ff958 -> 059fd11a4
Fix some clang compiler warnings Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/059fd11a Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/059fd11a Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/059fd11a Branch: refs/heads/master Commit: 059fd11a434b4cd051e26e05e3d1fa0b3733c00d Parents: 4036ff9 Author: Leif Hedstrom <[email protected]> Authored: Wed Mar 12 18:29:53 2014 -0600 Committer: Leif Hedstrom <[email protected]> Committed: Wed Mar 12 18:29:53 2014 -0600 ---------------------------------------------------------------------- cmd/traffic_top/traffic_top.cc | 2 +- iocore/net/UnixConnection.cc | 2 ++ .../examples/async_http_fetch/AsyncHttpFetch.cc | 6 ++++- proxy/http/HttpTunnel.cc | 1 - proxy/logging/LogFile.cc | 27 -------------------- 5 files changed, 8 insertions(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/059fd11a/cmd/traffic_top/traffic_top.cc ---------------------------------------------------------------------- diff --git a/cmd/traffic_top/traffic_top.cc b/cmd/traffic_top/traffic_top.cc index 4e4b66e..cbf8754 100644 --- a/cmd/traffic_top/traffic_top.cc +++ b/cmd/traffic_top/traffic_top.cc @@ -62,7 +62,7 @@ namespace colorPair { const short yellow = 2; const short green = 3; const short blue = 4; - const short black = 5; + // const short black = 5; const short grey = 6; const short cyan = 7; const short border = 8; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/059fd11a/iocore/net/UnixConnection.cc ---------------------------------------------------------------------- diff --git a/iocore/net/UnixConnection.cc b/iocore/net/UnixConnection.cc index 9a03c0e..ae1f5e7 100644 --- a/iocore/net/UnixConnection.cc +++ b/iocore/net/UnixConnection.cc @@ -36,9 +36,11 @@ #define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y)) +#if TS_USE_TPROXY #if !defined(IP_TRANSPARENT) unsigned int const IP_TRANSPARENT = 19; #endif +#endif // // Functions http://git-wip-us.apache.org/repos/asf/trafficserver/blob/059fd11a/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc ---------------------------------------------------------------------- diff --git a/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc b/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc index c296dfe..6b7533c 100644 --- a/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc +++ b/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc @@ -56,6 +56,8 @@ public: Async::execute<AsyncHttpFetch>(this, new AsyncHttpFetch("http://127.0.0.1/"), getMutex()); ++num_fetches_pending_; AsyncHttpFetch *post_request = new AsyncHttpFetch("http://127.0.0.1/post", "data"); + + (void)post_request; Async::execute<AsyncHttpFetch>(this, new AsyncHttpFetch("http://127.0.0.1/post", "data"), getMutex()); @@ -110,7 +112,7 @@ private: const void *body; size_t body_size; async_http_fetch.getResponseBody(body, body_size); - TS_DEBUG(TAG, "Response body is [%.*s]", body_size, body); + TS_DEBUG(TAG, "Response body is [%.*s]", static_cast<int>(body_size), body); } else { TS_ERROR(TAG, "Fetch did not complete successfully; Result %d", static_cast<int>(async_http_fetch.getResult())); @@ -144,5 +146,7 @@ public: void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] ATSCPPAPI_UNUSED) { TS_DEBUG(TAG, "Loaded async_http_fetch_example plugin"); GlobalPlugin *instance = new GlobalHookPlugin(); + + (void)instance; } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/059fd11a/proxy/http/HttpTunnel.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc index a22b1c1..d3b41cd 100644 --- a/proxy/http/HttpTunnel.cc +++ b/proxy/http/HttpTunnel.cc @@ -37,7 +37,6 @@ #include "HttpDebugNames.h" #include "ParseRules.h" -static const int max_chunked_ahead_blocks = 128; static const int min_block_transfer_bytes = 256; static char const * const CHUNK_HEADER_FMT = "%" PRIx64"\r\n"; // This should be as small as possible because it will only hold the http://git-wip-us.apache.org/repos/asf/trafficserver/blob/059fd11a/proxy/logging/LogFile.cc ---------------------------------------------------------------------- diff --git a/proxy/logging/LogFile.cc b/proxy/logging/LogFile.cc index a276794..aed130f 100644 --- a/proxy/logging/LogFile.cc +++ b/proxy/logging/LogFile.cc @@ -51,33 +51,6 @@ #include "LogConfig.h" #include "Log.h" -// the FILESIZE_SAFE_THRESHOLD_FACTOR is used to compute the file size -// limit as follows: -// -// size_limit = system_filesize_limit - -// FILESIZE_SAFE_THRESHOLD_FACTOR * log_buffer_size -// -// where system_filesize_limit is the current filesize limit as returned by -// getrlimit(), and log_buffer_size is the config. value for the size of -// a LogBuffer. -// -// This means that a file reaches its size_limit once it has no room to fit -// FILESIZE_SAFE_THRESHOLD_FACTOR LogBuffers. -// -// A LogBuffer, when converted to ascii, can produce more than -// log_buffer_size bytes, depending on the type of the logging fields it -// stores. String fields don't change size, but integer fields do. -// A 32 bit integer has a maximum value of 10 digits, which means it -// can grow by a factor of 10/4 = 2.5 when translated to ascii. -// Assuming all fields in a LogBuffer are (32 bit) integers, the maximum -// amount of ascii data a LogBuffer can produce is 2.5 times its size, so -// we should make sure we can always write this amount to a file. -// -// However, to be extra safe, we should set the -// FILESIZE_SAFE_THRESHOLD_FACTOR higher than 3 -// -static const int FILESIZE_SAFE_THRESHOLD_FACTOR = 10; - /*------------------------------------------------------------------------- LogFile::LogFile
