Updated Branches:
  refs/heads/master d736f384b -> 69cd3b946

TS-2549 printf() compiler warnings  on OSX (clang) with the CPP APIs


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

Branch: refs/heads/master
Commit: 69cd3b946261def625678399091721d5777b3611
Parents: d736f38
Author: Leif Hedstrom <[email protected]>
Authored: Mon Feb 3 13:02:12 2014 -0700
Committer: Leif Hedstrom <[email protected]>
Committed: Mon Feb 3 14:09:09 2014 -0700

----------------------------------------------------------------------
 CHANGES                                        |  2 ++
 lib/atscppapi/src/GzipDeflateTransformation.cc |  6 ++----
 lib/atscppapi/src/GzipInflateTransformation.cc |  3 ++-
 lib/atscppapi/src/TransformationPlugin.cc      | 13 +++++++------
 4 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/69cd3b94/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 261fd14..42af7d2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2549] printf() compiler warnings  on OSX (clang) with the CPP APIs.
+
   *) [TS-2532] Fix make distclean for C++ API examples.
 
   *) [TS-2306] Client connection hang while downloading big file from origin

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/69cd3b94/lib/atscppapi/src/GzipDeflateTransformation.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/GzipDeflateTransformation.cc 
b/lib/atscppapi/src/GzipDeflateTransformation.cc
index 40d0d94..ac8348c 100644
--- a/lib/atscppapi/src/GzipDeflateTransformation.cc
+++ b/lib/atscppapi/src/GzipDeflateTransformation.cc
@@ -23,6 +23,7 @@
 #include <cstring>
 #include <vector>
 #include <zlib.h>
+#include <inttypes.h>
 #include "atscppapi/TransformationPlugin.h"
 #include "atscppapi/GzipDeflateTransformation.h"
 #include "logging_internal.h"
@@ -148,9 +149,6 @@ void GzipDeflateTransformation::handleInputComplete() {
 
   int64_t bytes_written = setOutputComplete();
   if (state_->bytes_produced_ != bytes_written) {
-    LOG_ERROR("Gzip bytes produced sanity check failed, deflated bytes = %ld 
!= written bytes = %ld", state_->bytes_produced_, bytes_written);
+    LOG_ERROR("Gzip bytes produced sanity check failed, deflated bytes = %" 
PRId64 " != written bytes = %" PRId64, state_->bytes_produced_, bytes_written);
   }
 }
-
-
-

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/69cd3b94/lib/atscppapi/src/GzipInflateTransformation.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/GzipInflateTransformation.cc 
b/lib/atscppapi/src/GzipInflateTransformation.cc
index 1962e97..9561bfc 100644
--- a/lib/atscppapi/src/GzipInflateTransformation.cc
+++ b/lib/atscppapi/src/GzipInflateTransformation.cc
@@ -24,6 +24,7 @@
 #include <cstring>
 #include <vector>
 #include <zlib.h>
+#include <inttypes.h>
 #include "atscppapi/TransformationPlugin.h"
 #include "atscppapi/GzipInflateTransformation.h"
 #include "logging_internal.h"
@@ -122,7 +123,7 @@ void GzipInflateTransformation::consume(const string &data) 
{
 void GzipInflateTransformation::handleInputComplete() {
   int64_t bytes_written = setOutputComplete();
   if (state_->bytes_produced_ != bytes_written) {
-    LOG_ERROR("Gzip bytes produced sanity check failed, inflated bytes = %ld 
!= written bytes = %ld", state_->bytes_produced_, bytes_written);
+    LOG_ERROR("Gzip bytes produced sanity check failed, inflated bytes = %" 
PRId64 " != written bytes = %" PRId64, state_->bytes_produced_, bytes_written);
   }
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/69cd3b94/lib/atscppapi/src/TransformationPlugin.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/TransformationPlugin.cc 
b/lib/atscppapi/src/TransformationPlugin.cc
index 75a6706..f859bb3 100644
--- a/lib/atscppapi/src/TransformationPlugin.cc
+++ b/lib/atscppapi/src/TransformationPlugin.cc
@@ -24,6 +24,7 @@
 
 #include <ts/ts.h>
 #include <cstddef>
+#include <inttypes.h>
 #include "utils_internal.h"
 #include "logging_internal.h"
 #include "atscppapi/noncopyable.h"
@@ -91,7 +92,7 @@ int handleTransformationPluginRead(TSCont contp, 
TransformationPluginState *stat
   TSVIO write_vio = TSVConnWriteVIOGet(contp);
   if (write_vio) {
     int64_t to_read = TSVIONTodoGet(write_vio);
-    LOG_DEBUG("Transformation contp=%p write_vio=%p, to_read=%ld", contp, 
write_vio, to_read);
+    LOG_DEBUG("Transformation contp=%p write_vio=%p, to_read=%" PRId64, contp, 
write_vio, to_read);
 
     if (to_read > 0) {
       /*
@@ -99,11 +100,11 @@ int handleTransformationPluginRead(TSCont contp, 
TransformationPluginState *stat
        * the amount of data actually in the read buffer.
        **/
       int64_t avail = TSIOBufferReaderAvail(TSVIOReaderGet(write_vio));
-      LOG_DEBUG("Transformation contp=%p write_vio=%p, to_read=%ld, buffer 
reader avail=%ld", contp, write_vio, to_read, avail);
+      LOG_DEBUG("Transformation contp=%p write_vio=%p, to_read=%" PRId64 ", 
buffer reader avail=%" PRId64, contp, write_vio, to_read, avail);
 
       if (to_read > avail) {
         to_read = avail;
-        LOG_DEBUG("Transformation contp=%p write_vio=%p, to read > avail, 
fixing to_read to be equal to avail. to_read=%ld, buffer reader avail=%ld", 
contp, write_vio, to_read, avail);
+        LOG_DEBUG("Transformation contp=%p write_vio=%p, to read > avail, 
fixing to_read to be equal to avail. to_read=%" PRId64 ", buffer reader 
avail=%" PRId64, contp, write_vio, to_read, avail);
       }
 
       if (to_read > 0) {
@@ -261,11 +262,11 @@ size_t TransformationPlugin::produce(const std::string 
&data) {
   // Finally we can copy this data into the output_buffer
   int64_t bytes_written = TSIOBufferWrite(state_->output_buffer_, 
data.c_str(), write_length);
   state_->bytes_written_ += bytes_written; // So we can set BytesDone on 
outputComplete().
-  LOG_DEBUG("TransformationPlugin=%p tshttptxn=%p write to TSIOBuffer %ld 
bytes total bytes written %ld", this, state_->txn_, bytes_written, 
state_->bytes_written_);
+  LOG_DEBUG("TransformationPlugin=%p tshttptxn=%p write to TSIOBuffer %" 
PRId64 " bytes total bytes written %" PRId64, this, state_->txn_, 
bytes_written, state_->bytes_written_);
 
   // Sanity Checks
   if (bytes_written != write_length) {
-    LOG_ERROR("TransformationPlugin=%p tshttptxn=%p bytes written < expected. 
bytes_written=%ld write_length=%ld", this, state_->txn_, bytes_written, 
write_length);
+    LOG_ERROR("TransformationPlugin=%p tshttptxn=%p bytes written < expected. 
bytes_written=%" PRId64 " write_length=%" PRId64, this, state_->txn_, 
bytes_written, write_length);
   }
 
   int connection_closed = TSVConnClosedGet(state_->vconn_);
@@ -282,7 +283,7 @@ size_t TransformationPlugin::produce(const std::string 
&data) {
 
 size_t TransformationPlugin::setOutputComplete() {
   int connection_closed = TSVConnClosedGet(state_->vconn_);
-  LOG_DEBUG("OutputComplete TransformationPlugin=%p tshttptxn=%p vconn=%p 
connection_closed=%d, total bytes written=%ld", this, state_->txn_, 
state_->vconn_, connection_closed,state_->bytes_written_);
+  LOG_DEBUG("OutputComplete TransformationPlugin=%p tshttptxn=%p vconn=%p 
connection_closed=%d, total bytes written=%" PRId64, this, state_->txn_, 
state_->vconn_, connection_closed,state_->bytes_written_);
 
   if (!connection_closed && !state_->output_vio_) {
       LOG_DEBUG("TransformationPlugin=%p tshttptxn=%p output complete without 
writing any data, initiating write of 0 bytes.", this, state_->txn_);

Reply via email to