trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [2/2] TS-1084: Add format string checking
Date Wed, 01 Feb 2012 04:32:22 GMT
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/PluginVC.cc
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index bcfa33f..2907fd0 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -240,7 +240,7 @@ PluginVC::do_io_read(Continuation * c, int64_t nbytes, MIOBuffer * buf)
   read_state.vio.vc_server = (VConnection *) this;
   read_state.vio.op = VIO::READ;
 
-  Debug("pvc", "[%u] %s: do_io_read for %d bytes", PVC_ID, PVC_TYPE, nbytes);
+  Debug("pvc", "[%u] %s: do_io_read for %"PRId64" bytes", PVC_ID, PVC_TYPE, nbytes);
 
   // Since reentrant callbacks are not allowed on from do_io
   //   functions schedule ourselves get on a different stack
@@ -273,7 +273,7 @@ PluginVC::do_io_write(Continuation * c, int64_t nbytes, IOBufferReader * abuffer
   write_state.vio.vc_server = (VConnection *) this;
   write_state.vio.op = VIO::WRITE;
 
-  Debug("pvc", "[%u] %s: do_io_write for %d bytes", PVC_ID, PVC_TYPE, nbytes);
+  Debug("pvc", "[%u] %s: do_io_write for %"PRId64" bytes", PVC_ID, PVC_TYPE, nbytes);
 
   // Since reentrant callbacks are not allowed on from do_io
   //   functions schedule ourselves get on a different stack
@@ -504,7 +504,7 @@ PluginVC::process_write_side(bool other_side_call)
   int64_t bytes_avail = reader->read_avail();
   int64_t act_on = MIN(bytes_avail, ntodo);
 
-  Debug("pvc", "[%u] %s: process_write_side; act_on %d", PVC_ID, PVC_TYPE, act_on);
+  Debug("pvc", "[%u] %s: process_write_side; act_on %"PRId64"", PVC_ID, PVC_TYPE, act_on);
 
   if (other_side->closed || other_side->read_state.shutdown) {
     write_state.vio._cont->handleEvent(VC_EVENT_ERROR, &write_state.vio);
@@ -540,7 +540,7 @@ PluginVC::process_write_side(bool other_side_call)
 
   write_state.vio.ndone += added;
 
-  Debug("pvc", "[%u] %s: process_write_side; added %d", PVC_ID, PVC_TYPE, added);
+  Debug("pvc", "[%u] %s: process_write_side; added %"PRId64"", PVC_ID, PVC_TYPE, added);
 
   if (write_state.vio.ntodo() == 0) {
     write_state.vio._cont->handleEvent(VC_EVENT_WRITE_COMPLETE, &write_state.vio);
@@ -619,7 +619,7 @@ PluginVC::process_read_side(bool other_side_call)
   int64_t bytes_avail = core_reader->read_avail();
   int64_t act_on = MIN(bytes_avail, ntodo);
 
-  Debug("pvc", "[%u] %s: process_read_side; act_on %d", PVC_ID, PVC_TYPE, act_on);
+  Debug("pvc", "[%u] %s: process_read_side; act_on %"PRId64"", PVC_ID, PVC_TYPE, act_on);
 
   if (act_on <= 0) {
     if (other_side->closed || other_side->write_state.shutdown) {
@@ -652,7 +652,7 @@ PluginVC::process_read_side(bool other_side_call)
 
   read_state.vio.ndone += added;
 
-  Debug("pvc", "[%u] %s: process_read_side; added %d", PVC_ID, PVC_TYPE, added);
+  Debug("pvc", "[%u] %s: process_read_side; added %"PRId64"", PVC_ID, PVC_TYPE, added);
 
   if (read_state.vio.ntodo() == 0) {
     read_state.vio._cont->handleEvent(VC_EVENT_READ_COMPLETE, &read_state.vio);
@@ -993,14 +993,14 @@ PluginVCCore::init()
   a_to_p_buffer = new_MIOBuffer(BUFFER_SIZE_INDEX_32K);
   a_to_p_reader = a_to_p_buffer->alloc_reader();
 
-  Debug("pvc", "[%u] Created PluginVCCore at 0x%X, active 0x%X, passive 0x%X", id, this, &active_vc, &passive_vc);
+  Debug("pvc", "[%u] Created PluginVCCore at %p, active %p, passive %p", id, this, &active_vc, &passive_vc);
 }
 
 void
 PluginVCCore::destroy()
 {
 
-  Debug("pvc", "[%u] Destroying PluginVCCore at 0x%X", id, this);
+  Debug("pvc", "[%u] Destroying PluginVCCore at %p", id, this);
 
   ink_assert(active_vc.closed == true || !connected);
   active_vc.mutex = NULL;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/Prefetch.cc
----------------------------------------------------------------------
diff --git a/proxy/Prefetch.cc b/proxy/Prefetch.cc
index 83584b0..7326496 100644
--- a/proxy/Prefetch.cc
+++ b/proxy/Prefetch.cc
@@ -366,7 +366,7 @@ PrefetchTransform::handle_event(int event, void *edata)
 
   if (m_closed) {
     if (m_deletable) {
-      Debug("PrefetchParser", "PrefetchTransform free(): %d", m_output_vio ? m_output_vio->ndone : 0);
+      Debug("PrefetchParser", "PrefetchTransform free(): %"PRId64"", m_output_vio ? m_output_vio->ndone : 0);
       if (m_output_buf) {
         free_MIOBuffer(m_output_buf);
         m_output_buf = 0;
@@ -430,7 +430,7 @@ PrefetchTransform::handle_event(int event, void *edata)
           }
 
           if (towrite > 0) {
-            Debug("PrefetchParser", "handle_event() " "writing %d bytes to output", towrite);
+            Debug("PrefetchParser", "handle_event() " "writing %"PRId64" bytes to output", towrite);
 
             //Debug("PrefetchParser", "Read avail before = %d\n", avail);
 
@@ -1576,7 +1576,7 @@ PrefetchBlaster::bufferObject(int event, void *data)
   case VC_EVENT_READ_READY:
     if (buf->high_water()) {
       //right now we don't handle DEL events on the child
-      Debug("PrefetchBlasterTemp", "The object is bigger than %d bytes " "cancelling the url", buf->water_mark);
+      Debug("PrefetchBlasterTemp", "The object is bigger than %"PRId64" bytes " "cancelling the url", buf->water_mark);
       buf->reset();
       buf->fill(PRELOAD_HEADER_LEN);
       buf->write("DEL ", 4);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/ProxyConfig.h
----------------------------------------------------------------------
diff --git a/proxy/ProxyConfig.h b/proxy/ProxyConfig.h
index 40952a9..550ccae 100644
--- a/proxy/ProxyConfig.h
+++ b/proxy/ProxyConfig.h
@@ -45,7 +45,7 @@ void *config_string_alloc_cb(void *data, void *value);
 // Macros that spin waiting for the data to be bound
 //
 #define SignalManager(_n,_d) pmgmt->signalManager(_n,(char*)_d)
-#define SignalWarning(_n,_s) { Warning(_s); SignalManager(_n,_s); }
+#define SignalWarning(_n,_s) { Warning("%s", _s); SignalManager(_n,_s); }
 
 #define RegisterMgmtCallback(_signal,_fn,_data) \
 pmgmt->registerMgmtCallback(_signal,_fn,_data)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/ReverseProxy.cc
----------------------------------------------------------------------
diff --git a/proxy/ReverseProxy.cc b/proxy/ReverseProxy.cc
index bcf2e65..15c83a3 100644
--- a/proxy/ReverseProxy.cc
+++ b/proxy/ReverseProxy.cc
@@ -196,8 +196,8 @@ reloadUrlRewrite()
   } else {
     static const char* msg = "failed to reload remap.config, not replacing!";
     delete newTable;
-    Debug("url_rewrite", msg);
-    Warning(msg);
+    Debug("url_rewrite", "%s", msg);
+    Warning("%s", msg);
   }
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/StatSystem.cc
----------------------------------------------------------------------
diff --git a/proxy/StatSystem.cc b/proxy/StatSystem.cc
index e0a87b3..fd46917 100644
--- a/proxy/StatSystem.cc
+++ b/proxy/StatSystem.cc
@@ -362,7 +362,7 @@ take_rusage_snap()
       rusage_snap_time = ink_get_hrtime();
     break;
   }
-  Debug("rusage", "took rusage snap %d", rusage_snap_time);
+  Debug("rusage", "took rusage snap %"PRId64"", rusage_snap_time);
 }
 
 struct SnapCont;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/Transform.cc
----------------------------------------------------------------------
diff --git a/proxy/Transform.cc b/proxy/Transform.cc
index a026cd8..411d909 100644
--- a/proxy/Transform.cc
+++ b/proxy/Transform.cc
@@ -623,7 +623,7 @@ NullTransform::handle_event(int event, void *edata)
 
   if (m_closed) {
     if (m_deletable) {
-      Debug("transform", "NullTransform destroy: %d [0x%lx]", m_output_vio ? m_output_vio->ndone : 0, (long) this);
+      Debug("transform", "NullTransform destroy: %"PRId64" [%p]", m_output_vio ? m_output_vio->ndone : 0, this);
       delete this;
     }
   } else {
@@ -679,7 +679,7 @@ NullTransform::handle_event(int event, void *edata)
           }
 
           if (towrite > 0) {
-            Debug("transform", "[NullTransform::handle_event] " "writing %d bytes to output", towrite);
+            Debug("transform", "[NullTransform::handle_event] " "writing %"PRId64" bytes to output", towrite);
             m_output_buf->write(m_write_vio.get_reader(), towrite);
 
             m_write_vio.get_reader()->consume(towrite);
@@ -923,7 +923,7 @@ RangeTransform::handle_event(int event, void *edata)
 
   if (m_closed) {
     if (m_deletable) {
-      Debug("transform_range", "RangeTransform destroy: %d", m_output_vio ? m_output_vio->ndone : 0);
+      Debug("transform_range", "RangeTransform destroy: %"PRId64"", m_output_vio ? m_output_vio->ndone : 0);
       delete this;
     }
   } else {
@@ -1035,7 +1035,7 @@ RangeTransform::transform_to_range()
           add_boundary(true);
         }
 
-        Debug("transform_range", "total bytes of Range response body is %d", m_done);
+        Debug("transform_range", "total bytes of Range response body is %"PRId64"", m_done);
         m_output_vio->nbytes = m_done;
         m_output_vio->reenable();
 
@@ -1212,7 +1212,7 @@ RangeTransform::calculate_output_cl()
     m_output_cl += boundary_size + 2;
   }
 
-  Debug("transform_range", "Pre-calculated Content-Length for Range response is %d", m_output_cl);
+  Debug("transform_range", "Pre-calculated Content-Length for Range response is %"PRId64"", m_output_cl);
 }
 
 #endif // TS_NO_TRANSFORM

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/Update.cc
----------------------------------------------------------------------
diff --git a/proxy/Update.cc b/proxy/Update.cc
index 390a47e..0be5d0d 100644
--- a/proxy/Update.cc
+++ b/proxy/Update.cc
@@ -769,8 +769,8 @@ UpdateConfigManager::init()
   UPDATE_CLEAR_DYN_STAT(update_state_machines_stat);
 
   Debug("update",
-        "Update params: enable %d force %d rcnt %d rint %d updates %d "
-        "max_sm %d mem %d",
+        "Update params: enable %"PRId64" force %"PRId64" rcnt %"PRId64" rint %"PRId64" updates %"PRId64" "
+        "max_sm %"PRId64" mem %"PRId64"",
         _CP_actual->_enabled, _CP_actual->_immediate_update,
         _CP_actual->_retry_count, _CP_actual->_retry_interval,
         _CP_actual->_concurrent_updates, _CP_actual->_max_update_state_machines, _CP_actual->_memory_use_in_mb);
@@ -862,7 +862,7 @@ UpdateConfigManager::ProcessUpdate(int event, Event * e)
 
     if (!(*_CP == *p)) {
       _CP = p;
-      Debug("update", "enable %d force %d rcnt %d rint %d updates %d mem %d",
+      Debug("update", "enable %"PRId64" force %"PRId64" rcnt %"PRId64" rint %"PRId64" updates %"PRId64" state machines %"PRId64" mem %"PRId64"",
             p->_enabled, p->_immediate_update, p->_retry_count,
             p->_retry_interval, p->_concurrent_updates, p->_max_update_state_machines, p->_memory_use_in_mb);
     } else {
@@ -872,7 +872,7 @@ UpdateConfigManager::ProcessUpdate(int event, Event * e)
   }
   // Unknown event, ignore it.
 
-  Debug("update", "ProcessUpdate: Unknown event %d 0x%x", event, e);
+  Debug("update", "ProcessUpdate: Unknown event %d %p", event, e);
   return EVENT_DONE;
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/api/ts/ts.h.in
----------------------------------------------------------------------
diff --git a/proxy/api/ts/ts.h.in b/proxy/api/ts/ts.h.in
index 43c9404..8af9dce 100644
--- a/proxy/api/ts/ts.h.in
+++ b/proxy/api/ts/ts.h.in
@@ -43,6 +43,14 @@
 
 #define tsapi
 
+#if !defined(TS_PRINTFLIKE)
+#if defined(__GNUC__) || defined(__clang__)
+#define TS_PRINTFLIKE(fmt, arg) __attribute__((format(printf, fmt, arg)))
+#else
+#define TS_PRINTFLIKE(fmt, arg)
+#endif
+#endif
+
 #ifdef __cplusplus
 extern "C"
 {
@@ -1189,7 +1197,7 @@ extern "C"
       @param ... argument for the printf format description.
 
   */
-  tsapi void TSError(const char* fmt, ...);
+  tsapi void TSError(const char* fmt, ...) TS_PRINTFLIKE(1, 2);
 
   /* --------------------------------------------------------------------------
      Assertions */
@@ -2806,7 +2814,7 @@ extern "C"
      tracing api */
 
   tsapi int TSIsDebugTagSet(const char* t);
-  tsapi void TSDebug(const char* tag, const char* format_str, ...);
+  tsapi void TSDebug(const char* tag, const char* format_str, ...) TS_PRINTFLIKE(2, 3);
   extern int diags_on_for_plugins;
 #define TSDEBUG if (diags_on_for_plugins) TSDebug
 
@@ -2909,7 +2917,7 @@ extern "C"
           log write buffer). This error is very unusual.
 
    */
-  tsapi TSReturnCode TSTextLogObjectWrite(TSTextLogObject the_object, char* format, ...);
+  tsapi TSReturnCode TSTextLogObjectWrite(TSTextLogObject the_object, char* format, ...) TS_PRINTFLIKE(2, 3);
 
   /**
       This immediately flushes the contents of the log write buffer for

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/congest/Congestion.cc
----------------------------------------------------------------------
diff --git a/proxy/congest/Congestion.cc b/proxy/congest/Congestion.cc
index 894dd3f..95f7567 100644
--- a/proxy/congest/Congestion.cc
+++ b/proxy/congest/Congestion.cc
@@ -275,7 +275,7 @@ CongestionControlRecord::UpdateMatch(CongestionControlRule * pRule, RD * rdata)
       }
     }
     pRule->record = this;
-    Debug("congestion_config", "Matched with record 0x%x at line %d", this, line_num);
+    Debug("congestion_config", "Matched with record %p at line %d", this, line_num);
   }
 }
 
@@ -764,7 +764,7 @@ CongestionEntry::failed_at(ink_hrtime t)
     return;
   // long time = ink_hrtime_to_sec(t);
   long time = t;
-  Debug("congestion_control", "failed_at: %d", time);
+  Debug("congestion_control", "failed_at: %ld", time);
   MUTEX_TRY_LOCK(lock, m_hist_lock, this_ethread());
   if (lock) {
     m_history.regist_event(time);
@@ -777,7 +777,7 @@ CongestionEntry::failed_at(ink_hrtime t)
       }
     }
   } else {
-    Debug("congestion_control", "failure info lost due to lock contention(Entry: 0x%x, Time: %d)", (void *) this, time);
+    Debug("congestion_control", "failure info lost due to lock contention(Entry: %p, Time: %ld)", (void *) this, time);
   }
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/congest/CongestionDB.cc
----------------------------------------------------------------------
diff --git a/proxy/congest/CongestionDB.cc b/proxy/congest/CongestionDB.cc
index e292676..6486fca 100644
--- a/proxy/congest/CongestionDB.cc
+++ b/proxy/congest/CongestionDB.cc
@@ -402,7 +402,7 @@ CongestionDBCont::get_congest_entry(int event, Event * e)
   NOWARN_UNUSED(e);
 
   if (m_action.cancelled) {
-    Debug("congestion_cont", "action cancelled for 0x%x", this);
+    Debug("congestion_cont", "action cancelled for %p", this);
     Free_CongestionDBCont(this);
     Debug("congestion_control", "cont::get_congest_entry state machine cancelld");
     return EVENT_DONE;
@@ -498,14 +498,14 @@ get_congest_entry(Continuation * cont, HttpRequestData * data, CongestionEntry *
     *ppEntry = theCongestionDB->lookup_entry(key);
     if (*ppEntry != NULL) {
       (*ppEntry)->get();
-      Debug("congestion_control", "get_congest_entry, found entry 0x%x done", (void *) *ppEntry);
+      Debug("congestion_control", "get_congest_entry, found entry %p done", (void *) *ppEntry);
       return ACTION_RESULT_DONE;
     } else {
       // create a new entry and add it to the congestDB
       *ppEntry = new CongestionEntry(data->get_host(), data->get_ip(), p, key);
       (*ppEntry)->get();
       theCongestionDB->insert_entry(key, *ppEntry);
-      Debug("congestion_control", "get_congest_entry, new entry 0x%x done", (void *) *ppEntry);
+      Debug("congestion_control", "get_congest_entry, new entry %p done", (void *) *ppEntry);
       return ACTION_RESULT_DONE;
     }
   } else {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/hdrs/HTTP.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/HTTP.cc b/proxy/hdrs/HTTP.cc
index eae5a91..2c001be 100644
--- a/proxy/hdrs/HTTP.cc
+++ b/proxy/hdrs/HTTP.cc
@@ -564,7 +564,7 @@ http_hdr_describe(HdrHeapObjImpl *raw, bool recurse)
   HTTPHdrImpl *obj = (HTTPHdrImpl *) raw;
 
   if (obj->m_polarity == HTTP_TYPE_REQUEST) {
-    Debug("http", "[TYPE: REQ, V: %04X, URL: 0x%04X, METHOD: \"%.*s\", METHOD_LEN: %d, FIELDS: 0x%04X]\n",
+    Debug("http", "[TYPE: REQ, V: %04X, URL: %p, METHOD: \"%.*s\", METHOD_LEN: %d, FIELDS: %p]\n",
           obj->m_version, obj->u.req.m_url_impl,
           obj->u.req.m_len_method, (obj->u.req.m_ptr_method ? obj->u.req.m_ptr_method : "NULL"),
           obj->u.req.m_len_method, obj->m_fields_impl);
@@ -575,7 +575,7 @@ http_hdr_describe(HdrHeapObjImpl *raw, bool recurse)
         obj_describe(obj->m_fields_impl, recurse);
     }
   } else {
-    Debug("http", "[TYPE: RSP, V: %04X, STATUS: %d, REASON: \"%.*s\", REASON_LEN: %d, FIELDS: 0x%04X]\n",
+    Debug("http", "[TYPE: RSP, V: %04X, STATUS: %d, REASON: \"%.*s\", REASON_LEN: %d, FIELDS: %p]\n",
           obj->m_version, obj->u.resp.m_status,
           obj->u.resp.m_len_reason, (obj->u.resp.m_ptr_reason ? obj->u.resp.m_ptr_reason : "NULL"),
           obj->u.resp.m_len_reason, obj->m_fields_impl);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/hdrs/HdrHeap.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/HdrHeap.cc b/proxy/hdrs/HdrHeap.cc
index 1d980f6..1f98344 100644
--- a/proxy/hdrs/HdrHeap.cc
+++ b/proxy/hdrs/HdrHeap.cc
@@ -55,7 +55,7 @@ obj_describe(HdrHeapObjImpl * obj, bool recurse)
 {
   static const char *obj_names[] = { "EMPTY", "RAW", "URL", "HTTP_HEADER", "MIME_HEADER", "FIELD_BLOCK" };
 
-  Debug("http", "%s 0x%X: [T: %d, L: %4d, OBJFLAGS: %X]  ",
+  Debug("http", "%s %p: [T: %d, L: %4d, OBJFLAGS: %X]  ",
         obj_names[obj->m_type], obj, obj->m_type, obj->m_length, obj->m_obj_flags);
 
   extern void url_describe(HdrHeapObjImpl * obj, bool recurse);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/hdrs/MIME.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/MIME.cc b/proxy/hdrs/MIME.cc
index d1f2b3d..e2e3cbb 100644
--- a/proxy/hdrs/MIME.cc
+++ b/proxy/hdrs/MIME.cc
@@ -2448,7 +2448,7 @@ mime_hdr_describe(HdrHeapObjImpl *raw, bool recurse)
   MIMEFieldBlockImpl *fblock;
   MIMEHdrImpl *obj = (MIMEHdrImpl *) raw;
 
-  Debug("http", "\n\t[PBITS: 0x%08X%08X, SLACC: 0x%04X%04X%04X%04X, HEADBLK: 0x%X, TAILBLK: 0x%X]\n",
+  Debug("http", "\n\t[PBITS: 0x%08X%08X, SLACC: 0x%04X%04X%04X%04X, HEADBLK: %p, TAILBLK: %p]\n",
         (uint32_t) ((obj->m_presence_bits >> 32) & (TOK_64_CONST(0xFFFFFFFF))),
         (uint32_t) ((obj->m_presence_bits >> 0) & (TOK_64_CONST(0xFFFFFFFF))),
         obj->m_slot_accelerators[0], obj->m_slot_accelerators[1],
@@ -2475,11 +2475,11 @@ mime_field_block_describe(HdrHeapObjImpl *raw, bool recurse)
 
   MIMEFieldBlockImpl *obj = (MIMEFieldBlockImpl *) raw;
 
-  Debug("http", "[FREETOP: %d, NEXTBLK: 0x%X]\n", obj->m_freetop, obj->m_next);
+  Debug("http", "[FREETOP: %d, NEXTBLK: %p]\n", obj->m_freetop, obj->m_next);
 
   for (i = 0; i < obj->m_freetop; i++) {
     MIMEField *f = &(obj->m_field_slots[i]);
-    Debug("http", "\tSLOT #%2d (0x%X), %-8s", i, f, readiness_names[f->m_readiness]);
+    Debug("http", "\tSLOT #%2d (%p), %-8s", i, f, readiness_names[f->m_readiness]);
 
     switch (f->m_readiness) {
     case MIME_FIELD_SLOT_READINESS_EMPTY:
@@ -2491,7 +2491,7 @@ mime_field_block_describe(HdrHeapObjImpl *raw, bool recurse)
             f->m_len_name, (f->m_ptr_name ? f->m_ptr_name : "NULL"), f->m_len_name, f->m_wks_idx);
       Debug("http", "V: \"%.*s\", V_LEN: %d, ",
             f->m_len_value, (f->m_ptr_value ? f->m_ptr_value : "NULL"), f->m_len_value);
-      Debug("http", "NEXTDUP: 0x%X, RAW: %d, RAWLEN: %d, F: %d]",
+      Debug("http", "NEXTDUP: %p, RAW: %d, RAWLEN: %d, F: %d]",
             f->m_next_dup, f->m_n_v_raw_printable,
             f->m_len_name + f->m_len_value + f->m_n_v_raw_printable_pad, f->m_flags);
       break;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/http/HttpAccept.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpAccept.cc b/proxy/http/HttpAccept.cc
index 0e4057d..a307cf2 100644
--- a/proxy/http/HttpAccept.cc
+++ b/proxy/http/HttpAccept.cc
@@ -54,7 +54,7 @@ HttpAccept::mainEvent(int event, void *data)
     netvc->attributes = transport_type;
 
     if (is_debug_tag_set("http_seq"))
-      Debug("http_seq", "[HttpAccept:mainEvent %lx] accepted connection from %s transport type = %d.\n", netvc, ink_inet_nptop(client_ip, ipb, sizeof(ipb)), netvc->attributes);
+      Debug("http_seq", "[HttpAccept:mainEvent %p] accepted connection from %s transport type = %d", netvc, ink_inet_nptop(client_ip, ipb, sizeof(ipb)), netvc->attributes);
 
     HttpClientSession *new_session = THREAD_ALLOC_INIT(httpClientSessionAllocator, netvc->thread);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/http/HttpBodyFactory.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpBodyFactory.cc b/proxy/http/HttpBodyFactory.cc
index 5dc500e..79a23cb 100644
--- a/proxy/http/HttpBodyFactory.cc
+++ b/proxy/http/HttpBodyFactory.cc
@@ -296,17 +296,17 @@ HttpBodyFactory::reconfigure()
   rec_err = RecGetRecordInt("proxy.config.body_factory.enable_customizations", &e);
   enable_customizations = ((rec_err == REC_ERR_OKAY) ? e : 0);
   all_found = all_found && (rec_err == REC_ERR_OKAY);
-  Debug("body_factory", "enable_customizations = %d (found = %d)", enable_customizations, e);
+  Debug("body_factory", "enable_customizations = %d (found = %"PRId64")", enable_customizations, e);
 
   rec_err = RecGetRecordInt("proxy.config.body_factory.enable_logging", &e);
   enable_logging = ((rec_err == REC_ERR_OKAY) ? (e ? true : false) : false);
   all_found = all_found && (rec_err == REC_ERR_OKAY);
-  Debug("body_factory", "enable_logging = %d (found = %d)", enable_logging, e);
+  Debug("body_factory", "enable_logging = %d (found = %"PRId64")", enable_logging, e);
 
   rec_err = RecGetRecordInt("proxy.config.body_factory.response_suppression_mode", &e);
   response_suppression_mode = ((rec_err == REC_ERR_OKAY) ? e : 0);
   all_found = all_found && (rec_err == REC_ERR_OKAY);
-  Debug("body_factory", "response_suppression_mode = %d (found = %d)", response_suppression_mode, e);
+  Debug("body_factory", "response_suppression_mode = %d (found = %"PRId64")", response_suppression_mode, e);
 
   rec_err = RecGetRecordString_Xmalloc("proxy.config.body_factory.template_sets_dir", &s);
   all_found = all_found && (rec_err == REC_ERR_OKAY);
@@ -324,7 +324,7 @@ HttpBodyFactory::reconfigure()
     }
   }
 
-  Debug("body_factory", "directory_of_template_sets = '%s' (found = %d)", directory_of_template_sets, e);
+  Debug("body_factory", "directory_of_template_sets = '%s' (found = %"PRId64")", directory_of_template_sets, e);
 
   if (!all_found) {
     Warning("config changed, but can't fetch all proxy.config.body_factory values");
@@ -504,7 +504,7 @@ HttpBodyFactory::find_template(const char *set, const char *type, HttpBodySet **
         return (NULL);
       *body_set_return = body_set;
 
-      Debug("body_factory", "find_template(%s,%s) -> (file %s, length %d, lang '%s', charset '%s')",
+      Debug("body_factory", "find_template(%s,%s) -> (file %s, length %"PRId64", lang '%s', charset '%s')",
             set, type, t->template_pathname, t->byte_count, body_set->content_language, body_set->content_charset);
 
       return (t);
@@ -659,7 +659,7 @@ HttpBodyFactory::load_sets_from_directory(char *set_dir)
 
     HttpBodySet *body_set = load_body_set_from_directory(entry_buffer->d_name, subdir);
     if (body_set != NULL) {
-      Debug("body_factory", "  %s -> 0x%0X", entry_buffer->d_name, body_set);
+      Debug("body_factory", "  %s -> %p", entry_buffer->d_name, body_set);
       new_table_of_sets->setValue((RawHashTable_Key) (entry_buffer->d_name), (RawHashTable_Value) body_set);
     }
   }
@@ -709,7 +709,7 @@ HttpBodyFactory::load_body_set_from_directory(char *set_name, char *tmpl_dir)
   HttpBodySet *body_set = NEW(new HttpBodySet);
   body_set->init(set_name, tmpl_dir);
 
-  Debug("body_factory", "  body_set = 0x%0X (set_name '%s', lang '%s', charset '%s')",
+  Debug("body_factory", "  body_set = %p (set_name '%s', lang '%s', charset '%s')",
         body_set, body_set->set_name, body_set->content_language, body_set->content_charset);
   entry_buffer = (struct dirent *)ats_malloc(sizeof(struct dirent) + MAXPATHLEN + 1);
 
@@ -737,7 +737,7 @@ HttpBodyFactory::load_body_set_from_directory(char *set_name, char *tmpl_dir)
     if (!tmpl->load_from_file(tmpl_dir, entry_buffer->d_name)) {
       delete tmpl;
     } else {
-      Debug("body_factory", "      %s -> 0x%0X", entry_buffer->d_name, tmpl);
+      Debug("body_factory", "      %s -> %p", entry_buffer->d_name, tmpl);
       body_set->set_template_by_name(entry_buffer->d_name, tmpl);
     }
   }
@@ -835,7 +835,7 @@ HttpBodySet::init(char *set, char *dir)
     while (*value_s && (ParseRules::is_wslfcr(*value_s)))
       ++value_s;
     if (*value_s != ':') {
-      Warning("ignoring invalid body factory info line #%d in %s", info_path);
+      Warning("ignoring invalid body factory info line #%d in %s", lineno, info_path);
       continue;
     }
     ++value_s;                  // skip the colon
@@ -900,7 +900,7 @@ HttpBodySet::get_template_by_name(const char *name)
     HttpBodyTemplate *t = (HttpBodyTemplate *) v;
     if ((t == NULL) || (!t->is_sane()))
       return (NULL);
-    Debug("body_factory", "    get_template_by_name(%s) -> (file %s, length %d)",
+    Debug("body_factory", "    get_template_by_name(%s) -> (file %s, length %"PRId64")",
           name, t->template_pathname, t->byte_count);
     return (t);
   }
@@ -992,13 +992,13 @@ HttpBodyTemplate::load_from_file(char *dir, char *file)
   ///////////////////////////
 
   if (bytes_read != new_byte_count) {
-    Warning("reading template file '%s', got %d bytes instead of %d (%s)",
+    Warning("reading template file '%s', got %"PRId64" bytes instead of %"PRId64" (%s)",
             path, bytes_read, new_byte_count, (strerror(errno) ? strerror(errno) : "unknown error"));
     ats_free(new_template_buffer);
     return (0);
   }
 
-  Debug("body_factory", "    read %d bytes from '%s'", new_byte_count, path);
+  Debug("body_factory", "    read %"PRId64" bytes from '%s'", new_byte_count, path);
 
   /////////////////////////////////
   // actually commit the changes //
@@ -1028,7 +1028,7 @@ HttpBodyTemplate::build_instantiated_buffer(HttpTransact::State * context, int64
   *buflen_return = ((buffer == NULL) ? 0 : strlen(buffer));
   Debug("body_factory_instantiation", "    after instantiation: [%s]", buffer);
 
-  Debug("body_factory", "  returning %d byte instantiated buffer", *buflen_return);
+  Debug("body_factory", "  returning %"PRId64" byte instantiated buffer", *buflen_return);
 #endif
   return (buffer);
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/http/HttpClientSession.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpClientSession.cc b/proxy/http/HttpClientSession.cc
index 7bba2a4..1599160 100644
--- a/proxy/http/HttpClientSession.cc
+++ b/proxy/http/HttpClientSession.cc
@@ -150,7 +150,7 @@ HttpClientSession::new_transaction()
   /////////////////////////
   // set up timeouts     //
   /////////////////////////
-  Debug("http_cs", "[%" PRId64 "] using accept inactivity timeout [%d seconds]",
+  Debug("http_cs", "[%" PRId64 "] using accept inactivity timeout [%"PRId64" seconds]",
         con_id, HttpConfig::m_master.accept_no_activity_timeout);
   client_vc->set_inactivity_timeout(HRTIME_SECONDS(HttpConfig::m_master.accept_no_activity_timeout));
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index e4c1eb8..c382a5b 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1609,9 +1609,9 @@ HttpConfig::reconfigure()
 
 // Redirection debug statements
   Debug("http_init", "proxy.config.http.redirection_enabled = %d", params->redirection_enabled);
-  Debug("http_init", "proxy.config.http.number_of_redirections = %d", params->number_of_redirections);
+  Debug("http_init", "proxy.config.http.number_of_redirections = %"PRId64"", params->number_of_redirections);
 
-  Debug("http_init", "proxy.config.http.post_copy_size = %d", params->post_copy_size);
+  Debug("http_init", "proxy.config.http.post_copy_size = %"PRId64"", params->post_copy_size);
 }
 
 ////////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index f0f6596..c2b91da 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1364,7 +1364,7 @@ HttpSM::state_api_callout(int event, void *data)
           plugin_lock = false;
         }
 
-        Debug("http", "[%" PRId64 "] calling plugin on hook %s at hook 0x%X",
+        Debug("http", "[%" PRId64 "] calling plugin on hook %s at hook %p",
               sm_id, HttpDebugNames::get_api_hook_name(cur_hook_id), cur_hook);
 
         APIHook *hook = cur_hook;
@@ -1617,7 +1617,7 @@ HttpSM::state_http_server_open(int event, void *data)
     // the connection count.
     if (t_state.txn_conf->origin_max_connections > 0 ||
         t_state.http_config_param->origin_min_keep_alive_connections > 0) {
-      Debug("http_ss", "[%" PRId64 "] max number of connections: %u", sm_id, t_state.txn_conf->origin_max_connections);
+      Debug("http_ss", "[%" PRId64 "] max number of connections: %"PRIu64, sm_id, t_state.txn_conf->origin_max_connections);
       session->enable_origin_connection_limiting = true;
     }
     /*UnixNetVConnection * vc = (UnixNetVConnection*)(ua_session->client_vc);
@@ -2695,7 +2695,7 @@ HttpSM::is_http_server_eos_truncation(HttpTunnelProducer * p)
   int64_t cl = t_state.hdr_info.server_response.get_content_length();
 
   if (cl != UNDEFINED_COUNT && cl > server_response_body_bytes) {
-    Debug("http", "[%" PRId64 "] server eos after %d.  Expected %d", sm_id, cl, server_response_body_bytes);
+    Debug("http", "[%" PRId64 "] server eos after %"PRId64".  Expected %"PRId64, sm_id, cl, server_response_body_bytes);
     return true;
   } else {
     return false;
@@ -5146,7 +5146,7 @@ HttpSM::setup_server_send_request()
 
   // the plugin decided to append a message to the request
   if (api_set) {
-    Debug("http", "[%" PRId64 "] appending msg of %d bytes to request %s", sm_id, msg_len, t_state.internal_msg_buffer);
+    Debug("http", "[%" PRId64 "] appending msg of %"PRId64" bytes to request %s", sm_id, msg_len, t_state.internal_msg_buffer);
     hdr_length += server_entry->write_buffer->write(t_state.internal_msg_buffer, msg_len);
     server_request_body_bytes = msg_len;
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/http/HttpServerSession.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpServerSession.cc b/proxy/http/HttpServerSession.cc
index 5d7e95e..4df4d8a 100644
--- a/proxy/http/HttpServerSession.cc
+++ b/proxy/http/HttpServerSession.cc
@@ -132,12 +132,12 @@ HttpServerSession::do_io_close(int alerrno)
     if (connection_count->getCount(server_ip) > 0) {
       connection_count->incrementCount(server_ip, -1);
       char addrbuf[INET6_ADDRSTRLEN];
-      Debug("http_ss", "[%" PRId64 "] connection closed, ip: %u, count: %u",
+      Debug("http_ss", "[%" PRId64 "] connection closed, ip: %s, count: %u",
             con_id, 
             ink_inet_ntop(&server_ip.sa, addrbuf, sizeof(addrbuf)), 
             connection_count->getCount(server_ip));
     } else {
-      Error("http_ss", "[%" PRId64 "] number of connections should be greater then zero: %u",
+      Error("[%" PRId64 "] number of connections should be greater then zero: %u",
             con_id, connection_count->getCount(server_ip));
     }
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 73b9b95..9d729ae 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -1401,8 +1401,8 @@ HttpTransact::PPDNSLookup(State* s)
     s->parent_info.dns_round_robin = s->dns_info.round_robin;
 
     char addrbuf[INET6_ADDRSTRLEN];
-    Debug("http_trans", "[PPDNSLookup] DNS lookup for sm_id[%d] successful IP: %s", s->state_machine->sm_id,
-          ink_inet_ntop(&s->parent_info.addr.sa, addrbuf, sizeof(addrbuf)));
+    Debug("http_trans", "[PPDNSLookup] DNS lookup for sm_id[%"PRId64"] successful IP: %s",
+          s->state_machine->sm_id, ink_inet_ntop(&s->parent_info.addr.sa, addrbuf, sizeof(addrbuf)));
   }
 
   // Since this function can be called serveral times while retrying
@@ -3376,11 +3376,12 @@ HttpTransact::handle_response_from_parent(State* s)
         if ((s->current.attempts - 1) % s->http_config_param->per_parent_connect_attempts != 0) {
           // No we are not done with this parent so retry
           s->next_action = how_to_open_connection(s);
-          Debug("http_trans", "%s Retrying parent for attempt %d, max %d", "[handle_response_from_parent]", s->current.attempts,
-                s->http_config_param->per_parent_connect_attempts);
+          Debug("http_trans", "%s Retrying parent for attempt %d, max %"PRId64,
+                "[handle_response_from_parent]", s->current.attempts, s->http_config_param->per_parent_connect_attempts);
           return;
         } else {
-          Debug("http_trans", "%s per parent attempts exhausted", "[handle_response_from_parent]", s->current.attempts);
+          Debug("http_trans", "%s %d per parent attempts exhausted",
+                "[handle_response_from_parent]", s->current.attempts);
 
           // Only mark the parent down if we failed to connect
           //  to the parent otherwise slow origin servers cause
@@ -3553,8 +3554,8 @@ HttpTransact::delete_srv_entry(State* s, int max_retries)
 
   s->current.attempts++;
 
-  Debug("http_trans", "[delete_srv_entry] attempts now: %d, max: %" PRId64 "", s->current.attempts, max_retries);
-  Debug("dns_srv", "[delete_srv_entry] attempts now: %d, max: %" PRId64 "", s->current.attempts, max_retries);
+  Debug("http_trans", "[delete_srv_entry] attempts now: %d, max: %d", s->current.attempts, max_retries);
+  Debug("dns_srv", "[delete_srv_entry] attempts now: %d, max: %d", s->current.attempts, max_retries);
 
   if (!hostname) {
     TRANSACT_RETURN(OS_RR_MARK_DOWN, ReDNSRoundRobin);
@@ -3629,7 +3630,7 @@ HttpTransact::delete_srv_entry(State* s, int max_retries)
           new_r->round_robin = 1;
           int sz = HostDBRoundRobin::size(n, true);
           HostDBRoundRobin *rr_data = (HostDBRoundRobin *) hostDB.alloc(&new_r->app.rr.offset, sz);
-          Debug("hostdb", "allocating %d bytes for %d RR at %lX %d", sz, n, rr_data, new_r->app.rr.offset);
+          Debug("hostdb", "allocating %d bytes for %d RR at %p %d", sz, n, rr_data, new_r->app.rr.offset);
           int i = 0;
           while ((srv_entry = still_ok_hosts.dequeue())) {
             Debug("dns_srv", "Re-adding %s to HostDB [as a RR] after %s failed", srv_entry->getHost(), s->dns_info.lookup_name);
@@ -3694,7 +3695,7 @@ HttpTransact::delete_server_rr_entry(State* s, int max_retries)
   ink_debug_assert(s->current.server == &s->server_info);
   update_dns_info(&s->dns_info, &s->current, 0, &s->arena);
   s->current.attempts++;
-  Debug("http_trans", "[delete_server_rr_entry] attempts now: %d, max: %" PRId64 "", s->current.attempts, max_retries);
+  Debug("http_trans", "[delete_server_rr_entry] attempts now: %d, max: %d", s->current.attempts, max_retries);
   TRANSACT_RETURN(OS_RR_MARK_DOWN, ReDNSRoundRobin);
 }
 
@@ -5664,7 +5665,8 @@ HttpTransact::initialize_state_variables_from_request(State* s, HTTPHdr* obsolet
     int64_t length = incoming_request->get_content_length();
     s->hdr_info.request_content_length = (length >= 0) ? length : HTTP_UNDEFINED_CL;    // content length less than zero is invalid
 
-    Debug("http_trans", "[init_stat_vars_from_req] set req cont length to %d", s->hdr_info.request_content_length);
+    Debug("http_trans", "[init_stat_vars_from_req] set req cont length to %"PRId64,
+          s->hdr_info.request_content_length);
 
   } else {
     s->hdr_info.request_content_length = 0;
@@ -5898,7 +5900,8 @@ HttpTransact::is_stale_cache_response_returnable(State* s)
                                                                    s->current.now);
   // Negative age is overflow
   if ((current_age < 0) || (current_age > s->txn_conf->cache_max_stale_age)) {
-    Debug("http_trans", "[is_stale_cache_response_returnable] " "document age is too large %d", current_age);
+    Debug("http_trans", "[is_stale_cache_response_returnable] " "document age is too large %lld",
+          (long long)current_age);
     return false;
   }
   // If the stale document requires authorization, we can't return it either.
@@ -6845,8 +6848,8 @@ HttpTransact::handle_content_length_header(State* s, HTTPHdr* header, HTTPHdr* b
       header->field_delete(MIME_FIELD_CONTENT_LENGTH, MIME_LEN_CONTENT_LENGTH);
       s->hdr_info.request_content_length = HTTP_UNDEFINED_CL;
     }
-    Debug("http_trans", "[handle_content_length_header] cont len in hdr is %d, stat var is %d", header->get_content_length(),
-          s->hdr_info.request_content_length);
+    Debug("http_trans", "[handle_content_length_header] cont len in hdr is %"PRId64", stat var is %"PRId64,
+          header->get_content_length(), s->hdr_info.request_content_length);
   }
 
   return;
@@ -7203,8 +7206,8 @@ HttpTransact::calculate_document_freshness_limit(State *s, HTTPHdr *response, ti
       date_set = true;
     } else {
       date_value = s->request_sent_time;
-      Debug("http_match", "calculate_document_freshness_limit --- Expires header = %d  no date, using sent time %d",
-            expires_value, date_value);
+      Debug("http_match", "calculate_document_freshness_limit --- Expires header = %lld  no date, using sent time %lld",
+            (long long)expires_value, (long long)date_value);
     }
     ink_debug_assert(date_value > 0);
 
@@ -7215,12 +7218,12 @@ HttpTransact::calculate_document_freshness_limit(State *s, HTTPHdr *response, ti
     if (expires_set && !cache_sm.is_readwhilewrite_inprogress()) {
       if (expires_value == UNDEFINED_TIME || expires_value <= date_value) {
         expires_value = date_value;
-        Debug("http_match", "calculate_document_freshness_limit --- no expires, using date %d", expires_value);
+        Debug("http_match", "calculate_document_freshness_limit --- no expires, using date %lld", (long long)expires_value);
       }
       freshness_limit = (int) (expires_value - date_value);
 
-      Debug("http_match", "calculate_document_freshness_limit --- Expires: %d, Date: %d, freshness_limit = %d",
-            expires_value, date_value, freshness_limit);
+      Debug("http_match", "calculate_document_freshness_limit --- Expires: %lld, Date: %lld, freshness_limit = %d",
+            (long long)expires_value, (long long)date_value, freshness_limit);
 
       freshness_limit = min(max(0, freshness_limit), NUM_SECONDS_IN_ONE_YEAR);
     } else {
@@ -7228,13 +7231,15 @@ HttpTransact::calculate_document_freshness_limit(State *s, HTTPHdr *response, ti
       if (response->presence(MIME_PRESENCE_LAST_MODIFIED)) {
         last_modified_set = TRUE;
         last_modified_value = response->get_last_modified();
-        Debug("http_match", "calculate_document_freshness_limit --- Last Modified header = %d", last_modified_value);
+        Debug("http_match", "calculate_document_freshness_limit --- Last Modified header = %lld",
+              (long long)last_modified_value);
 
         if (last_modified_value == UNDEFINED_TIME) {
           last_modified_set = FALSE;
         } else if (last_modified_value > date_value) {
           last_modified_value = date_value;
-          Debug("http_match", "calculate_document_freshness_limit --- no last-modified, using sent time %d", last_modified_value);
+          Debug("http_match", "calculate_document_freshness_limit --- no last-modified, using sent time %lld",
+                (long long)last_modified_value);
         }
       }
 
@@ -7245,9 +7250,10 @@ HttpTransact::calculate_document_freshness_limit(State *s, HTTPHdr *response, ti
         ink_time_t time_since_last_modify = date_value - last_modified_value;
         int h_freshness = (int) (time_since_last_modify * f);
         freshness_limit = max(h_freshness, 0);
-        Debug("http_match", "calculate_document_freshness_limit --- heuristic: date=%d, lm=%d,"
-              "time_since_last_modify=%ld, f=%g, freshness_limit = %d",
-              date_value, last_modified_value, time_since_last_modify, f, freshness_limit);
+        Debug("http_match", "calculate_document_freshness_limit --- heuristic: date=%lld, lm=%lld,"
+              "time_since_last_modify=%lld, f=%g, freshness_limit = %d",
+              (long long)date_value, (long long)last_modified_value, (long long)time_since_last_modify,
+              f, freshness_limit);
       } else {
         freshness_limit = s->txn_conf->cache_heuristic_min_lifetime;
         Debug("http_match", "calculate_document_freshness_limit --- heuristic: freshness_limit = %d", freshness_limit);
@@ -7399,7 +7405,9 @@ HttpTransact::what_is_document_freshness(State *s, HTTPHdr* client_request, HTTP
     current_age = NUM_SECONDS_IN_ONE_YEAR;  // TODO: Should we make a new "max age" define?
   else
     current_age = min((time_t)NUM_SECONDS_IN_ONE_YEAR, current_age);
-  Debug("http_match", "[what_is_document_freshness] fresh_limit:  %d  current_age: %d", fresh_limit, current_age);
+
+  Debug("http_match", "[what_is_document_freshness] fresh_limit:  %d  current_age: %lld",
+        fresh_limit, (long long)current_age);
 
   /////////////////////////////////////////////////////////
   // did the admin override the expiration calculations? //
@@ -7498,10 +7506,10 @@ HttpTransact::what_is_document_freshness(State *s, HTTPHdr* client_request, HTTP
   }
 
   if (diags->on()) {
-    DebugOn("http_match", "document_freshness --- current_age = %d", current_age);
+    DebugOn("http_match", "document_freshness --- current_age = %lld", (long long)current_age);
     DebugOn("http_match", "document_freshness --- age_limit   = %d", age_limit);
     DebugOn("http_match", "document_freshness --- fresh_limit = %d", fresh_limit);
-    DebugOn("http_seq", "document_freshness --- current_age = %d", current_age);
+    DebugOn("http_seq", "document_freshness --- current_age = %lld", (long long)current_age);
     DebugOn("http_seq", "document_freshness --- age_limit   = %d", age_limit);
     DebugOn("http_seq", "document_freshness --- fresh_limit = %d", fresh_limit);
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/http/HttpTunnel.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index d93052e..f10c84c 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -280,7 +280,7 @@ ChunkedHandler::read_chunk()
 
   ink_assert(bytes_left >= 0);
   if (bytes_left == 0) {
-    Debug("http_chunk", "completed read of chunk of %d bytes", cur_chunk_size);
+    Debug("http_chunk", "completed read of chunk of %"PRId64" bytes", cur_chunk_size);
 
     // Check to see if we need to flow control the output
     if (dechunked_buffer &&
@@ -292,7 +292,7 @@ ChunkedHandler::read_chunk()
       state = CHUNK_READ_SIZE_START;
     }
   } else if (bytes_left > 0) {
-    Debug("http_chunk", "read %d bytes of an %d chunk", b, cur_chunk_size);
+    Debug("http_chunk", "read %"PRId64" bytes of an %"PRId64" chunk", b, cur_chunk_size);
   }
 }
 
@@ -768,7 +768,7 @@ HttpTunnel::producer_run(HttpTunnelProducer * p)
     } else if (p->do_dechunking) {
       // bz57413
       Debug("http_tunnel",
-            "[producer_run] do_dechunking p->chunked_handler.chunked_reader->read_avail() = %d",
+            "[producer_run] do_dechunking p->chunked_handler.chunked_reader->read_avail() = %"PRId64"",
             p->chunked_handler.chunked_reader->read_avail());
 
       // initialize a reader to dechunked buffer start before writing to keep ref count
@@ -779,7 +779,7 @@ HttpTunnel::producer_run(HttpTunnelProducer * p)
       if (!transform_consumer) {
         p->chunked_handler.dechunked_buffer->write(p->buffer_start, p->chunked_handler.skip_bytes);
 
-        Debug("http_tunnel", "[producer_run] do_dechunking::Copied header of size %d ", p->chunked_handler.skip_bytes);
+        Debug("http_tunnel", "[producer_run] do_dechunking::Copied header of size %"PRId64"", p->chunked_handler.skip_bytes);
       }
     }
   }
@@ -860,12 +860,12 @@ HttpTunnel::producer_run(HttpTunnelProducer * p)
   // including the maximum configured post data size
   if (p->alive && sm->t_state.method == HTTP_WKSIDX_POST && sm->enable_redirection
       && sm->redirection_tries == 0 && (p->vc_type == HT_HTTP_CLIENT)) {
-    Debug("http_redirect", "[HttpTunnel::producer_run] client post: %d max size: %d",
+    Debug("http_redirect", "[HttpTunnel::producer_run] client post: %"PRId64" max size: %"PRId64"",
           p->buffer_start->read_avail(), HttpConfig::m_master.post_copy_size);
 
     // (note that since we are not dechunking POST, this is the chunked size if chunked)
     if (p->buffer_start->read_avail() > HttpConfig::m_master.post_copy_size) {
-      Debug("http_redirect", "[HttpTunnel::producer_handler] post exceeds buffer limit, buffer_avail=%d limit=%d",
+      Debug("http_redirect", "[HttpTunnel::producer_handler] post exceeds buffer limit, buffer_avail=%"PRId64" limit=%"PRId64"",
             p->buffer_start->read_avail(), HttpConfig::m_master.post_copy_size);
       sm->enable_redirection = false;
     } else {
@@ -891,11 +891,11 @@ HttpTunnel::producer_run(HttpTunnelProducer * p)
     // bz57413
     // If there is no transformation plugin, then we didn't add the header, hence no need to consume it
     Debug("http_tunnel",
-          "[producer_run] do_dechunking p->chunked_handler.chunked_reader->read_avail() = %d",
+          "[producer_run] do_dechunking p->chunked_handler.chunked_reader->read_avail() = %"PRId64"",
           p->chunked_handler.chunked_reader->read_avail());
     if (!transform_consumer && (p->chunked_handler.chunked_reader->read_avail() >= p->chunked_handler.skip_bytes)) {
       p->chunked_handler.chunked_reader->consume(p->chunked_handler.skip_bytes);
-      Debug("http_tunnel", "[producer_run] do_dechunking p->chunked_handler.skip_bytes = %d",
+      Debug("http_tunnel", "[producer_run] do_dechunking p->chunked_handler.skip_bytes = %"PRId64"",
             p->chunked_handler.skip_bytes);
     }
     //if(p->chunked_handler.chunked_reader->read_avail() > 0)
@@ -1072,7 +1072,7 @@ bool HttpTunnel::producer_handler(int event, HttpTunnelProducer * p)
     if ((postbuf->postdata_copy_buffer_start->read_avail() + postbuf->ua_buffer_reader->read_avail())
         > HttpConfig::m_master.post_copy_size) {
       Debug("http_redirect",
-            "[HttpTunnel::producer_handler] post exceeds buffer limit, buffer_avail=%d reader_avail=%d limit=%d",
+            "[HttpTunnel::producer_handler] post exceeds buffer limit, buffer_avail=%"PRId64" reader_avail=%"PRId64" limit=%"PRId64"",
             postbuf->postdata_copy_buffer_start->read_avail(), postbuf->ua_buffer_reader->read_avail(),
             HttpConfig::m_master.post_copy_size);
       deallocate_redirect_postdata_buffers();
@@ -1499,7 +1499,7 @@ void
 HttpTunnel::copy_partial_post_data()
 {
   postbuf->postdata_copy_buffer->write(postbuf->ua_buffer_reader);
-  Debug("http_redirect", "[HttpTunnel::copy_partial_post_data] wrote %d bytes to buffers %d",
+  Debug("http_redirect", "[HttpTunnel::copy_partial_post_data] wrote %"PRId64" bytes to buffers %"PRId64"",
         postbuf->ua_buffer_reader->read_avail(), postbuf->postdata_copy_buffer_start->read_avail());
   postbuf->ua_buffer_reader->consume(postbuf->ua_buffer_reader->read_avail());
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/http/remap/RemapProcessor.cc
----------------------------------------------------------------------
diff --git a/proxy/http/remap/RemapProcessor.cc b/proxy/http/remap/RemapProcessor.cc
index 6b77f6a..8cf8449 100644
--- a/proxy/http/remap/RemapProcessor.cc
+++ b/proxy/http/remap/RemapProcessor.cc
@@ -45,7 +45,7 @@ RemapProcessor::start(int num_threads)
 bool
 RemapProcessor::setup_for_remap(HttpTransact::State *s)
 {
-  Debug("url_rewrite", "setting up for remap: %x", s);
+  Debug("url_rewrite", "setting up for remap: %p", s);
   URL *request_url = NULL;
   bool mapping_found = false;
   HTTPHdr *request_header = &s->hdr_info.client_request;
@@ -301,7 +301,7 @@ RemapProcessor::perform_remap(Continuation *cont, HttpTransact::State *s)
   host_hdr_info *hh_info = &(s->hh_info);
 
   if (!map) {
-    Error("Could not find corresponding url_mapping for this transaction %x", s);
+    Error("Could not find corresponding url_mapping for this transaction %p", s);
     Debug("url_rewrite", "Could not find corresponding url_mapping for this transaction");
     ink_debug_assert(!"this should never happen -- call setup_for_remap first");
     cont->handleEvent(EVENT_REMAP_ERROR, NULL);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logging/Log.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index e405493..14b688b 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -1167,7 +1167,7 @@ Log::flush_thread_main(void *args)
     // config->increment_space_used(bytes_to_disk);
     // TODO: the bytes_to_disk should be set to Log
 
-    Debug("log-flush","%d buffers flushed this round", buffers_flushed);
+    Debug("log-flush","%zu buffers flushed this round", buffers_flushed);
 
     // Time to work on periodic events??
     //

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logging/LogAccess.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
index 67b1c81..b65cd54 100644
--- a/proxy/logging/LogAccess.cc
+++ b/proxy/logging/LogAccess.cc
@@ -1342,7 +1342,7 @@ resolve_logfield_string(LogAccess *context, const char *format_str)
   int field_count = LogFormat::parse_symbol_string(fields_str, &fields, &contains_aggregates);
 
   if (field_count != n_fields) {
-    Error("log-resolve", "format_str contains %d invalid field symbols", n_fields - field_count);
+    Error("format_str contains %d invalid field symbols", n_fields - field_count);
     ats_free(printf_str);
     ats_free(fields_str);
     return NULL;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logging/LogBuffer.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogBuffer.cc b/proxy/logging/LogBuffer.cc
index 76d2324..6338327 100644
--- a/proxy/logging/LogBuffer.cc
+++ b/proxy/logging/LogBuffer.cc
@@ -607,7 +607,7 @@ LogBuffer::resolve_custom_entry(LogFieldList * fieldlist,
         }
 
         if (res < 0) {
-          Note(buffer_size_exceeded_msg);
+          Note("%s", buffer_size_exceeded_msg);
           bytes_written = 0;
           break;
         }
@@ -623,7 +623,7 @@ LogBuffer::resolve_custom_entry(LogFieldList * fieldlist,
       if (1 + bytes_written < write_to_len) {
         write_to[bytes_written++] = printf_str[i];
       } else {
-        Note(buffer_size_exceeded_msg);
+        Note("%s", buffer_size_exceeded_msg);
         bytes_written = 0;
         break;
       }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logging/LogCollationHostSM.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogCollationHostSM.cc b/proxy/logging/LogCollationHostSM.cc
index 5da9870..78fc0cf 100644
--- a/proxy/logging/LogCollationHostSM.cc
+++ b/proxy/logging/LogCollationHostSM.cc
@@ -399,7 +399,7 @@ LogCollationHostSM::read_hdr(int event, VIO * vio)
     m_read_bytes_received = 0;
     m_read_buffer = (char *) &m_net_msg_header;
     ink_assert(m_client_vc != NULL);
-    Debug("log-coll", "[%d]host:read_hdr - do_io_read(%d)", m_id, m_read_bytes_wanted);
+    Debug("log-coll", "[%d]host:read_hdr - do_io_read(%"PRId64")", m_id, m_read_bytes_wanted);
     m_client_vio = m_client_vc->do_io_read(this, m_read_bytes_wanted, m_client_buffer);
     ink_assert(m_client_vio != NULL);
     return EVENT_CONT;
@@ -455,7 +455,7 @@ LogCollationHostSM::read_body(int event, VIO * vio)
     m_read_buffer = new char[m_read_bytes_wanted];
     ink_assert(m_read_buffer != NULL);
     ink_assert(m_client_vc != NULL);
-    Debug("log-coll", "[%d]host:read_body - do_io_read(%d)", m_id, m_read_bytes_wanted);
+    Debug("log-coll", "[%d]host:read_body - do_io_read(%"PRId64")", m_id, m_read_bytes_wanted);
     m_client_vio = m_client_vc->do_io_read(this, m_read_bytes_wanted, m_client_buffer);
     ink_assert(m_client_vio != NULL);
     return EVENT_CONT;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index 70dea54..b06c2d8 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -1489,7 +1489,7 @@ LogConfig::update_space_used()
   //
   if (!logfile_dir) {
     const char *msg = "Logging directory not specified";
-    Error(msg);
+    Error("%s", msg);
     LogUtils::manager_alarm(LogUtils::LOG_ALARM_ERROR, msg);
     m_log_directory_inaccessible = true;
     return;
@@ -2251,7 +2251,7 @@ LogConfig::read_xml_log_config(int from_memory)
             if (numValid < n) {
               Warning("There are invalid protocol values (%s) in"
                       " the Protocol field of XML LogObject.\n"
-                      "Only %u out of %u values will be used.", protocols_str, numValid, n);
+                      "Only %zu out of %zu values will be used.", protocols_str, numValid, n);
             }
 
             LogFilterInt protocol_filter("__xml_protocol__",

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logging/LogField.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogField.cc b/proxy/logging/LogField.cc
index 7d1b248..6a781a8 100644
--- a/proxy/logging/LogField.cc
+++ b/proxy/logging/LogField.cc
@@ -372,8 +372,8 @@ LogField::update_aggregate(int64_t val)
     return;
   }
 
-  Debug("log-agg", "Aggregate field %s updated with val %d, "
-        "new val = %d, cnt = %d", m_symbol, val, m_agg_val, m_agg_cnt);
+  Debug("log-agg", "Aggregate field %s updated with val %"PRId64", "
+        "new val = %"PRId64", cnt = %"PRId64"", m_symbol, val, m_agg_val, m_agg_cnt);
 }
 
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logging/LogFile.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogFile.cc b/proxy/logging/LogFile.cc
index 67a4180..66ee3aa 100644
--- a/proxy/logging/LogFile.cc
+++ b/proxy/logging/LogFile.cc
@@ -706,11 +706,11 @@ LogFile::write_ascii_logbuffer3(LogBufferHeader * buffer_header, char *alt_forma
       if (m_overspill_bytes) {
         ++m_attempts_to_write_overspill;
         if (m_overspill_report_count && (m_attempts_to_write_overspill % m_overspill_report_count == 0)) {
-          Warning("Have dropped %u records so far because buffer "
+          Warning("Have dropped %zu records so far because buffer "
                   "for %s is full", m_attempts_to_write_overspill, m_name);
         }
       } else if (m_attempts_to_write_overspill) {
-        Warning("Dropped %u records because buffer for %s was full", m_attempts_to_write_overspill, m_name);
+        Warning("Dropped %zu records because buffer for %s was full", m_attempts_to_write_overspill, m_name);
         m_attempts_to_write_overspill = 0;
       }
     }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logging/LogFilter.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogFilter.cc b/proxy/logging/LogFilter.cc
index 835031b..a8b31a1 100644
--- a/proxy/logging/LogFilter.cc
+++ b/proxy/logging/LogFilter.cc
@@ -115,7 +115,7 @@ LogFilterString::LogFilterString(const char *name, LogField * field,
     }
     if (i < n) {
       Warning("There were invalid values in the definition of filter %s"
-              "only %u out of %u values will be used", name, i, n);
+              "only %zu out of %zu values will be used", name, i, n);
     }
   }
   _setValues(i, val_array);
@@ -379,7 +379,7 @@ LogFilterInt::LogFilterInt(const char *name, LogField * field,
     }
     if (i < n) {
       Warning("There were invalid values in the definition of filter %s"
-              " only %u out of %u values will be used.", name, i, n);
+              " only %zu out of %zu values will be used.", name, i, n);
     }
   } else {
     Warning("No values in the definition of filter %s.", name);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logging/LogObject.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogObject.cc b/proxy/logging/LogObject.cc
index 9c23c8b..ffa0eb0 100644
--- a/proxy/logging/LogObject.cc
+++ b/proxy/logging/LogObject.cc
@@ -557,7 +557,7 @@ LogObject::log(LogAccess * lad, char *text_entry)
     }
 
     if (time_now < m_format->m_interval_next) {
-      Debug("log-agg", "Time now = %d, next agg = %d; not time "
+      Debug("log-agg", "Time now = %ld, next agg = %ld; not time "
             "for aggregate entry", time_now, m_format->m_interval_next);
       return Log::LOG_OK;
     }
@@ -581,7 +581,7 @@ LogObject::log(LogAccess * lad, char *text_entry)
 
   if (!buffer) {
     Note("Traffic Server is skipping the current log entry for %s because "
-         "its size (%d) exceeds the maximum payload space in a " "log buffer", m_basename, bytes_needed);
+         "its size (%zu) exceeds the maximum payload space in a " "log buffer", m_basename, bytes_needed);
     LOG_INCREMENT_DYN_STAT(log_stat_event_log_access_fail_stat);
     return Log::FAIL;
   }
@@ -597,7 +597,7 @@ LogObject::log(LogAccess * lad, char *text_entry)
     bytes_used = m_format->m_field_list.marshal_agg(&(*buffer)[offset]);
     ink_assert(bytes_needed >= bytes_used);
     m_format->m_interval_next += m_format->m_interval_sec;
-    Debug("log-agg", "Aggregate entry created; next time is %d", m_format->m_interval_next);
+    Debug("log-agg", "Aggregate entry created; next time is %ld", m_format->m_interval_next);
   } else if (lad) {
     bytes_used = m_format->m_field_list.marshal(lad, &(*buffer)[offset]);
     ink_assert(bytes_needed >= bytes_used);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logging/LogSock.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogSock.cc b/proxy/logging/LogSock.cc
index 6f968e6..22c89d9 100644
--- a/proxy/logging/LogSock.cc
+++ b/proxy/logging/LogSock.cc
@@ -495,7 +495,7 @@ LogSock::write(int cid, void *buf, int bytes)
   //
   // send the message header
   //
-  Debug("log-sock", "   sending header (%d bytes)", sizeof(LogSock::MsgHeader));
+  Debug("log-sock", "   sending header (%zu bytes)", sizeof(LogSock::MsgHeader));
   header.msg_bytes = htonl(bytes);
   ret =::send(ct[cid].sd, (char *) &header, sizeof(LogSock::MsgHeader), 0);
   if (ret != sizeof(LogSock::MsgHeader)) {
@@ -613,7 +613,7 @@ LogSock::check_connections()
   for (int i = 1; i < m_max_connections; i++) {
     if (ct[i].state == LogSock::LS_STATE_INCOMING) {
       if (!is_connected(i, true)) {
-        Debug("log-sock", "Connection %d is no longer connected");
+        Debug("log-sock", "Connection %d is no longer connected", i);
         close(i);
       }
     }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/logstats.cc
----------------------------------------------------------------------
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index b0b5350..7c818f9 100644
--- a/proxy/logstats.cc
+++ b/proxy/logstats.cc
@@ -1641,7 +1641,7 @@ process_file(int in_fd, off_t offset, unsigned max_age)
   char buffer[MAX_LOGBUFFER_SIZE];
   int nread, buffer_bytes;
 
-  Debug("logstats", "Processing file [offset=%d].", offset);
+  Debug("logstats", "Processing file [offset=%lld].", (long long)offset);
   while (true) {
     Debug("logstats", "Reading initial header.");
     buffer[0] = '\0';
@@ -1656,7 +1656,7 @@ process_file(int in_fd, off_t offset, unsigned max_age)
       Debug("logstats", "Re-aligning file read.");
       while (true) {
         if (lseek(in_fd, offset, SEEK_SET) < 0) {
-          Debug("logstats", "Internal seek failed (offset=%ul).", offset);
+          Debug("logstats", "Internal seek failed (offset=%lld).", (long long)offset);
           return 1;
         }
 
@@ -1696,13 +1696,13 @@ process_file(int in_fd, off_t offset, unsigned max_age)
     unsigned second_read_size = sizeof(LogBufferHeader) - first_read_size;
     nread = read(in_fd, &buffer[first_read_size], second_read_size);
     if (!nread || EOF == nread) {
-      Debug("logstats", "Second read of header failed (attemped %d bytes at offset %d, got nothing).", second_read_size, first_read_size, nread);
+      Debug("logstats", "Second read of header failed (attemped %d bytes at offset %d, got nothing).", second_read_size, first_read_size);
       return 1;
     }
 
     // read the rest of the buffer
     if (header->byte_count > sizeof(buffer)) {
-      Debug("logstats", "Header byte count [%d] > expected [%d]", header->byte_count, sizeof(buffer));
+      Debug("logstats", "Header byte count [%d] > expected [%zu]", header->byte_count, sizeof(buffer));
       return 1;
     }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/stats/Stats.h
----------------------------------------------------------------------
diff --git a/proxy/stats/Stats.h b/proxy/stats/Stats.h
index 9842c6f..577b74d 100644
--- a/proxy/stats/Stats.h
+++ b/proxy/stats/Stats.h
@@ -176,9 +176,8 @@ ST_INLINE int64_t
 StatDescriptor::int_value() const
 {
   if (m_magic == NULL_VALUE || m_magic == IN_ERROR) {
-    const char *msg = "Attempt to read invalid plugin statistic";
-    Warning(msg);
-    // ink_debug_assert (! msg);
+    Warning("Attempt to read invalid plugin statistic");
+    // ink_debug_assert (0);
     return 0;
   }
 
@@ -191,9 +190,8 @@ ST_INLINE float
 StatDescriptor::flt_value() const
 {
   if (m_magic == NULL_VALUE || m_magic == IN_ERROR) {
-    const char *msg = "Attempt to read invalid plugin statistic";
-    Warning(msg);
-    // ink_debug_assert (! msg);
+    Warning("Attempt to read invalid plugin statistic");
+    // ink_debug_assert (0);
     return 0.0;
   }
 


Mime
View raw message