logd: specify clang format
Switch _all_ file's coding style to match to ease all future changes.
SideEffects: None
Test: compile
Bug: 35373582
Change-Id: I470cb17f64fa48f14aafc02f574e296bffe3a3f3
diff --git a/logd/LogTimes.h b/logd/LogTimes.h
index 12df994..23fdf4e 100644
--- a/logd/LogTimes.h
+++ b/logd/LogTimes.h
@@ -18,8 +18,8 @@
#define _LOGD_LOG_TIMES_H__
#include <pthread.h>
-#include <time.h>
#include <sys/types.h>
+#include <time.h>
#include <list>
@@ -38,9 +38,9 @@
bool leadingDropped;
pthread_cond_t threadTriggeredCondition;
pthread_t mThread;
- LogReader &mReader;
- static void *threadStart(void *me);
- static void threadStop(void *me);
+ LogReader& mReader;
+ static void* threadStart(void* me);
+ static void threadStop(void* me);
const unsigned int mLogMask;
const pid_t mPid;
unsigned int skipAhead[LOG_ID_MAX];
@@ -48,20 +48,24 @@
unsigned long mTail;
unsigned long mIndex;
-public:
- LogTimeEntry(LogReader &reader, SocketClient *client, bool nonBlock,
+ public:
+ LogTimeEntry(LogReader& reader, SocketClient* client, bool nonBlock,
unsigned long tail, unsigned int logMask, pid_t pid,
uint64_t start, uint64_t timeout);
- SocketClient *mClient;
+ SocketClient* mClient;
uint64_t mStart;
struct timespec mTimeout;
const bool mNonBlock;
- const uint64_t mEnd; // only relevant if mNonBlock
+ const uint64_t mEnd; // only relevant if mNonBlock
// Protect List manipulations
- static void lock(void) { pthread_mutex_lock(×Lock); }
- static void unlock(void) { pthread_mutex_unlock(×Lock); }
+ static void lock(void) {
+ pthread_mutex_lock(×Lock);
+ }
+ static void unlock(void) {
+ pthread_mutex_unlock(×Lock);
+ }
void startReader_Locked(void);
@@ -72,7 +76,9 @@
pthread_cond_signal(&threadTriggeredCondition);
}
- void triggerSkip_Locked(log_id_t id, unsigned int skip) { skipAhead[id] = skip; }
+ void triggerSkip_Locked(log_id_t id, unsigned int skip) {
+ skipAhead[id] = skip;
+ }
void cleanSkip_Locked(void);
// These called after LogTimeEntry removed from list, lock implicitly held
@@ -93,16 +99,28 @@
}
// Called to mark socket in jeopardy
- void error_Locked(void) { mError = true; }
- void error(void) { lock(); error_Locked(); unlock(); }
+ void error_Locked(void) {
+ mError = true;
+ }
+ void error(void) {
+ lock();
+ error_Locked();
+ unlock();
+ }
- bool isError_Locked(void) const { return mRelease || mError; }
+ bool isError_Locked(void) const {
+ return mRelease || mError;
+ }
// Mark Used
// Locking implied, grabbed when protection around loop iteration
- void incRef_Locked(void) { ++mRefCount; }
+ void incRef_Locked(void) {
+ ++mRefCount;
+ }
- bool owned_Locked(void) const { return mRefCount != 0; }
+ bool owned_Locked(void) const {
+ return mRefCount != 0;
+ }
void decRef_Locked(void) {
if ((mRefCount && --mRefCount) || !mRelease || threadRunning) {
@@ -111,12 +129,14 @@
// No one else is holding a reference to this
delete this;
}
- bool isWatching(log_id_t id) { return (mLogMask & (1<<id)) != 0; }
+ bool isWatching(log_id_t id) {
+ return (mLogMask & (1 << id)) != 0;
+ }
// flushTo filter callbacks
- static int FilterFirstPass(const LogBufferElement *element, void *me);
- static int FilterSecondPass(const LogBufferElement *element, void *me);
+ static int FilterFirstPass(const LogBufferElement* element, void* me);
+ static int FilterSecondPass(const LogBufferElement* element, void* me);
};
-typedef std::list<LogTimeEntry *> LastLogTimes;
+typedef std::list<LogTimeEntry*> LastLogTimes;
-#endif // _LOGD_LOG_TIMES_H__
+#endif // _LOGD_LOG_TIMES_H__