From c7bf588b3d56b1fdbb66e34d9ba74ce6503d3328 Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Tue, 7 Aug 2012 17:12:08 +0200 Subject: [PATCH] Moved CBDATA_CLASS declarations to the end of classes as per coding guidelines. --- src/DiskIO/AIO/AIODiskFile.h | 2 +- src/DiskIO/Blocking/BlockingFile.h | 3 ++- src/DiskIO/DiskDaemon/DiskdFile.h | 3 ++- src/DiskIO/DiskThreads/DiskThreadsDiskFile.h | 3 ++- src/DiskIO/Mmapped/MmappedFile.h | 4 ++-- src/MemBuf.h | 5 +++-- src/StoreClient.h | 4 +++- src/acl/FilledChecklist.h | 6 ++---- src/client_side.h | 6 ++++-- src/client_side_reply.h | 3 ++- src/client_side_request.h | 4 +++- src/esi/Context.h | 3 ++- src/fs/coss/CossSwapDir.h | 3 ++- src/fs/ufs/ufscommon.h | 9 ++++++--- 14 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/DiskIO/AIO/AIODiskFile.h b/src/DiskIO/AIO/AIODiskFile.h index 1d5e9a195b..76d06a614b 100644 --- a/src/DiskIO/AIO/AIODiskFile.h +++ b/src/DiskIO/AIO/AIODiskFile.h @@ -71,7 +71,6 @@ public: virtual bool ioInProgress() const; private: - CBDATA_CLASS(AIODiskFile); void error(bool const &); int fd; String path; @@ -79,6 +78,7 @@ private: RefCount ioRequestor; bool closed; bool error_; + CBDATA_CLASS(AIODiskFile); }; #endif /* USE_DISKIO_AIO */ diff --git a/src/DiskIO/Blocking/BlockingFile.h b/src/DiskIO/Blocking/BlockingFile.h index 6540df2979..29c1ca1c45 100644 --- a/src/DiskIO/Blocking/BlockingFile.h +++ b/src/DiskIO/Blocking/BlockingFile.h @@ -62,7 +62,6 @@ public: private: static DRCB ReadDone; static DWCB WriteDone; - CBDATA_CLASS(BlockingFile); int fd; bool closed; void error (bool const &); @@ -74,6 +73,8 @@ private: void doClose(); void readDone(int fd, const char *buf, int len, int errflag); void writeDone(int fd, int errflag, size_t len); + + CBDATA_CLASS(BlockingFile); }; #endif /* SQUID_BLOCKINGFILE_H */ diff --git a/src/DiskIO/DiskDaemon/DiskdFile.h b/src/DiskIO/DiskDaemon/DiskdFile.h index f266164a36..e0278446aa 100644 --- a/src/DiskIO/DiskDaemon/DiskdFile.h +++ b/src/DiskIO/DiskDaemon/DiskdFile.h @@ -74,7 +74,6 @@ private: bool errorOccured; DiskdIOStrategy *IO; RefCount ioRequestor; - CBDATA_CLASS(DiskdFile); void openDone(diomsg *); void createDone (diomsg *); void readDone (diomsg *); @@ -86,6 +85,8 @@ private: void ioAway(); void ioCompleted(); size_t inProgressIOs; + + CBDATA_CLASS(DiskdFile); }; #endif diff --git a/src/DiskIO/DiskThreads/DiskThreadsDiskFile.h b/src/DiskIO/DiskThreads/DiskThreadsDiskFile.h index 3642248f55..0225ef0960 100644 --- a/src/DiskIO/DiskThreads/DiskThreadsDiskFile.h +++ b/src/DiskIO/DiskThreads/DiskThreadsDiskFile.h @@ -83,11 +83,12 @@ private: static AIOCB OpenDone; void openDone(int fd, const char *buf, int aio_return, int aio_errno); RefCount ioRequestor; - CBDATA_CLASS(DiskThreadsDiskFile); void doClose(); void readDone(int fd, const char *buf, int len, int errflag, RefCount request); void writeDone(int fd, int errflag, size_t len, RefCount request); + + CBDATA_CLASS(DiskThreadsDiskFile); }; #include "DiskIO/ReadRequest.h" diff --git a/src/DiskIO/Mmapped/MmappedFile.h b/src/DiskIO/Mmapped/MmappedFile.h index 6d1737755a..128ea3c6df 100644 --- a/src/DiskIO/Mmapped/MmappedFile.h +++ b/src/DiskIO/Mmapped/MmappedFile.h @@ -26,8 +26,6 @@ public: virtual bool ioInProgress() const; private: - CBDATA_CLASS(MmappedFile); - char const *path_; RefCount ioRequestor; //RefCount readRequest; @@ -41,6 +39,8 @@ private: bool error_; void doClose(); + + CBDATA_CLASS(MmappedFile); }; #endif /* SQUID_MMAPPEDFILE_H */ diff --git a/src/MemBuf.h b/src/MemBuf.h index c682a7bdf0..4f6ea78297 100644 --- a/src/MemBuf.h +++ b/src/MemBuf.h @@ -134,8 +134,6 @@ private: void grow(mb_size_t min_cap); - CBDATA_CLASS2(MemBuf); - public: /** \deprecated use space*() and content*() methods to access safely instead. @@ -167,6 +165,9 @@ public: unsigned valid:1; /* to be used for debugging only! */ #endif + +private: + CBDATA_CLASS2(MemBuf); }; #if _USE_INLINE_ diff --git a/src/StoreClient.h b/src/StoreClient.h index db1aee6110..8749ed1b0a 100644 --- a/src/StoreClient.h +++ b/src/StoreClient.h @@ -99,7 +99,6 @@ public: StoreIOBuffer copyInto; private: - CBDATA_CLASS(store_client); void fileRead(); void scheduleDiskRead(); void scheduleMemRead(); @@ -122,6 +121,9 @@ public: STCB *callback_handler; void *callback_data; } _callback; + +private: + CBDATA_CLASS(store_client); }; SQUIDCEXTERN void storeClientCopy(store_client *, StoreEntry *, StoreIOBuffer, STCB *, void *); diff --git a/src/acl/FilledChecklist.h b/src/acl/FilledChecklist.h index 968bf2bd89..dbc297de37 100644 --- a/src/acl/FilledChecklist.h +++ b/src/acl/FilledChecklist.h @@ -73,18 +73,16 @@ public: ExternalACLEntry *extacl_entry; private: - CBDATA_CLASS(ACLFilledChecklist); - ConnStateData * conn_; /**< hack for ident and NTLM */ int fd_; /**< may be available when conn_ is not */ bool destinationDomainChecked_; bool sourceDomainChecked_; - -private: /// not implemented; will cause link failures if used ACLFilledChecklist(const ACLFilledChecklist &); /// not implemented; will cause link failures if used ACLFilledChecklist &operator=(const ACLFilledChecklist &); + + CBDATA_CLASS(ACLFilledChecklist); }; /// convenience and safety wrapper for dynamic_cast diff --git a/src/client_side.h b/src/client_side.h index 50a80c25fe..6713da50f9 100644 --- a/src/client_side.h +++ b/src/client_side.h @@ -147,7 +147,6 @@ protected: void wroteControlMsg(const Comm::ConnectionPointer &conn, char *bufnotused, size_t size, comm_err_t errflag, int xerrno); private: - CBDATA_CLASS(ClientSocketContext); void prepareReply(HttpReply * rep); void packChunk(const StoreIOBuffer &bodyData, MemBuf &mb); void packRange(StoreIOBuffer const &, MemBuf * mb); @@ -159,6 +158,8 @@ private: bool mayUseConnection_; /* This request may use the connection. Don't read anymore requests for now */ bool connRegistered_; + + CBDATA_CLASS(ClientSocketContext); }; @@ -380,7 +381,6 @@ private: HttpParser parser_; // XXX: CBDATA plays with public/private and leaves the following 'private' fields all public... :( - CBDATA_CLASS2(ConnStateData); #if USE_SSL bool switchedToHttps_; @@ -401,6 +401,8 @@ private: AsyncCall::Pointer reader; ///< set when we are reading BodyPipe::Pointer bodyPipe; // set when we are reading request body + + CBDATA_CLASS2(ConnStateData); }; /* convenience class while splitting up body handling */ diff --git a/src/client_side_reply.h b/src/client_side_reply.h index 26d9d11d05..a063994001 100644 --- a/src/client_side_reply.h +++ b/src/client_side_reply.h @@ -120,7 +120,6 @@ public: clientStreamNode *ourNode; /* This will go away if/when this file gets refactored some more */ private: - CBDATA_CLASS(clientReplyContext); clientStreamNode *getNextNode() const; void makeThisHead(); bool errorInStream(StoreIOBuffer const &result, size_t const &sizeToProcess)const ; @@ -153,6 +152,8 @@ private: StoreEntry *old_entry; store_client *old_sc; /* ... for entry to be validated */ bool deleting; + + CBDATA_CLASS(clientReplyContext); }; #endif /* SQUID_CLIENTSIDEREPLY_H */ diff --git a/src/client_side_request.h b/src/client_side_request.h index bdf3c09148..517ee698b3 100644 --- a/src/client_side_request.h +++ b/src/client_side_request.h @@ -148,7 +148,6 @@ public: #endif private: - CBDATA_CLASS(ClientHttpRequest); int64_t maxReplyBodySize_; StoreEntry *entry_; StoreEntry *loggingEntry_; @@ -200,6 +199,9 @@ private: bool request_satisfaction_mode; int64_t request_satisfaction_offset; #endif + +private: + CBDATA_CLASS(ClientHttpRequest); }; /* client http based routines */ diff --git a/src/esi/Context.h b/src/esi/Context.h index bf958dc59e..3294435eb8 100644 --- a/src/esi/Context.h +++ b/src/esi/Context.h @@ -149,7 +149,6 @@ public: bool cachedASTInUse; private: - CBDATA_CLASS(ESIContext); void fail (); void freeResources(); void fixupOutboundTail(); @@ -168,6 +167,8 @@ private: virtual void parserDefault (const char *s, int len); virtual void parserComment (const char *s); bool processing; + + CBDATA_CLASS(ESIContext); }; #endif /* SQUID_ESICONTEXT_H */ diff --git a/src/fs/coss/CossSwapDir.h b/src/fs/coss/CossSwapDir.h index 8279d27c49..642b27ce4c 100644 --- a/src/fs/coss/CossSwapDir.h +++ b/src/fs/coss/CossSwapDir.h @@ -136,13 +136,14 @@ public: virtual StoreEntry *currentItem(); private: - CBDATA_CLASS2(StoreSearchCoss); RefCount sd; void (*callback)(void *cbdata); void *cbdata; bool _done; dlink_node * current; dlink_node * next_; + + CBDATA_CLASS2(StoreSearchCoss); }; #endif diff --git a/src/fs/ufs/ufscommon.h b/src/fs/ufs/ufscommon.h index 0ddde25967..578af1f10f 100644 --- a/src/fs/ufs/ufscommon.h +++ b/src/fs/ufs/ufscommon.h @@ -285,10 +285,11 @@ protected: char *read_buf; private: - CBDATA_CLASS(UFSStoreState); void openDone(); void freePending(); void doWrite(); + + CBDATA_CLASS(UFSStoreState); }; MEMPROXY_CLASS_INLINE(UFSStoreState::_queued_read); @@ -327,12 +328,13 @@ public: RemovalPolicyWalker *walker; private: - CBDATA_CLASS2(StoreSearchUFS); /// \bug (callback) should be hidden behind a proper human readable name void (callback)(void *cbdata); void *cbdata; StoreEntry * current; bool _done; + + CBDATA_CLASS2(StoreSearchUFS); }; @@ -402,7 +404,6 @@ public: struct _store_rebuild_data counts; private: - CBDATA_CLASS2(RebuildState); void rebuildFromDirectory(); void rebuildFromSwapLog(); void rebuildStep(); @@ -416,6 +417,8 @@ private: /// \bug (callback) should be hidden behind a proper human readable name void (callback)(void *cbdata); void *cbdata; + + CBDATA_CLASS2(RebuildState); }; #if _USE_INLINE_ -- 2.47.2