From: Automatic source maintenance Date: Wed, 25 Jun 2014 00:14:36 +0000 (-0600) Subject: SourceFormat Enforcement X-Git-Tag: SQUID_3_5_0_1~167 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2da4bfe6a014dd29a0e00458b1c0cdbeb4d960c6;p=thirdparty%2Fsquid.git SourceFormat Enforcement --- diff --git a/include/splay.h b/include/splay.h index fc48ae12d0..c955514203 100644 --- a/include/splay.h +++ b/include/splay.h @@ -285,7 +285,8 @@ SplayNode::splay(FindValue const &dataToFind, int( * compare)(FindValue const template template void -SplayNode::visit(Visitor &visitor) const { +SplayNode::visit(Visitor &visitor) const +{ if (left) left->visit(visitor); visitor(data); @@ -296,7 +297,8 @@ SplayNode::visit(Visitor &visitor) const { template template void -Splay::visit(Visitor &visitor) const { +Splay::visit(Visitor &visitor) const +{ if (head) head->visit(visitor); } diff --git a/src/Store.h b/src/Store.h index f42dc2d069..f30d83a9f8 100644 --- a/src/Store.h +++ b/src/Store.h @@ -103,7 +103,7 @@ public: virtual bool mayStartSwapOut(); virtual void trimMemory(const bool preserveSwappable); - // called when a decision to cache in memory has been made + // called when a decision to cache in memory has been made void memOutDecision(const bool willCacheInRam); // called when a decision to cache on disk has been made void swapOutDecision(const MemObject::SwapOut::Decision &decision); diff --git a/src/fs/rock/RockSwapDir.cc b/src/fs/rock/RockSwapDir.cc index 6e65ccff05..4b81890c9c 100644 --- a/src/fs/rock/RockSwapDir.cc +++ b/src/fs/rock/RockSwapDir.cc @@ -972,24 +972,24 @@ Rock::SwapDir::statfs(StoreEntry &e) const const int slotLimit = slotLimitActual(); storeAppendPrintf(&e, "Maximum entries: %9d\n", entryLimit); if (map && entryLimit > 0) { - const int entryCount = map->entryCount(); - storeAppendPrintf(&e, "Current entries: %9d %.2f%%\n", - entryCount, (100.0 * entryCount / entryLimit)); + const int entryCount = map->entryCount(); + storeAppendPrintf(&e, "Current entries: %9d %.2f%%\n", + entryCount, (100.0 * entryCount / entryLimit)); } storeAppendPrintf(&e, "Maximum slots: %9d\n", slotLimit); if (map && slotLimit > 0) { - const unsigned int slotsFree = !freeSlots ? 0 : freeSlots->size(); - if (slotsFree <= static_cast(slotLimit)) { - const int usedSlots = slotLimit - static_cast(slotsFree); - storeAppendPrintf(&e, "Used slots: %9d %.2f%%\n", - usedSlots, (100.0 * usedSlots / slotLimit)); - } - if (slotLimit < 100) { // XXX: otherwise too expensive to count - Ipc::ReadWriteLockStats stats; - map->updateStats(stats); - stats.dump(e); - } + const unsigned int slotsFree = !freeSlots ? 0 : freeSlots->size(); + if (slotsFree <= static_cast(slotLimit)) { + const int usedSlots = slotLimit - static_cast(slotsFree); + storeAppendPrintf(&e, "Used slots: %9d %.2f%%\n", + usedSlots, (100.0 * usedSlots / slotLimit)); + } + if (slotLimit < 100) { // XXX: otherwise too expensive to count + Ipc::ReadWriteLockStats stats; + map->updateStats(stats); + stats.dump(e); + } } storeAppendPrintf(&e, "Pending operations: %d out of %d\n", diff --git a/src/ipc/StoreMap.cc b/src/ipc/StoreMap.cc index f50d516f58..f87395931c 100644 --- a/src/ipc/StoreMap.cc +++ b/src/ipc/StoreMap.cc @@ -416,13 +416,15 @@ Ipc::StoreMap::validSlice(const int pos) const } Ipc::StoreMap::Anchor& -Ipc::StoreMap::anchorAt(const sfileno fileno) { +Ipc::StoreMap::anchorAt(const sfileno fileno) +{ assert(validEntry(fileno)); return anchors->items[fileno]; } const Ipc::StoreMap::Anchor& -Ipc::StoreMap::anchorAt(const sfileno fileno) const { +Ipc::StoreMap::anchorAt(const sfileno fileno) const +{ return const_cast(*this).anchorAt(fileno); } @@ -441,13 +443,15 @@ Ipc::StoreMap::anchorByKey(const cache_key *const key) } Ipc::StoreMap::Slice& -Ipc::StoreMap::sliceAt(const SliceId sliceId) { +Ipc::StoreMap::sliceAt(const SliceId sliceId) +{ assert(validSlice(sliceId)); return slices->items[sliceId]; } const Ipc::StoreMap::Slice& -Ipc::StoreMap::sliceAt(const SliceId sliceId) const { +Ipc::StoreMap::sliceAt(const SliceId sliceId) const +{ return const_cast(*this).sliceAt(sliceId); } diff --git a/src/ipc/StoreMap.h b/src/ipc/StoreMap.h index c80452f210..4500d1bf4a 100644 --- a/src/ipc/StoreMap.h +++ b/src/ipc/StoreMap.h @@ -130,7 +130,8 @@ public: public: /// aggregates anchor and slice owners for Init() caller convenience - class Owner { + class Owner + { public: Owner(); ~Owner(); diff --git a/src/store.cc b/src/store.cc index b8bc547775..a52fe2ad48 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1910,11 +1910,12 @@ StoreEntry::getSerialisedMetaData() * to start swapping the entry out. */ void -StoreEntry::transientsAbandonmentCheck() { +StoreEntry::transientsAbandonmentCheck() +{ if (mem_obj && !mem_obj->smpCollapsed && // this worker is responsible - mem_obj->xitTable.index >= 0 && // other workers may be interested - mem_obj->memCache.index < 0 && // rejected by the shared memory cache - mem_obj->swapout.decision == MemObject::SwapOut::swImpossible) { + mem_obj->xitTable.index >= 0 && // other workers may be interested + mem_obj->memCache.index < 0 && // rejected by the shared memory cache + mem_obj->swapout.decision == MemObject::SwapOut::swImpossible) { debugs(20, 7, "cannot be shared: " << *this); if (!shutting_down) // Store::Root() is FATALly missing during shutdown Store::Root().transientsAbandon(*this); @@ -1922,12 +1923,14 @@ StoreEntry::transientsAbandonmentCheck() { } void -StoreEntry::memOutDecision(const bool willCacheInRam) { +StoreEntry::memOutDecision(const bool willCacheInRam) +{ transientsAbandonmentCheck(); } void -StoreEntry::swapOutDecision(const MemObject::SwapOut::Decision &decision) { +StoreEntry::swapOutDecision(const MemObject::SwapOut::Decision &decision) +{ // Abandon our transient entry if neither shared memory nor disk wants it. assert(mem_obj); mem_obj->swapout.decision = decision; diff --git a/src/store_client.cc b/src/store_client.cc index 87e75728d5..d4d2f063e3 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -434,8 +434,7 @@ store_client::scheduleDiskRead() if (getType() == STORE_DISK_CLIENT) { // we should have called startSwapin() already assert(swapin_sio != NULL); - } else - if (!swapin_sio && !startSwapin()) { + } else if (!swapin_sio && !startSwapin()) { debugs(90, 3, "bailing after swapin start failure for " << *entry); assert(!flags.store_copying); return;