Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

TS-400 Checkpoint 6 in cleanup.

git-svn-id: https://svn.apache.org/repos/asf/trafficserver/traffic/trunk@982072 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit e5ac5eaf82bc034c52b759b1ff1e48f03f5643da 1 parent 023fa22
Leif Hedstrom zwoop authored
3  configure.ac
View
@@ -451,12 +451,13 @@ case $host_os in
# 873 is "has no corresponding operator delete". ToDo: we should fix.
# 981 is "operands are evaluated in unspecified order"
# 1418 is "external function definition with no prior declaration"
+ # 1419 is "external declaration in primary source file"
# 1720 is "operator new" has no corresponding member operator delete"
# 2256 is "non-pointer conversion from "int" to "unsigned char" "
# 2259 is "non-pointer conversion from "int" to "unsigned char" "
#
# TODO: We should try to eliminate more of these -wd exclusions.
- common_opt="-pipe -Wall -wd111 -wd279 -wd522 -wd444 -wd873 -wd981 -wd1418 -wd1720 -wd2256 -wd2259"
+ common_opt="-pipe -Wall -wd111 -wd279 -wd522 -wd444 -wd873 -wd981 -wd1418 -wd1419 -wd1720 -wd2256 -wd2259"
debug_opt="-ggdb3 $common_opt"
release_opt="-g $common_opt -O2 -axsse4.2 -fno-strict-aliasing"
cxx_opt="-Wno-invalid-offsetof"
12 iocore/cache/Cache.cc
View
@@ -169,6 +169,10 @@ int
cache_stats_bytes_used_cb(const char *name,
RecDataT data_type, RecData *data, RecRawStatBlock *rsb, int id, void *cookie)
{
+ NOWARN_UNUSED(name);
+ NOWARN_UNUSED(data_type);
+ NOWARN_UNUSED(data);
+ NOWARN_UNUSED(cookie);
if (cacheProcessor.initialized == CACHE_INITIALIZED) {
RecSetGlobalRawStatSum(rsb, id, cache_bytes_used());
}
@@ -226,6 +230,7 @@ CacheVC::do_io_read(Continuation *c, int64 nbytes, MIOBuffer *abuf)
VIO *
CacheVC::do_io_pread(Continuation *c, int64 nbytes, MIOBuffer *abuf, int64 offset)
{
+ NOWARN_UNUSED(nbytes);
ink_assert(vio.op == VIO::READ);
vio.buffer.writer_for(abuf);
vio.set_continuation(c);
@@ -870,8 +875,8 @@ Part::db_check(bool fix)
ink_ctime_r(&header->create_time, tt);
tt[strlen(tt) - 1] = 0;
printf(" Create Time: %s\n", tt);
- printf(" Sync Serial: %u\n", (int) header->sync_serial);
- printf(" Write Serial: %u\n", (int) header->write_serial);
+ printf(" Sync Serial: %d\n", (int) header->sync_serial);
+ printf(" Write Serial: %d\n", (int) header->write_serial);
printf("\n");
return 0;
@@ -1207,7 +1212,6 @@ Part::handle_recover_from_data(int event, void *data)
if (got_len) {
Doc *doc = NULL;
- Doc *last_doc = NULL;
if (recover_wrapped && start == io.aiocb.aio_offset) {
doc = (Doc *) s;
@@ -1290,7 +1294,6 @@ Part::handle_recover_from_data(int event, void *data)
}
// doc->magic == DOC_MAGIC && doc->sync_serial == last_sync_serial
last_write_serial = doc->write_serial;
- last_doc = doc;
s += round_to_approx_size(doc->len);
}
@@ -1885,6 +1888,7 @@ CacheVC::handleReadDone(int event, Event *e)
int
CacheVC::handleRead(int event, Event *e)
{
+ NOWARN_UNUSED(event);
NOWARN_UNUSED(e);
cancel_trigger();
4 iocore/cache/CacheDir.cc
View
@@ -1134,8 +1134,8 @@ Part::dir_check(bool fix)
int total = buckets * segments * DIR_DEPTH;
printf(" Directory for [%s]\n", hash_id);
printf(" Bytes: %d\n", total * SIZEOF_DIR);
- printf(" Segments: %lld\n", (uint64)segments);
- printf(" Buckets: %lld\n", (uint64)buckets);
+ printf(" Segments: %llu\n", (uint64)segments);
+ printf(" Buckets: %llu\n", (uint64)buckets);
printf(" Entries: %d\n", total);
printf(" Full: %d\n", full);
printf(" Empty: %d\n", empty);
2  iocore/cache/CachePages.cc
View
@@ -27,7 +27,7 @@
#include "api/ts/ts.h"
#include "Show.h"
-struct ShowCache:ShowCont
+struct ShowCache: public ShowCont
{
int part_index;
int seg_index;
4 iocore/cache/CachePagesInternal.cc
View
@@ -26,7 +26,7 @@
#ifdef NON_MODULAR
#include "Show.h"
-struct ShowCacheInternal:ShowCont
+struct ShowCacheInternal: public ShowCont
{
int part_index;
int seg_index;
@@ -216,7 +216,7 @@ ShowCacheInternal::showPartEvacuations(int event, Event * e)
for (int i = 0; i < last; i++) {
for (b = p->evacuate[i].head; b; b = b->link.next) {
char offset[60];
- sprintf(offset, "%lld", (uint64) part_offset(p, &b->dir));
+ sprintf(offset, "%llu", (uint64) part_offset(p, &b->dir));
CHECK_SHOW(show("<tr>" "<td>%s</td>" // offset
"<td>%d</td>" // estimated size
"<td>%d</td>" // reader count
5 iocore/cache/NewCacheVC.cc
View
@@ -164,6 +164,7 @@ NewCacheVC::do_io_read(Continuation * c, int64 nbytes, MIOBuffer * buf)
int
NewCacheVC::handleRead(int event, Event * e)
{
+ NOWARN_UNUSED(e);
Debug("cache_plugin", "[NewCacheVC::handleRead] this=%lX event=%d", (long) this, event);
cancel_trigger();
@@ -230,6 +231,7 @@ NewCacheVC::do_io_write(Continuation * c, int64 nbytes, IOBufferReader * buf, bo
int
NewCacheVC::handleWrite(int event, Event * e)
{
+ NOWARN_UNUSED(e);
Debug("cache_plugin", "[NewCacheVC::handleWrite] event=%d", event);
cancel_trigger();
@@ -268,6 +270,7 @@ NewCacheVC::alloc(Continuation * cont, URL * url, HttpCacheSM * sm)
void
NewCacheVC::setWriteVC(CacheHTTPInfo * old_info)
{
+ NOWARN_UNUSED(old_info);
cancel_trigger();
_vio.op = VIO::WRITE;
closed = false;
@@ -309,6 +312,7 @@ NewCacheVC::do_io_close(int lerrno)
void
NewCacheVC::reenable_re(VIO * vio)
{
+ NOWARN_UNUSED(vio);
Debug("cache_plugin", "[NewCacheVC::reenable_re]");
}
@@ -395,6 +399,7 @@ NewCacheVC::_append_unmarshal_buf(const void *data, const uint64 size)
int
NewCacheVC::handleLookup(int event, Event * e)
{
+ NOWARN_UNUSED(e);
Debug("cache_plugin", "[NewCacheVC::handleLookup] event=%d", event);
cancel_trigger();
6 iocore/cache/P_CacheTest.h
View
@@ -38,7 +38,7 @@ struct PinnedDocEntry
LINK(PinnedDocEntry, link);
};
-struct PinnedDocTable:Continuation
+struct PinnedDocTable: public Continuation
{
Queue<PinnedDocEntry> bucket[PINNED_DOC_TABLE_SIZE];
@@ -66,7 +66,7 @@ struct CacheTestHeader {
uint64 serial;
};
-struct CacheTestSM : RegressionSM {
+struct CacheTestSM : public RegressionSM {
int start_memcpy_on_clone; // place all variables to be copied between these markers
Action *timeout;
Action *cache_action;
@@ -119,7 +119,7 @@ struct CacheTestSM : RegressionSM {
// It is 2010 and C++ STILL doesn't have closures, a technology of the 1950s, unbelievable
#define CACHE_SM(_t, _sm, _f) \
- struct CacheTestSM__##_sm : CacheTestSM { \
+ struct CacheTestSM__##_sm : public CacheTestSM { \
void make_request_internal() _f \
CacheTestSM__##_sm(RegressionTest *t) : CacheTestSM(t) {} \
CacheTestSM__##_sm(const CacheTestSM__##_sm &xsm) : CacheTestSM(xsm) {} \
4 iocore/cache/RamCacheCLFUS.cc
View
@@ -65,7 +65,7 @@ struct RamCacheCLFUSEntry {
Ptr<IOBufferData> data;
};
-struct RamCacheCLFUS : RamCache {
+struct RamCacheCLFUS : public RamCache {
int64 max_bytes;
int64 bytes;
int64 objects;
@@ -100,7 +100,7 @@ struct RamCacheCLFUS : RamCache {
ClassAllocator<RamCacheCLFUSEntry> ramCacheCLFUSEntryAllocator("RamCacheCLFUSEntry");
-const static int bucket_sizes[] = {
+static const int bucket_sizes[] = {
127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139,
524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859,
134217689, 268435399, 536870909, 1073741789, 2147483647
4 iocore/cache/RamCacheLRU.cc
View
@@ -32,7 +32,7 @@ struct RamCacheLRUEntry {
Ptr<IOBufferData> data;
};
-struct RamCacheLRU : RamCache {
+struct RamCacheLRU: public RamCache {
int64 max_bytes;
int64 bytes;
int64 objects;
@@ -60,7 +60,7 @@ struct RamCacheLRU : RamCache {
ClassAllocator<RamCacheLRUEntry> ramCacheLRUEntryAllocator("RamCacheLRUEntry");
-const static int bucket_sizes[] = {
+static const int bucket_sizes[] = {
127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139,
524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859,
134217689, 268435399, 536870909
10 iocore/cache/Store.cc
View
@@ -216,7 +216,7 @@ get_int64(int fd, int64 & data)
// the above line will guarantee buf to be no longer than PATH_NAME_MAX
// so the next statement should be a safe use of sscanf
// coverity[secure_coding]
- if (sscanf(buf, "%llu", &data) != 1) {
+ if (sscanf(buf, "%lld", &data) != 1) {
return (-1);
}
return 0;
@@ -866,7 +866,7 @@ Span::write(int fd)
if (ink_file_fd_writestring(fd, "\n") == -1)
return (-1);
- snprintf(buf, sizeof(buf), "%llu\n", blocks);
+ snprintf(buf, sizeof(buf), "%lld\n", blocks);
if (ink_file_fd_writestring(fd, buf) == -1)
return (-1);
@@ -874,11 +874,11 @@ Span::write(int fd)
if (ink_file_fd_writestring(fd, buf) == -1)
return (-1);
- snprintf(buf, sizeof(buf), "%llu\n", offset);
+ snprintf(buf, sizeof(buf), "%lld\n", offset);
if (ink_file_fd_writestring(fd, buf) == -1)
return (-1);
- snprintf(buf, sizeof(buf), "%u\n", (int) is_mmapable());
+ snprintf(buf, sizeof(buf), "%d\n", (int) is_mmapable());
if (ink_file_fd_writestring(fd, buf) == -1)
return (-1);
@@ -955,7 +955,7 @@ Span::read(int fd)
// the above line will guarantee buf to be no longer than PATH_NAME_MAX
// so the next statement should be a safe use of sscanf
// coverity[secure_coding]
- if (sscanf(buf, "%u", &tmp) != 1)
+ if (sscanf(buf, "%d", &tmp) != 1)
return (-1);
set_mmapable(tmp != 0);
10 iocore/cluster/ClusterAPI.cc
View
@@ -50,7 +50,6 @@ typedef struct node_callout_entry
static ProxyMutex *ClusterAPI_mutex;
static ClusterAPIPeriodicSM *periodicSM;
-static Action *periodicSM_action;
static node_callout_entry_t status_callouts[MAX_CLUSTERSTATUS_CALLOUTS];
static INKClusterRPCFunction RPC_Functions[API_END_CLUSTER_FUNCTION];
@@ -121,6 +120,8 @@ MachineStatusSM(INKClusterStatusHandle_t sh):
int
MachineStatusSM::MachineStatusSMEvent(Event * e, void *d)
{
+ NOWARN_UNUSED(e);
+ NOWARN_UNUSED(d);
int n;
EThread *et = this_ethread();
@@ -291,7 +292,8 @@ clusterAPI_init()
ink_release_assert(lock); // Should never fail
periodicSM = NEW(new ClusterAPIPeriodicSM(ClusterAPI_mutex));
- periodicSM_action = eventProcessor.schedule_every(periodicSM, HRTIME_SECONDS(1), ET_CALL);
+ // TODO: Should we do something with this return value?
+ eventProcessor.schedule_every(periodicSM, HRTIME_SECONDS(1), ET_CALL);
}
/*
@@ -375,10 +377,6 @@ INKEnableClusterStatusCallout(INKClusterStatusHandle_t * h)
int ci = CLUSTER_STATUS_HANDLE_TO_INDEX(*h);
// This isn't used.
// int my_ipaddr = (this_cluster_machine())->ip;
- EThread *e = this_ethread();
-
- NOWARN_UNUSED(e);
-
ink_release_assert((ci >= 0) && (ci < MAX_CLUSTERSTATUS_CALLOUTS));
if (status_callouts[ci].state == NE_STATE_INITIALIZED) {
17 iocore/cluster/ClusterCache.cc
View
@@ -311,6 +311,7 @@ ClusterVConnectionCache::lookup(INK_MD5 * key)
int
ClusterVConnectionCacheEvent::eventHandler(int event, Event * e)
{
+ NOWARN_UNUSED(event);
CLUSTER_INCREMENT_DYN_STAT(CLUSTER_VC_CACHE_SCANS_STAT);
MUTEX_TRY_LOCK(lock, cache->hash_lock[hash_index], this_ethread());
if (!lock) {
@@ -796,6 +797,7 @@ CacheContinuation::lookupOpenWriteVCEvent(int event, Event * e)
int
CacheContinuation::remove_and_delete(int event, Event * e)
{
+ NOWARN_UNUSED(event);
unsigned int hash = FOLDHASH(target_ip, seq_number);
MUTEX_TRY_LOCK(queuelock, remoteCacheContQueueMutex[hash], this_ethread());
if (queuelock) {
@@ -1360,13 +1362,10 @@ cache_op_ClusterFunction(ClusterMachine * from, void *data, int len)
p += res;
CacheKey key(msg->url_md5);
-
char *hostname = NULL;
- int host_len = 0;
if (moi_len) {
hostname = (char *) p;
- host_len = moi_len;
}
Cache *call_cache = caches[c->frag_type];
@@ -1856,6 +1855,7 @@ CacheContinuation::setupReadBufTunnel(VConnection * cache_read_vc, VConnection *
int
CacheContinuation::tunnelClosedEvent(int event, void *c)
{
+ NOWARN_UNUSED(event);
ink_assert(magicno == (int) MagicNo);
// Note: We are called with the tunnel_mutex held.
CacheContinuation *tc = (CacheContinuation *) c;
@@ -1941,6 +1941,7 @@ CacheContinuation::disposeOfDataBuffer(void *d)
int
CacheContinuation::handleDisposeEvent(int event, CacheContinuation * cc)
{
+ NOWARN_UNUSED(event);
ink_assert(cc->magicno == (int) MagicNo);
MUTEX_TRY_LOCK(lock, cc->tunnel_mutex, this_ethread());
if (lock) {
@@ -2473,6 +2474,7 @@ CacheContinuation::remoteOpEvent(int event_code, Event * e)
int
CacheContinuation::probeLookupEvent(int event, void *d)
{
+ NOWARN_UNUSED(d);
ink_assert(magicno == (int) MagicNo);
callback_user(event, 0);
return EVENT_DONE;
@@ -2485,6 +2487,8 @@ CacheContinuation::probeLookupEvent(int event, void *d)
int
CacheContinuation::lookupEvent(int event, void *d)
{
+ NOWARN_UNUSED(event);
+ NOWARN_UNUSED(d);
ink_release_assert(!"Invalid call CacheContinuation::lookupEvent");
return EVENT_DONE;
@@ -2676,6 +2680,7 @@ cache_lookup_ClusterFunction(ClusterMachine * from, void *data, int len)
int
CacheContinuation::replyLookupEvent(int event, void *d)
{
+ NOWARN_UNUSED(d);
ink_hrtime now;
now = ink_get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CACHE_CALLBACK_TIME_STAT, now - start_time);
@@ -2781,6 +2786,8 @@ CacheContinuation::insert_cache_callback_user(ClusterVConnection * vc, int res,
int
CacheContinuation::insertCallbackEvent(int event, Event * e)
{
+ NOWARN_UNUSED(event);
+ NOWARN_UNUSED(e);
if (GlobalOpenWriteVCcache->insert(&url_md5, (ClusterVConnection *)
callback_data_2)) {
// Inserted
@@ -2833,6 +2840,8 @@ CacheContinuation::defer_callback_result(int r, void *e)
int
CacheContinuation::callbackResultEvent(int event, Event * e)
{
+ NOWARN_UNUSED(event);
+ NOWARN_UNUSED(e);
if (!action.cancelled)
action.continuation->handleEvent(result, callback_data);
cacheContAllocator_free(this);
@@ -2909,6 +2918,8 @@ CacheContinuation::callback_failure(Action * a, int result, int err, CacheContin
int
CacheContinuation::callbackEvent(int event, Event * e)
{
+ NOWARN_UNUSED(event);
+ NOWARN_UNUSED(e);
if (!action.cancelled)
action.continuation->handleEvent(result, (void *)(intptr_t)result_error);
cacheContAllocator_free(this);
94 iocore/cluster/ClusterConfig.cc
View
@@ -32,15 +32,14 @@
int cluster_port = DEFAULT_CLUSTER_PORT_NUMBER;
ClusterAccept::ClusterAccept(int *port, int send_bufsize, int recv_bufsize)
- :
-Continuation(0),
-p_cluster_port(port),
-socket_send_bufsize(send_bufsize),
-socket_recv_bufsize(recv_bufsize),
-socket_opt_flags(0),
-current_cluster_port(-1),
-accept_action(0),
-periodic_event(0)
+ : Continuation(0),
+ p_cluster_port(port),
+ socket_send_bufsize(send_bufsize),
+ socket_recv_bufsize(recv_bufsize),
+ socket_opt_flags(0),
+ current_cluster_port(-1),
+ accept_action(0),
+ periodic_event(0)
{
mutex = new_ProxyMutex();
SET_HANDLER(&ClusterAccept::ClusterAcceptEvent);
@@ -152,10 +151,12 @@ ClusterAccept::ClusterAcceptMachine(NetVConnection * NetVC)
static void
make_cluster_connections(MachineList * l, MachineList * old)
{
+ NOWARN_UNUSED(old);
//
// Connect to all new machines.
//
uint32 ip = this_cluster_machine()->ip;
+
if (l) {
for (int i = 0; i < l->n; i++)
#ifdef LOCAL_CLUSTER_TEST_MODE
@@ -170,6 +171,9 @@ make_cluster_connections(MachineList * l, MachineList * old)
int
machine_config_change(const char *name, RecDataT data_type, RecData data, void *cookie)
{
+ NOWARN_UNUSED(name);
+ NOWARN_UNUSED(data);
+ NOWARN_UNUSED(data_type);
// Handle changes to the cluster.config or machines.config
// file. cluster.config is the list of machines in the
// cluster proper ( in the cluster hash table ). machines.config
@@ -228,36 +232,33 @@ ClusterConfiguration::ClusterConfiguration():n_machines(0), changed(0)
/*************************************************************************/
struct ConfigurationContinuation;
typedef int (ConfigurationContinuation::*CfgContHandler) (int, void *);
-struct ConfigurationContinuation:
- Continuation
+struct ConfigurationContinuation: public Continuation
{
- ClusterConfiguration *
- c;
- ClusterConfiguration *
- prev;
+ ClusterConfiguration *c;
+ ClusterConfiguration *prev;
+
int
zombieEvent(int event, Event * e)
{
+ NOWARN_UNUSED(event);
prev->link.next = NULL; // remove that next pointer
SET_HANDLER((CfgContHandler) & ConfigurationContinuation::dieEvent);
- e->
- schedule_in(CLUSTER_CONFIGURATION_ZOMBIE);
- return
- EVENT_CONT;
+ e->schedule_in(CLUSTER_CONFIGURATION_ZOMBIE);
+ return EVENT_CONT;
}
+
int
dieEvent(int event, Event * e)
{
(void) event;
(void) e;
- delete
- c;
- delete
- this;
+ delete c;
+ delete this;
return EVENT_DONE;
}
+
ConfigurationContinuation(ClusterConfiguration * cc, ClusterConfiguration * aprev)
-: Continuation(NULL), c(cc), prev(aprev) {
+ : Continuation(NULL), c(cc), prev(aprev) {
mutex = new_ProxyMutex();
SET_HANDLER((CfgContHandler) & ConfigurationContinuation::zombieEvent);
}
@@ -283,14 +284,10 @@ configuration_add_machine(ClusterConfiguration * c, ClusterMachine * m)
// Build a new cluster configuration with the new machine.
// Machines are stored in ip sorted order.
//
- EThread *
- thread = this_ethread();
- ProxyMutex *
- mutex = thread->mutex;
- int
- i = 0;
- ClusterConfiguration *
- cc = NEW(new ClusterConfiguration(*c));
+ EThread *thread = this_ethread();
+ ProxyMutex *mutex = thread->mutex;
+ int i = 0;
+ ClusterConfiguration *cc = NEW(new ClusterConfiguration(*c));
// Find the place to insert this new machine
//
@@ -324,15 +321,13 @@ configuration_add_machine(ClusterConfiguration * c, ClusterMachine * m)
ClusterConfiguration *
configuration_remove_machine(ClusterConfiguration * c, ClusterMachine * m)
{
- EThread *
- thread = this_ethread();
- ProxyMutex *
- mutex = thread->mutex;
+ EThread *thread = this_ethread();
+ ProxyMutex *mutex = thread->mutex;
+
//
// Build a new cluster configuration without a machine
//
- ClusterConfiguration *
- cc = NEW(new ClusterConfiguration(*c));
+ ClusterConfiguration *cc = NEW(new ClusterConfiguration(*c));
//
// remove m and move others down
//
@@ -369,12 +364,11 @@ configuration_remove_machine(ClusterConfiguration * c, ClusterMachine * m)
int
cluster_machine_depth_list(unsigned int hash, ClusterMachine ** depth_list, int depth_list_size)
{
- int
- n = 0;
- ClusterConfiguration *
- cc = this_cluster()->current_configuration();
- ClusterMachine *
- m = cc->machine_hash(hash);
+ NOWARN_UNUSED(depth_list_size);
+ int n = 0;
+ ClusterConfiguration *cc = this_cluster()->current_configuration();
+ ClusterMachine *m = cc->machine_hash(hash);
+
depth_list[n++] = m;
cc = cc->link.next;
@@ -410,14 +404,10 @@ cluster_machine_at_depth(unsigned int hash, int *pprobe_depth, ClusterMachine **
cc = this_cluster()->current_configuration();
ClusterConfiguration *
next_cc = cc;
- ink_hrtime
- now = ink_get_hrtime();
- int
- fake_probe_depth = 0;
- int &
- probe_depth = pprobe_depth ? (*pprobe_depth) : fake_probe_depth;
- int
- tprobe_depth = probe_depth;
+ ink_hrtime now = ink_get_hrtime();
+ int fake_probe_depth = 0;
+ int &probe_depth = pprobe_depth ? (*pprobe_depth) : fake_probe_depth;
+ int tprobe_depth = probe_depth;
#ifdef CLUSTER_TEST
if (cc->n_machines > 1) {
2  iocore/cluster/P_ClusterHandler.h
View
@@ -328,7 +328,7 @@ ClusterMsg():descriptor(NULL), iob_descriptor_block(NULL), count(0),
// State for a particular (read/write) direction of a cluster link
//
struct ClusterHandler;
-struct ClusterState:Continuation
+struct ClusterState: public Continuation
{
ClusterHandler *ch;
bool read_channel;
6 iocore/hostdb/HostDB.cc
View
@@ -1082,9 +1082,9 @@ remove_round_robin(HostDBInfo * r, char *hostname, unsigned int ip)
unsigned int rr_ip = rr->info[n].ip();
unsigned char *pip = (unsigned char *) &rr_ip;
#ifdef __alpha
- int nbytes = sprintf(p, "%u.%u.%u.%u ", pip[0], pip[1], pip[2], pip[3]);
+ int nbytes = sprintf(p, "%hu.%hu.%hu.%hu ", pip[0], pip[1], pip[2], pip[3]);
#else
- int nbytes = snprintf(p, bufsize, "%u.%u.%u.%u ", pip[0], pip[1], pip[2], pip[3]);
+ int nbytes = snprintf(p, bufsize, "%hu.%hu.%hu.%hu ", pip[0], pip[1], pip[2], pip[3]);
#endif
p += nbytes;
bufsize -= nbytes;
@@ -2039,7 +2039,7 @@ HostDBContinuation::backgroundEvent(int event, Event * e)
bool HostDBInfo::match(INK_MD5 & md5, int bucket, int buckets)
{
- NOWARN_UNUSED(buckets);
+ NOWARN_UNUSED(bucket);
if (md5[1] != md5_high)
return false;
12 iocore/hostdb/MultiCache.cc
View
@@ -822,7 +822,7 @@ void
MultiCacheBase::print_info(FILE * fp)
{ // STDIO OK
fprintf(fp, " Elements: %-10d\n", totalelements);
- fprintf(fp, " Size (bytes): %-10d\n", totalsize);
+ fprintf(fp, " Size (bytes): %-10u\n", totalsize);
}
@@ -1045,7 +1045,7 @@ MultiCacheBase::sync_all()
//
struct MultiCacheSync;
typedef int (MultiCacheSync::*MCacheSyncHandler) (int, void *);
-struct MultiCacheSync:Continuation
+struct MultiCacheSync: public Continuation
{
int partition;
MultiCacheBase *mc;
@@ -1169,7 +1169,7 @@ struct OffsetTable
struct MultiCacheHeapGC;
typedef int (MultiCacheHeapGC::*MCacheHeapGCHandler) (int, void *);
-struct MultiCacheHeapGC:Continuation
+struct MultiCacheHeapGC: public Continuation
{
Continuation *cont;
MultiCacheBase *mc;
@@ -1351,9 +1351,9 @@ MultiCacheBase::alloc(int *poffset, int asize)
int part = ptr_to_partition((char *) poffset);
if (part < 0)
return NULL;
- UnsunkPtr *p = unsunk[part].alloc(poffset);
- p->offset = offset;
- p->poffset = poffset;
+ UnsunkPtr *up = unsunk[part].alloc(poffset);
+ up->offset = offset;
+ up->poffset = poffset;
Debug("multicache", "alloc unsunk %d at %d part %d offset %d", *poffset, (char *) poffset - data, part, offset);
}
return (void *) p;
4 iocore/net/UnixNetPages.cc
View
@@ -68,9 +68,9 @@ struct ShowNet: public ShowCont
if (port && port != vc->port && port != vc->accept_port)
continue;
char ipbuf[80];
- snprintf(ipbuf, sizeof(ipbuf), "%u.%u.%u.%u", PRINT_IP(vc->ip));
+ snprintf(ipbuf, sizeof(ipbuf), "%hu.%hu.%hu.%hu", PRINT_IP(vc->ip));
char interbuf[80];
- snprintf(interbuf, sizeof(interbuf), "[%s] %u.%u.%u.%u", vc->options.toString(vc->options.addr_binding), PRINT_IP(vc->options.local_addr));
+ snprintf(interbuf, sizeof(interbuf), "[%s] %hu.%hu.%hu.%hu", vc->options.toString(vc->options.addr_binding), PRINT_IP(vc->options.local_addr));
CHECK_SHOW(show("<tr>"
// "<td><a href=\"/connection/%d\">%d</a></td>"
"<td>%d</td>" "<td>%s</td>" // ipbuf
2  iocore/utils/I_OneWayMultiTunnel.h
View
@@ -53,7 +53,7 @@
@see OneWayTunnel
*/
-struct OneWayMultiTunnel:OneWayTunnel
+struct OneWayMultiTunnel: public OneWayTunnel
{
//
// Public Interface
8 iocore/utils/MTInteractor.cc
View
@@ -157,10 +157,14 @@ MTClient::handleAttaching(int event, void *data)
int
MTClient::handleAttached(int event, void *data)
{
+ NOWARN_UNUSED(event);
+ NOWARN_UNUSED(data);
return EVENT_CONT;
-};
+}
int
MTClient::handleDetached(int event, void *data)
{
+ NOWARN_UNUSED(event);
+ NOWARN_UNUSED(data);
return EVENT_CONT;
-};
+}
2  iocore/utils/Machine.cc
View
@@ -96,7 +96,7 @@ ip(aip)
*(uint32 *) & x = (uint32) ip;
const size_t ip_string_size = sizeof(char) * 16;
ip_string = (char *) xmalloc(ip_string_size);
- snprintf(ip_string, ip_string_size, "%u.%u.%u.%u", x[0], x[1], x[2], x[3]);
+ snprintf(ip_string, ip_string_size, "%hu.%hu.%hu.%hu", x[0], x[1], x[2], x[3]);
}
}
4 libinktomi++/ink_queue.cc
View
@@ -482,7 +482,7 @@ ink_freelists_dump_baselinerel(FILE * f)
while (fll) {
int a = fll->fl->allocated - fll->fl->allocated_base;
if (a != 0) {
- fprintf(f, " % 10u | % 10u | % 7u | % 10u | memory/%s\n",
+ fprintf(f, " %10u | %10u | %7u | %10u | memory/%s\n",
(fll->fl->allocated - fll->fl->allocated_base) * fll->fl->type_size,
(fll->fl->count - fll->fl->count_base) * fll->fl->type_size,
fll->fl->count - fll->fl->count_base, fll->fl->type_size, fll->fl->name ? fll->fl->name : "<unknown>");
@@ -503,7 +503,7 @@ ink_freelists_dump(FILE * f)
fll = freelists;
while (fll) {
- fprintf(f, " % 10u | % 10u | % 10u | memory/%s\n",
+ fprintf(f, " %10u | %10u | %10u | memory/%s\n",
fll->fl->allocated * fll->fl->type_size,
fll->fl->count * fll->fl->type_size, fll->fl->type_size, fll->fl->name ? fll->fl->name : "<unknown>");
fll = fll->next;
2  proxy/RegressionSM.h
View
@@ -32,7 +32,7 @@
See RegressionSM.cc at the end for an example
*/
-struct RegressionSM : Continuation {
+struct RegressionSM : public Continuation {
RegressionTest *t; // for use with rprint
2  proxy/api/ts/ts.h
View
@@ -440,7 +440,7 @@ extern "C"
*/
typedef enum
{
- INK_SDK_VERSION_2_0 = 0,
+ INK_SDK_VERSION_2_0 = 0
} INKSDKVersion;
typedef enum
2  proxy/congest/Congestion.h
View
@@ -201,7 +201,7 @@ struct FailHistory
};
-struct CongestionEntry:RequestData
+struct CongestionEntry: public RequestData
{
// key in the hash table;
uint64 m_key;
Please sign in to comment.
Something went wrong with that request. Please try again.