trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject git commit: TS-1079 Fix more %lld to PRId64 or PRIu64 printf's
Date Tue, 10 Apr 2012 03:01:06 GMT
Updated Branches:
  refs/heads/master 7ad3d25a7 -> 170c7712c


TS-1079 Fix more %lld to PRId64 or PRIu64 printf's


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

Branch: refs/heads/master
Commit: 170c7712ce40bf97f53e7d20c25b13a48840a67b
Parents: 7ad3d25
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Mon Apr 9 21:00:52 2012 -0600
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Mon Apr 9 21:00:52 2012 -0600

----------------------------------------------------------------------
 iocore/cache/Cache.cc             |   14 +++++++-------
 iocore/cache/CacheHosting.cc      |    4 ++--
 iocore/cache/CacheVol.cc          |    8 ++++----
 iocore/cache/CacheWrite.cc        |    4 ++--
 iocore/cluster/ClusterCache.cc    |    2 +-
 iocore/hostdb/MultiCache.cc       |   16 ++++++++--------
 iocore/net/UnixUDPNet.cc          |    4 ++--
 mgmt/Main.cc                      |    2 +-
 mgmt/stats/StatType.cc            |    4 ++--
 proxy/ParentSelection.cc          |    4 ++--
 proxy/congest/CongestionDB.cc     |    2 +-
 proxy/http/HttpTransactHeaders.cc |   22 +++++++++++-----------
 proxy/logging/Log.cc              |    2 +-
 proxy/logging/LogBuffer.cc        |    3 ---
 proxy/logstats.cc                 |    4 ++--
 15 files changed, 46 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 8f67673..31102eb 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -676,8 +676,8 @@ CacheProcessor::diskInitialized()
       CacheDisk *d = gdisks[i];
       if (is_debug_tag_set("cache_hosting")) {
         int j;
-        Debug("cache_hosting", "Disk: %d: Vol Blocks: %u: Free space: %lld",
-              i, d->header->num_diskvol_blks, (long long)d->free_space);
+        Debug("cache_hosting", "Disk: %d: Vol Blocks: %u: Free space: %" PRIu64,
+              i, d->header->num_diskvol_blks, d->free_space);
         for (j = 0; j < (int) d->header->num_volumes; j++) {
           Debug("cache_hosting", "\tVol: %d Size: %"PRIu64, d->disk_vols[j]->vol_number,
d->disk_vols[j]->size);
         }
@@ -2299,7 +2299,7 @@ cplist_reconfigure()
         int vols = (free_space / MAX_VOL_SIZE) + 1;
         for (int p = 0; p < vols; p++) {
           off_t b = gdisks[i]->free_space / (vols - p);
-          Debug("cache_hosting", "blocks = %lld\n", (long long)b);
+          Debug("cache_hosting", "blocks = %" PRId64, (int64_t)b);
           DiskVolBlock *dpb = gdisks[i]->create_volume(0, b, CACHE_HTTP_TYPE);
           ink_assert(dpb && dpb->len == (uint64_t)b);
         }
@@ -2498,11 +2498,11 @@ create_volume(int volume_number, off_t size_in_blocks, int scheme,
CacheVol *cp)
         char config_file[PATH_NAME_MAX];
         IOCORE_ReadConfigString(config_file, "proxy.config.cache.volume_filename", PATH_NAME_MAX);
         if (cp->size)
-          Warning("not enough space to increase volume: [%d] to size: [%lld]",
-                  volume_number, (long long)((to_create + cp->size) >> (20 - STORE_BLOCK_SHIFT)));
+          Warning("not enough space to increase volume: [%d] to size: [%" PRId64 "]",
+                  volume_number, (int64_t)((to_create + cp->size) >> (20 - STORE_BLOCK_SHIFT)));
         else
-          Warning("not enough space to create volume: [%d], size: [%lld]",
-                  volume_number, (long long)(to_create >> (20 - STORE_BLOCK_SHIFT)));
+          Warning("not enough space to create volume: [%d], size: [%" PRId64 "]",
+                  volume_number, (int64_t)(to_create >> (20 - STORE_BLOCK_SHIFT)));
 
         Note("edit the %s file and restart traffic_server", config_file);
         delete[]sp;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/iocore/cache/CacheHosting.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheHosting.cc b/iocore/cache/CacheHosting.cc
index f1b32cc..534297c 100644
--- a/iocore/cache/CacheHosting.cc
+++ b/iocore/cache/CacheHosting.cc
@@ -1144,8 +1144,8 @@ execute_and_verify(RegressionTest * t)
     CacheDisk *d = gdisks[i];
     if (is_debug_tag_set("cache_hosting")) {
 
-      Debug("cache_hosting", "Disk: %d: Vol Blocks: %u: Free space: %lld",
-            i, d->header->num_diskvol_blks, (long long)(d->free_space));
+      Debug("cache_hosting", "Disk: %d: Vol Blocks: %u: Free space: %" PRIu64,
+            i, d->header->num_diskvol_blks, d->free_space);
       for (int j = 0; j < (int) d->header->num_volumes; j++) {
 
         Debug("cache_hosting", "\tVol: %d Size: %"PRIu64, d->disk_vols[j]->vol_number,
d->disk_vols[j]->size);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/iocore/cache/CacheVol.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheVol.cc b/iocore/cache/CacheVol.cc
index 9f7da3e..efac795 100644
--- a/iocore/cache/CacheVol.cc
+++ b/iocore/cache/CacheVol.cc
@@ -344,9 +344,9 @@ CacheVC::scanObject(int event, Event * e)
     scan_fix_buffer_offset = partial_object_len;
   } else { // Normal case, where we ended on a object boundary.
     io.aiocb.aio_offset += ((char *)doc - buf->data()) + next_object_len;
-    Debug("cache_scan_truss", "next %p:scanObject %lld", this, (long long)io.aiocb.aio_offset);
+    Debug("cache_scan_truss", "next %p:scanObject %" PRId64, this, (int64_t)io.aiocb.aio_offset);
     io.aiocb.aio_offset = next_in_map(vol, scan_vol_map, io.aiocb.aio_offset);
-    Debug("cache_scan_truss", "next_in_map %p:scanObject %lld", this, (long long)io.aiocb.aio_offset);
+    Debug("cache_scan_truss", "next_in_map %p:scanObject %" PRId64, this, (int64_t)io.aiocb.aio_offset);
     io.aiocb.aio_nbytes = SCAN_BUF_SIZE;
     io.aiocb.aio_buf = buf->data();
     scan_fix_buffer_offset = 0;
@@ -364,8 +364,8 @@ Lread:
     io.aiocb.aio_nbytes = vol->skip + vol->len - io.aiocb.aio_offset;
   offset = 0;
   ink_assert(ink_aio_read(&io) >= 0);
-  Debug("cache_scan_truss", "read %p:scanObject %lld %zu", this,
-    (long long)io.aiocb.aio_offset, io.aiocb.aio_nbytes);
+  Debug("cache_scan_truss", "read %p:scanObject %" PRId64 " %zu", this,
+        (int64_t)io.aiocb.aio_offset, io.aiocb.aio_nbytes);
   return EVENT_CONT;
 
 Ldone:

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/iocore/cache/CacheWrite.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc
index 2ffee33..df18b6c 100644
--- a/iocore/cache/CacheWrite.cc
+++ b/iocore/cache/CacheWrite.cc
@@ -1513,8 +1513,8 @@ CacheVC::openWriteStartDone(int event, Event *e)
        */
       if (!dir_valid(vol, &dir)) {
         DDebug("cache_write",
-              "OpenReadStartDone: Dir not valid: Write Head: %lld, Dir: %"PRId64,
-              (long long)offset_to_vol_offset(vol, vol->header->write_pos), dir_offset(&dir));
+               "OpenReadStartDone: Dir not valid: Write Head: %" PRId64 ", Dir: %"PRId64,
+               (int64_t)offset_to_vol_offset(vol, vol->header->write_pos), dir_offset(&dir));
         last_collision = NULL;
         goto Lcollision;
       }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/iocore/cluster/ClusterCache.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterCache.cc b/iocore/cluster/ClusterCache.cc
index 4515106..3b06f85 100644
--- a/iocore/cluster/ClusterCache.cc
+++ b/iocore/cluster/ClusterCache.cc
@@ -1694,7 +1694,7 @@ CacheContinuation::replyOpEvent(int event, VConnection * cvc)
     if (read_op && !open_read_now_open_write) {
       ink_release_assert(write_cluster_vc->pending_remote_fill);
       ink_assert(have_all_data || (readahead_vio == &((CacheVC *) cache_vc)->vio));
-      Debug("cache_proto", "connect_local success seqno=%d alldata=%d", seq_number, (have_all_data
? 1 : 0));
+      Debug("cache_proto", "connect_local success seqno=%d have_all_data=%d", seq_number,
(have_all_data ? 1 : 0));
 
       if (have_all_data) {
         msg->token.clear();     // Tell sender no conn established

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/iocore/hostdb/MultiCache.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/MultiCache.cc b/iocore/hostdb/MultiCache.cc
index c53d198..f8de1dd 100644
--- a/iocore/hostdb/MultiCache.cc
+++ b/iocore/hostdb/MultiCache.cc
@@ -1142,8 +1142,8 @@ MultiCacheBase::fixup_heap_offsets(int partition, int before_used, UnsunkPtrRegi
   for (int i = 0; i < r->n; i++) {
     UnsunkPtr & p = r->ptrs[i];
     if (p.offset) {
-      Debug("multicache", "fixup p.offset %d offset %d %lld part %d",
-            p.offset, *p.poffset, (long long)((char *) p.poffset - data), partition);
+      Debug("multicache", "fixup p.offset %d offset %d %" PRId64 " part %d",
+            p.offset, *p.poffset, (int64_t)((char *) p.poffset - data), partition);
       if (*p.poffset == -(i + base) - 1) {
         if (halfspace_of(p.offset) != heap_halfspace) {
           ink_assert(0);
@@ -1157,8 +1157,8 @@ MultiCacheBase::fixup_heap_offsets(int partition, int before_used, UnsunkPtrRegi
         }
       } else {
         Debug("multicache",
-              "not found %lld i %d base %d *p.poffset = %d",
-              (long long)((char *) p.poffset - data), i, base, *p.poffset);
+              "not found %" PRId64 " i %d base %d *p.poffset = %d",
+              (int64_t)((char *) p.poffset - data), i, base, *p.poffset);
       }
       p.offset = 0;
       p.poffset = (int *) r->next_free;
@@ -1368,8 +1368,8 @@ MultiCacheBase::alloc(int *poffset, int asize)
     UnsunkPtr *up = unsunk[part].alloc(poffset);
     up->offset = offset;
     up->poffset = poffset;
-    Debug("multicache", "alloc unsunk %d at %lld part %d offset %d",
-        *poffset, (long long)((char *) poffset - data), part, offset);
+    Debug("multicache", "alloc unsunk %d at %" PRId64 " part %d offset %d",
+          *poffset, (int64_t)((char *) poffset - data), part, offset);
   }
   return (void *) p;
 }
@@ -1393,7 +1393,7 @@ void *
 MultiCacheBase::ptr(int *poffset, int partition)
 {
   int o = *poffset;
-  Debug("multicache", "ptr %lld part %d %d", (long long)((char *) poffset - data), partition,
o);
+  Debug("multicache", "ptr %" PRId64 " part %d %d", (int64_t)((char *) poffset - data), partition,
o);
   if (o > 0) {
     if (!valid_offset(o)) {
       ink_assert(!"bad offset");
@@ -1416,7 +1416,7 @@ void
 MultiCacheBase::update(int *poffset, int *old_poffset)
 {
   int o = *poffset;
-  Debug("multicache", "updating %lld %d", (long long)((char *) poffset - data), o);
+  Debug("multicache", "updating %" PRId64 " %d", (int64_t)((char *) poffset - data), o);
   if (o > 0) {
     if (!valid_offset(o)) {
       ink_assert(!"bad poffset");

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/iocore/net/UnixUDPNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixUDPNet.cc b/iocore/net/UnixUDPNet.cc
index 9a29f35..423bd6c 100644
--- a/iocore/net/UnixUDPNet.cc
+++ b/iocore/net/UnixUDPNet.cc
@@ -1048,8 +1048,8 @@ sendPackets:
       G_inkPipeInfo.perPipeInfo[i].queue->FreeCancelledPackets(g_udp_periodicCleanupSlots);
     }
     endTime = ink_get_hrtime_internal();
-    Debug("udp-pending-packets", "Did cleanup of %d buckets: %" PRId64 " bytes in %lld m.sec",
-          g_udp_periodicCleanupSlots, nbytes - g_udp_bytesPending, (long long)ink_hrtime_to_msec(endTime
- startTime));
+    Debug("udp-pending-packets", "Did cleanup of %d buckets: %" PRId64 " bytes in %" PRId64
" m.sec",
+          g_udp_periodicCleanupSlots, nbytes - g_udp_bytesPending, (int64_t)ink_hrtime_to_msec(endTime
- startTime));
     lastCleanupTime = now;
   }
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/mgmt/Main.cc
----------------------------------------------------------------------
diff --git a/mgmt/Main.cc b/mgmt/Main.cc
index 17de7f0..ef03394 100644
--- a/mgmt/Main.cc
+++ b/mgmt/Main.cc
@@ -754,7 +754,7 @@ main(int argc, char **argv)
   //   UI record for this machine
   overviewGenerator->addSelfRecord();
   webThrId = ink_thread_create(webIntr_main, NULL);     /* Spin web agent thread */
-  Debug("lm", "Created Web Agent thread (%lld)", (long long)webThrId);
+  Debug("lm", "Created Web Agent thread (%"  PRId64 ")", (int64_t)webThrId);
   lmgmt->listenForProxy();
 
   /* Check the permissions on vip_config */

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/mgmt/stats/StatType.cc
----------------------------------------------------------------------
diff --git a/mgmt/stats/StatType.cc b/mgmt/stats/StatType.cc
index 5edc837..a0d52b0 100644
--- a/mgmt/stats/StatType.cc
+++ b/mgmt/stats/StatType.cc
@@ -783,8 +783,8 @@ StatObject::setTokenValue(StatExprToken * token, bool cluster)
       // only support time function
       token->m_token_value = (StatFloat) (m_current_time - m_last_update);
       if (StatDebug) {
-        Debug(MODULE, "m_current_time(%lld) - m_last_update(%lld) = %lld\n",
-              (long long)m_current_time, (long long)m_last_update, (long long)token->m_token_value);
+        Debug(MODULE, "m_current_time(%"  PRId64 ") - m_last_update(%"  PRId64 ") = %"  PRId64
"\n",
+              (int64_t)m_current_time, (int64_t)m_last_update, (int64_t)token->m_token_value);
       }
       break;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/proxy/ParentSelection.cc
----------------------------------------------------------------------
diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc
index 0840c37..94bcec1 100644
--- a/proxy/ParentSelection.cc
+++ b/proxy/ParentSelection.cc
@@ -555,8 +555,8 @@ ParentRecord::FindParent(bool first_call, ParentResult * result, RD *
rdata, Par
       parentUp = true;
     } else {
       if ((result->wrap_around) || ((parents[cur_index].failedAt + config->ParentRetryTime)
< request_info->xact_start)) {
-        Debug("parent_select", "Parent[%d].failedAt = %u, retry = %u,xact_start = %lld but
wrap = %d", cur_index,
-              parents[cur_index].failedAt, config->ParentRetryTime, (long long)request_info->xact_start,
result->wrap_around);
+        Debug("parent_select", "Parent[%d].failedAt = %u, retry = %u,xact_start = %" PRId64
" but wrap = %d", cur_index,
+              parents[cur_index].failedAt, config->ParentRetryTime, (int64_t)request_info->xact_start,
result->wrap_around);
         // Reuse the parent
         parentUp = true;
         parentRetry = true;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/proxy/congest/CongestionDB.cc
----------------------------------------------------------------------
diff --git a/proxy/congest/CongestionDB.cc b/proxy/congest/CongestionDB.cc
index f2d3eaf..fbd1ef1 100644
--- a/proxy/congest/CongestionDB.cc
+++ b/proxy/congest/CongestionDB.cc
@@ -404,7 +404,7 @@ CongestionDBCont::get_congest_entry(int event, Event * e)
   if (m_action.cancelled) {
     Debug("congestion_cont", "action cancelled for %p", this);
     Free_CongestionDBCont(this);
-    Debug("congestion_control", "cont::get_congest_entry state machine cancelld");
+    Debug("congestion_control", "cont::get_congest_entry state machine canceled");
     return EVENT_DONE;
   }
   ProxyMutex *bucket_mutex = theCongestionDB->lock_for_key(CDBC_key);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/proxy/http/HttpTransactHeaders.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransactHeaders.cc b/proxy/http/HttpTransactHeaders.cc
index ce9475f..1047290 100644
--- a/proxy/http/HttpTransactHeaders.cc
+++ b/proxy/http/HttpTransactHeaders.cc
@@ -435,17 +435,17 @@ HttpTransactHeaders::calculate_document_age(ink_time_t request_time,
     current_age = corrected_initial_age + resident_time;
   }
 
-  Debug("http_age", "[calculate_document_age] age_value:              %lld", (long long)age_value);
-  Debug("http_age", "[calculate_document_age] date_value:             %lld", (long long)date_value);
-  Debug("http_age", "[calculate_document_age] response_time:          %lld", (long long)response_time);
-  Debug("http_age", "[calculate_document_age] now:                    %lld", (long long)now);
-  Debug("http_age", "[calculate_document_age] now (fixed):            %lld", (long long)now_value);
-  Debug("http_age", "[calculate_document_age] apparent_age:           %lld", (long long)apparent_age);
-  Debug("http_age", "[calculate_document_age] corrected_received_age: %lld", (long long)corrected_received_age);
-  Debug("http_age", "[calculate_document_age] response_delay:         %lld", (long long)response_delay);
-  Debug("http_age", "[calculate_document_age] corrected_initial_age:  %lld", (long long)corrected_initial_age);
-  Debug("http_age", "[calculate_document_age] resident_time:          %lld", (long long)resident_time);
-  Debug("http_age", "[calculate_document_age] current_age:            %lld", (long long)current_age);
+  Debug("http_age", "[calculate_document_age] age_value:              %" PRId64, (int64_t)age_value);
+  Debug("http_age", "[calculate_document_age] date_value:             %" PRId64, (int64_t)date_value);
+  Debug("http_age", "[calculate_document_age] response_time:          %" PRId64, (int64_t)response_time);
+  Debug("http_age", "[calculate_document_age] now:                    %" PRId64, (int64_t)now);
+  Debug("http_age", "[calculate_document_age] now (fixed):            %" PRId64, (int64_t)now_value);
+  Debug("http_age", "[calculate_document_age] apparent_age:           %" PRId64, (int64_t)apparent_age);
+  Debug("http_age", "[calculate_document_age] corrected_received_age: %" PRId64, (int64_t)corrected_received_age);
+  Debug("http_age", "[calculate_document_age] response_delay:         %" PRId64, (int64_t)response_delay);
+  Debug("http_age", "[calculate_document_age] corrected_initial_age:  %" PRId64, (int64_t)corrected_initial_age);
+  Debug("http_age", "[calculate_document_age] resident_time:          %" PRId64, (int64_t)resident_time);
+  Debug("http_age", "[calculate_document_age] current_age:            %" PRId64, (int64_t)current_age);
 
   return current_age;
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/proxy/logging/Log.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 0a3d9f2..a4d6947 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -1181,7 +1181,7 @@ Log::flush_thread_main(void *args)
     now = time(NULL);
     if (now > last_time) {
       if ((now % PERIODIC_TASKS_INTERVAL) == 0) {
-        Debug("log-flush", "periodic tasks for %lld", (long long)now);
+        Debug("log-flush", "periodic tasks for %" PRId64, (int64_t)now);
         periodic_tasks(now);
       }
       last_time = (now = time(NULL));

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/proxy/logging/LogBuffer.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogBuffer.cc b/proxy/logging/LogBuffer.cc
index 8abc160..363476d 100644
--- a/proxy/logging/LogBuffer.cc
+++ b/proxy/logging/LogBuffer.cc
@@ -805,9 +805,6 @@ LogBufferList::get()
   if (lb != NULL) {
     m_size--;
     ink_assert(m_size >= 0);
-//      hrtime_t t = gethrtime();
-//      printf("%lld removed buffer %p from queue %p, size = %d\n", t, lb,
-//           this, m_size);
   }
   ink_mutex_release(&m_mutex);
   return lb;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/170c7712/proxy/logstats.cc
----------------------------------------------------------------------
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index 99e453a..47ded3e 100644
--- a/proxy/logstats.cc
+++ b/proxy/logstats.cc
@@ -1647,7 +1647,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=%lld].", (long long)offset);
+  Debug("logstats", "Processing file [offset=%" PRId64 "].", (int64_t)offset);
   while (true) {
     Debug("logstats", "Reading initial header.");
     buffer[0] = '\0';
@@ -1662,7 +1662,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=%lld).", (long long)offset);
+          Debug("logstats", "Internal seek failed (offset=%"  PRId64 ").", (int64_t)offset);
           return 1;
         }
 


Mime
View raw message