From e29ccb57d3d2d2ef6124e5cccbe90de54d5cc731 Mon Sep 17 00:00:00 2001 From: Automatic source maintenance Date: Thu, 6 Oct 2011 18:12:29 -0600 Subject: [PATCH] SourceFormat Enforcement --- src/DiskIO/IpcIo/IpcIoFile.cc | 3 +-- src/adaptation/ServiceConfig.cc | 6 +++--- src/client_side.cc | 3 ++- src/fs/rock/RockSwapDir.cc | 8 ++++---- src/ipc/mem/Segment.cc | 2 +- src/ssl/certificate_db.cc | 12 ++++++------ src/ssl/certificate_db.h | 5 +++-- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/DiskIO/IpcIo/IpcIoFile.cc b/src/DiskIO/IpcIo/IpcIoFile.cc index aec7b40700..e0b3e34ee7 100644 --- a/src/DiskIO/IpcIo/IpcIoFile.cc +++ b/src/DiskIO/IpcIo/IpcIoFile.cc @@ -710,8 +710,7 @@ IpcIoFile::WaitBeforePop() toSpend/1e3, 0, false); DiskerHandleMoreRequestsScheduled = true; return true; - } else - if (balance < -maxImbalance) { + } else if (balance < -maxImbalance) { // do not owe "too much" to avoid "too large" bursts of I/O balance = -maxImbalance; } diff --git a/src/adaptation/ServiceConfig.cc b/src/adaptation/ServiceConfig.cc index 1d4a970e9f..b064336685 100644 --- a/src/adaptation/ServiceConfig.cc +++ b/src/adaptation/ServiceConfig.cc @@ -73,7 +73,7 @@ Adaptation::ServiceConfig::parse() bool grokkedUri = false; bool onOverloadSet = false; std::set options; - + while (char *option = strtok(NULL, w_space)) { const char *name = option; const char *value = ""; @@ -99,7 +99,7 @@ Adaptation::ServiceConfig::parse() // Check if option is set twice if (options.find(name) != options.end()) { - debugs(3, DBG_CRITICAL, cfg_filename << ':' << config_lineno << ": " << + debugs(3, DBG_CRITICAL, cfg_filename << ':' << config_lineno << ": " << "Duplicate option \"" << name << "\" in adaptation service definition"); return false; } @@ -134,7 +134,7 @@ Adaptation::ServiceConfig::parse() // is the service URI set? if (!grokkedUri) { - debugs(3, DBG_CRITICAL, cfg_filename << ':' << config_lineno << ": " << + debugs(3, DBG_CRITICAL, cfg_filename << ':' << config_lineno << ": " << "No \"uri\" option in adaptation service definition"); return false; } diff --git a/src/client_side.cc b/src/client_side.cc index 4c2666a451..da3d5cae9f 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -3939,7 +3939,8 @@ ConnStateData::startClosing(const char *reason) } void -ConnStateData::expectNoForwarding() { +ConnStateData::expectNoForwarding() +{ if (bodyPipe != NULL) { debugs(33, 4, HERE << "no consumer for virgin body " << bodyPipe->status()); bodyPipe->expectNoConsumption(); diff --git a/src/fs/rock/RockSwapDir.cc b/src/fs/rock/RockSwapDir.cc index 8924d4321c..316c0a6fec 100644 --- a/src/fs/rock/RockSwapDir.cc +++ b/src/fs/rock/RockSwapDir.cc @@ -242,7 +242,7 @@ Rock::SwapDir::needsDiskStrand() const const bool wontEvenWorkWithoutDisker = Config.workers > 1; const bool wouldWorkBetterWithDisker = DiskIOModule::Find("IpcIo"); return InDaemonMode() && (wontEvenWorkWithoutDisker || - wouldWorkBetterWithDisker); + wouldWorkBetterWithDisker); } void @@ -413,7 +413,7 @@ Rock::SwapDir::validateOptions() // warn if maximum db size is not reachable due to sfileno limit if (entryLimitAllowed() == entryLimitHigh() && - diskWasteSize >= maxRoundingWaste) { + diskWasteSize >= maxRoundingWaste) { debugs(47, DBG_CRITICAL, "Rock store cache_dir[" << index << "] '" << path << "':"); debugs(47, DBG_CRITICAL, "\tmaximum number of entries: " << entryLimitAllowed()); debugs(47, DBG_CRITICAL, "\tmaximum object size: " << maxObjectSize() << " Bytes"); @@ -469,7 +469,7 @@ Rock::SwapDir::canStore(const StoreEntry &e, int64_t diskSpaceNeeded, int &load) // Do not start I/O transaction if there are less than 10% free pages left. // TODO: reserve page instead if (needsDiskStrand() && - Ipc::Mem::PageLevel(Ipc::Mem::PageId::ioPage) >= 0.9 * Ipc::Mem::PageLimit(Ipc::Mem::PageId::ioPage)) { + Ipc::Mem::PageLevel(Ipc::Mem::PageId::ioPage) >= 0.9 * Ipc::Mem::PageLimit(Ipc::Mem::PageId::ioPage)) { debugs(47, 5, HERE << "too few shared pages for IPC I/O left"); return false; } @@ -563,7 +563,7 @@ Rock::SwapDir::openStoreIO(StoreEntry &e, StoreIOState::STFNCB *cbFile, StoreIOS // Do not start I/O transaction if there are less than 10% free pages left. // TODO: reserve page instead if (needsDiskStrand() && - Ipc::Mem::PageLevel(Ipc::Mem::PageId::ioPage) >= 0.9 * Ipc::Mem::PageLimit(Ipc::Mem::PageId::ioPage)) { + Ipc::Mem::PageLevel(Ipc::Mem::PageId::ioPage) >= 0.9 * Ipc::Mem::PageLimit(Ipc::Mem::PageId::ioPage)) { debugs(47, 5, HERE << "too few shared pages for IPC I/O left"); return NULL; } diff --git a/src/ipc/mem/Segment.cc b/src/ipc/mem/Segment.cc index ef51693f60..bb4b543f86 100644 --- a/src/ipc/mem/Segment.cc +++ b/src/ipc/mem/Segment.cc @@ -192,7 +192,7 @@ typedef std::map SegmentMap; static SegmentMap Segments; Ipc::Mem::Segment::Segment(const char *const id): - theName(id), theMem(NULL), theSize(0), theReserved(0), doUnlink(false) + theName(id), theMem(NULL), theSize(0), theReserved(0), doUnlink(false) { } diff --git a/src/ssl/certificate_db.cc b/src/ssl/certificate_db.cc index ebfb14db4d..c2237f1874 100644 --- a/src/ssl/certificate_db.cc +++ b/src/ssl/certificate_db.cc @@ -26,11 +26,11 @@ #define HERE "(ssl_crtd) " << __FILE__ << ':' << __LINE__ << ": " Ssl::Lock::Lock(std::string const &aFilename) : - filename(aFilename), + filename(aFilename), #if _SQUID_MSWIN_ - hFile(INVALID_HANDLE_VALUE) + hFile(INVALID_HANDLE_VALUE) #else - fd(-1) + fd(-1) #endif { } @@ -66,7 +66,7 @@ void Ssl::Lock::lock() } void Ssl::Lock::unlock() -{ +{ #if _SQUID_MSWIN_ if (hFile != INVALID_HANDLE_VALUE) { UnlockFile(hFile, 0, 0, 1, 0); @@ -90,8 +90,8 @@ Ssl::Lock::~Lock() unlock(); } -Ssl::Locker::Locker(Lock &aLock, const char *aFileName, int aLineNo): - weLocked(false), lock(aLock), fileName(aFileName), lineNo(aLineNo) +Ssl::Locker::Locker(Lock &aLock, const char *aFileName, int aLineNo): + weLocked(false), lock(aLock), fileName(aFileName), lineNo(aLineNo) { if (!lock.locked()) { lock.lock(); diff --git a/src/ssl/certificate_db.h b/src/ssl/certificate_db.h index 73ec704705..3035251431 100644 --- a/src/ssl/certificate_db.h +++ b/src/ssl/certificate_db.h @@ -17,7 +17,8 @@ namespace Ssl { /// maintains an exclusive blocking file-based lock -class Lock { +class Lock +{ public: explicit Lock(std::string const &filename); ///< creates an unlocked lock ~Lock(); ///< releases the lock if it is locked @@ -46,7 +47,7 @@ private: bool weLocked; ///< whether we locked the lock Lock &lock; ///< the lock we are operating on const std::string fileName; ///< where the lock was needed - const int lineNo; ///< where the lock was needed + const int lineNo; ///< where the lock was needed }; /// convenience macro to pass source code location to Locker and others -- 2.47.3