Updated Branches:
  refs/heads/master 69cd3b946 -> 3bf8e206b

TS-2532 Also make the examples compile cleanly


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3bf8e206
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3bf8e206
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3bf8e206

Branch: refs/heads/master
Commit: 3bf8e206badb0a78f4703ad841b882c474371805
Parents: 69cd3b9
Author: Leif Hedstrom <[email protected]>
Authored: Mon Feb 3 14:45:12 2014 -0700
Committer: Leif Hedstrom <[email protected]>
Committed: Mon Feb 3 14:45:12 2014 -0700

----------------------------------------------------------------------
 .gitignore                                                   | 1 +
 lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc    | 8 ++++----
 lib/atscppapi/examples/clientredirect/ClientRedirect.cc      | 2 +-
 lib/atscppapi/examples/clientrequest/ClientRequest.cc        | 3 +--
 lib/atscppapi/examples/customresponse/CustomResponse.cc      | 2 +-
 lib/atscppapi/examples/data_caching/data_caching.cc          | 2 +-
 lib/atscppapi/examples/globalhook/GlobalHookPlugin.cc        | 2 +-
 .../examples/gzip_transformation/GzipTransformationPlugin.cc | 2 +-
 lib/atscppapi/examples/helloworld/HelloWorldPlugin.cc        | 2 +-
 .../InternalTransactionHandling.cc                           | 4 ++--
 lib/atscppapi/examples/logger_example/LoggerExample.cc       | 2 +-
 .../MultipleTransactionHookPlugins.cc                        | 2 +-
 .../null_transformation_plugin/NullTransformationPlugin.cc   | 3 +--
 lib/atscppapi/examples/post_buffer/PostBuffer.cc             | 3 +--
 lib/atscppapi/examples/remap_plugin/RemapPlugin.cc           | 2 +-
 lib/atscppapi/examples/serverresponse/ServerResponse.cc      | 2 +-
 lib/atscppapi/examples/stat_example/StatExample.cc           | 6 ++++--
 .../examples/timeout_example/TimeoutExamplePlugin.cc         | 4 +---
 .../examples/transactionhook/TransactionHookPlugin.cc        | 2 +-
 19 files changed, 26 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 0a7e4c7..e9e0b21 100644
--- a/.gitignore
+++ b/.gitignore
@@ -111,6 +111,7 @@ example/app-template/records.config
 */.libs
 */*/.libs
 */*/*/.libs
+*/*/*/*/.libs
 
 .svn
 */.svn/

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/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 0e180a1..e156309 100644
--- a/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc
+++ b/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc
@@ -59,8 +59,8 @@ public:
     // we'll add some custom headers for this request
     AsyncHttpFetch2 *provider2 = new AsyncHttpFetch2("http://127.0.0.1/";);
     Headers &request_headers = provider2->getRequestHeaders();
-    request_headers.set("Header1", "Value1");
-    request_headers.set("Header2", "Value2");
+    request_headers["Header1"]  = "Value1";
+    request_headers["Header2"]  = "Value2";
     Async::execute<AsyncHttpFetch2>(this, provider2, getMutex());
     ++num_fetches_pending_;
   }
@@ -104,7 +104,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()));
@@ -137,6 +137,6 @@ 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();
+  new GlobalHookPlugin();
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/clientredirect/ClientRedirect.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/clientredirect/ClientRedirect.cc 
b/lib/atscppapi/examples/clientredirect/ClientRedirect.cc
index c49716f..7e6afab 100644
--- a/lib/atscppapi/examples/clientredirect/ClientRedirect.cc
+++ b/lib/atscppapi/examples/clientredirect/ClientRedirect.cc
@@ -72,5 +72,5 @@ public:
 };
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
-  GlobalPlugin *instance = new ClientRedirectGlobalPlugin();
+  new ClientRedirectGlobalPlugin();
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/clientrequest/ClientRequest.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/clientrequest/ClientRequest.cc 
b/lib/atscppapi/examples/clientrequest/ClientRequest.cc
index 3aa632a..3a2524c 100644
--- a/lib/atscppapi/examples/clientrequest/ClientRequest.cc
+++ b/lib/atscppapi/examples/clientrequest/ClientRequest.cc
@@ -42,7 +42,6 @@ public:
 
     ClientRequest &client_request = transaction.getClientRequest();
     Url &request_url = client_request.getUrl();
-    const Url &pristine_request_url = client_request.getPristineUrl();
 
     cout << "Method is " << HTTP_METHOD_STRINGS[client_request.getMethod()] << 
endl;
     cout << "Version is " << HTTP_VERSION_STRINGS[client_request.getVersion()] 
<< endl;
@@ -124,5 +123,5 @@ public:
 };
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
-  GlobalPlugin *instance = new GlobalHookPlugin();
+  new GlobalHookPlugin();
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/customresponse/CustomResponse.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/customresponse/CustomResponse.cc 
b/lib/atscppapi/examples/customresponse/CustomResponse.cc
index 7327081..fef1263 100644
--- a/lib/atscppapi/examples/customresponse/CustomResponse.cc
+++ b/lib/atscppapi/examples/customresponse/CustomResponse.cc
@@ -78,5 +78,5 @@ public:
 };
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
-  GlobalPlugin *instance = new ClientRedirectGlobalPlugin();
+  new ClientRedirectGlobalPlugin();
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/data_caching/data_caching.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/data_caching/data_caching.cc 
b/lib/atscppapi/examples/data_caching/data_caching.cc
index a4e6830..e5c701e 100644
--- a/lib/atscppapi/examples/data_caching/data_caching.cc
+++ b/lib/atscppapi/examples/data_caching/data_caching.cc
@@ -90,7 +90,7 @@ void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char 
*argv[] ATSCPPAPI_UNUSED
   int do_overwrite = 1;
   setenv(utils::DISABLE_DATA_CACHING_ENV_FLAG.c_str(), "true", do_overwrite);
 
-  GlobalPlugin *instance = new GlobalHookPlugin();
+  new GlobalHookPlugin();
 
   TSMutex nullMutex = NULL;
   TSCont globalCont = TSContCreate(handlePostRemap, nullMutex);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/globalhook/GlobalHookPlugin.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/globalhook/GlobalHookPlugin.cc 
b/lib/atscppapi/examples/globalhook/GlobalHookPlugin.cc
index f437ed8..7e47933 100644
--- a/lib/atscppapi/examples/globalhook/GlobalHookPlugin.cc
+++ b/lib/atscppapi/examples/globalhook/GlobalHookPlugin.cc
@@ -35,7 +35,7 @@ public:
 };
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
-  GlobalPlugin *instance = new GlobalHookPlugin();
+  new GlobalHookPlugin();
 }
 
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/gzip_transformation/GzipTransformationPlugin.cc
----------------------------------------------------------------------
diff --git 
a/lib/atscppapi/examples/gzip_transformation/GzipTransformationPlugin.cc 
b/lib/atscppapi/examples/gzip_transformation/GzipTransformationPlugin.cc
index ad50df2..caae81a 100644
--- a/lib/atscppapi/examples/gzip_transformation/GzipTransformationPlugin.cc
+++ b/lib/atscppapi/examples/gzip_transformation/GzipTransformationPlugin.cc
@@ -166,5 +166,5 @@ public:
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
   TS_DEBUG(TAG, "TSPluginInit");
-  GlobalPlugin *instance = new GlobalHookPlugin();
+  new GlobalHookPlugin();
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/helloworld/HelloWorldPlugin.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/helloworld/HelloWorldPlugin.cc 
b/lib/atscppapi/examples/helloworld/HelloWorldPlugin.cc
index f5045a9..8d32502 100644
--- a/lib/atscppapi/examples/helloworld/HelloWorldPlugin.cc
+++ b/lib/atscppapi/examples/helloworld/HelloWorldPlugin.cc
@@ -30,7 +30,7 @@ public:
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
   std::cout << "Hello from " << argv[0] << std::endl;
-  atscppapi::GlobalPlugin *instance = new HelloWorldPlugin();
+  new HelloWorldPlugin();
 }
 
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/internal_transaction_handling/InternalTransactionHandling.cc
----------------------------------------------------------------------
diff --git 
a/lib/atscppapi/examples/internal_transaction_handling/InternalTransactionHandling.cc
 
b/lib/atscppapi/examples/internal_transaction_handling/InternalTransactionHandling.cc
index 642102c..28c7770 100644
--- 
a/lib/atscppapi/examples/internal_transaction_handling/InternalTransactionHandling.cc
+++ 
b/lib/atscppapi/examples/internal_transaction_handling/InternalTransactionHandling.cc
@@ -60,6 +60,6 @@ public:
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
   TS_DEBUG(TAG, "Loaded async_http_fetch_example plugin");
-  AllTransactionsGlobalPlugin *instance1 = new AllTransactionsGlobalPlugin();
-  NoInternalTransactionsGlobalPlugin *instance2 = new 
NoInternalTransactionsGlobalPlugin();
+  new AllTransactionsGlobalPlugin();
+  new NoInternalTransactionsGlobalPlugin();
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/logger_example/LoggerExample.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/logger_example/LoggerExample.cc 
b/lib/atscppapi/examples/logger_example/LoggerExample.cc
index 3832e09..c6cf32c 100644
--- a/lib/atscppapi/examples/logger_example/LoggerExample.cc
+++ b/lib/atscppapi/examples/logger_example/LoggerExample.cc
@@ -127,6 +127,6 @@ void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char 
*argv[] ATSCPPAPI_UNUSED
   // once every second. You should really avoid flushing the log unless it's 
really necessary.
   log.flush();
 
-  GlobalPlugin *instance = new GlobalHookPlugin();
+  new GlobalHookPlugin();
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/multiple_transaction_hooks/MultipleTransactionHookPlugins.cc
----------------------------------------------------------------------
diff --git 
a/lib/atscppapi/examples/multiple_transaction_hooks/MultipleTransactionHookPlugins.cc
 
b/lib/atscppapi/examples/multiple_transaction_hooks/MultipleTransactionHookPlugins.cc
index a1c4240..ca1dbe7 100644
--- 
a/lib/atscppapi/examples/multiple_transaction_hooks/MultipleTransactionHookPlugins.cc
+++ 
b/lib/atscppapi/examples/multiple_transaction_hooks/MultipleTransactionHookPlugins.cc
@@ -96,5 +96,5 @@ public:
 };
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
-  atscppapi::GlobalPlugin *instance = new GlobalHookPlugin();
+  new GlobalHookPlugin();
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/null_transformation_plugin/NullTransformationPlugin.cc
----------------------------------------------------------------------
diff --git 
a/lib/atscppapi/examples/null_transformation_plugin/NullTransformationPlugin.cc 
b/lib/atscppapi/examples/null_transformation_plugin/NullTransformationPlugin.cc
index 4a305c3..0155d30 100644
--- 
a/lib/atscppapi/examples/null_transformation_plugin/NullTransformationPlugin.cc
+++ 
b/lib/atscppapi/examples/null_transformation_plugin/NullTransformationPlugin.cc
@@ -27,7 +27,6 @@ using namespace atscppapi;
 using std::string;
 
 namespace {
-atscppapi::Logger *log;
 #define TAG "null_transformation"
 }
 
@@ -73,5 +72,5 @@ public:
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
   TS_DEBUG(TAG, "TSPluginInit");
-  GlobalPlugin *instance = new GlobalHookPlugin();
+  new GlobalHookPlugin();
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/post_buffer/PostBuffer.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/post_buffer/PostBuffer.cc 
b/lib/atscppapi/examples/post_buffer/PostBuffer.cc
index 8fa51ca..5d0ea83 100644
--- a/lib/atscppapi/examples/post_buffer/PostBuffer.cc
+++ b/lib/atscppapi/examples/post_buffer/PostBuffer.cc
@@ -70,6 +70,5 @@ public:
 };
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
-  GlobalPlugin *instance = new GlobalHookPlugin();
+  new GlobalHookPlugin();
 }
-

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/remap_plugin/RemapPlugin.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/remap_plugin/RemapPlugin.cc 
b/lib/atscppapi/examples/remap_plugin/RemapPlugin.cc
index b158ac3..9f15209 100644
--- a/lib/atscppapi/examples/remap_plugin/RemapPlugin.cc
+++ b/lib/atscppapi/examples/remap_plugin/RemapPlugin.cc
@@ -82,6 +82,6 @@ public:
 };
 
 TsReturnCode TSRemapNewInstance(int argc ATSCPPAPI_UNUSED, char *argv[] 
ATSCPPAPI_UNUSED, void **instance_handle, char *errbuf ATSCPPAPI_UNUSED, int 
errbuf_size ATSCPPAPI_UNUSED) {
-  MyRemapPlugin *new_remap_plugin = new MyRemapPlugin(instance_handle);
+  new MyRemapPlugin(instance_handle);
   return TS_SUCCESS;
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/serverresponse/ServerResponse.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/serverresponse/ServerResponse.cc 
b/lib/atscppapi/examples/serverresponse/ServerResponse.cc
index 65561fc..01fb995 100644
--- a/lib/atscppapi/examples/serverresponse/ServerResponse.cc
+++ b/lib/atscppapi/examples/serverresponse/ServerResponse.cc
@@ -106,5 +106,5 @@ private:
 };
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
-  GlobalPlugin *instance = new ServerResponsePlugin();
+  new ServerResponsePlugin();
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/stat_example/StatExample.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/stat_example/StatExample.cc 
b/lib/atscppapi/examples/stat_example/StatExample.cc
index 1b3b562..1f4233e 100644
--- a/lib/atscppapi/examples/stat_example/StatExample.cc
+++ b/lib/atscppapi/examples/stat_example/StatExample.cc
@@ -23,6 +23,8 @@
 #include <atscppapi/PluginInit.h>
 #include <cstring>
 
+#include <inttypes.h>
+
 using namespace atscppapi;
 using std::string;
 
@@ -54,7 +56,7 @@ public:
   virtual void handleReadRequestHeadersPostRemap(Transaction &transaction) {
     TS_DEBUG(TAG, "Received a request, incrementing the counter.");
     stat.increment();
-    TS_DEBUG(TAG, "Stat '%s' value = %ld", STAT_NAME.c_str(), stat.get());
+    TS_DEBUG(TAG, "Stat '%s' value = %" PRId64, STAT_NAME.c_str(), stat.get());
     transaction.resume();
   }
 };
@@ -66,6 +68,6 @@ void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char 
*argv[] ATSCPPAPI_UNUSED
   stat.init(STAT_NAME, Stat::SYNC_COUNT, true);
   stat.set(0);
 
-  GlobalPlugin *instance = new GlobalHookPlugin();
+  new GlobalHookPlugin();
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/timeout_example/TimeoutExamplePlugin.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/timeout_example/TimeoutExamplePlugin.cc 
b/lib/atscppapi/examples/timeout_example/TimeoutExamplePlugin.cc
index 2cbfadb..b50bf5a 100644
--- a/lib/atscppapi/examples/timeout_example/TimeoutExamplePlugin.cc
+++ b/lib/atscppapi/examples/timeout_example/TimeoutExamplePlugin.cc
@@ -50,7 +50,5 @@ public:
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
   TS_DEBUG(TAG, "TSPluginInit");
-  GlobalPlugin *instance = new TimeoutExamplePlugin();
+  new TimeoutExamplePlugin();
 }
-
-

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bf8e206/lib/atscppapi/examples/transactionhook/TransactionHookPlugin.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/transactionhook/TransactionHookPlugin.cc 
b/lib/atscppapi/examples/transactionhook/TransactionHookPlugin.cc
index a514532..41d6eff 100644
--- a/lib/atscppapi/examples/transactionhook/TransactionHookPlugin.cc
+++ b/lib/atscppapi/examples/transactionhook/TransactionHookPlugin.cc
@@ -56,5 +56,5 @@ public:
 };
 
 void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED) {
-  atscppapi::GlobalPlugin *instance = new GlobalHookPlugin();
+  new GlobalHookPlugin();
 }

Reply via email to