From 0a51eae11fdd741c295d7b0390c6d9dbf04468d8 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Sat, 31 Oct 2020 20:39:01 +0100 Subject: Spacing after keywords (while) --- Panel.h | 2 +- RichString.h | 4 ++-- darwin/Platform.c | 4 ++-- htop.c | 4 ++-- linux/LinuxProcessList.c | 14 +++++++------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Panel.h b/Panel.h index 1ada9243..604750a5 100644 --- a/Panel.h +++ b/Panel.h @@ -61,7 +61,7 @@ struct Panel_ { int selectionColor; }; -#define Panel_setDefaultBar(this_) do { (this_)->currentBar = (this_)->defaultBar; } while(0) +#define Panel_setDefaultBar(this_) do { (this_)->currentBar = (this_)->defaultBar; } while (0) #define KEY_CTRL(l) ((l)-'A'+1) diff --git a/RichString.h b/RichString.h index d360299e..11be4137 100644 --- a/RichString.h +++ b/RichString.h @@ -23,13 +23,13 @@ in the source distribution for its full text. #define RichString_printVal(this, y, x) mvadd_wchstr(y, x, (this).chptr) #define RichString_printoffnVal(this, y, x, off, n) mvadd_wchnstr(y, x, (this).chptr + (off), n) #define RichString_getCharVal(this, i) ((this).chptr[i].chars[0] & 255) -#define RichString_setChar(this, at, ch) do { (this)->chptr[(at)] = (CharType) { .chars = { ch, 0 } }; } while(0) +#define RichString_setChar(this, at, ch) do { (this)->chptr[(at)] = (CharType) { .chars = { ch, 0 } }; } while (0) #define CharType cchar_t #else #define RichString_printVal(this, y, x) mvaddchstr(y, x, (this).chptr) #define RichString_printoffnVal(this, y, x, off, n) mvaddchnstr(y, x, (this).chptr + (off), n) #define RichString_getCharVal(this, i) ((this).chptr[i]) -#define RichString_setChar(this, at, ch) do { (this)->chptr[(at)] = ch; } while(0) +#define RichString_setChar(this, at, ch) do { (this)->chptr[(at)] = ch; } while (0) #define CharType chtype #endif diff --git a/darwin/Platform.c b/darwin/Platform.c index b1f9283d..17be92b2 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -286,7 +286,7 @@ char* Platform_getProcessEnv(pid_t pid) { p = strchr(p, 0)+1; // skip padding - while(!*p && p < endp) + while (!*p && p < endp) ++p; // skip argv @@ -294,7 +294,7 @@ char* Platform_getProcessEnv(pid_t pid) { ; // skip padding - while(!*p && p < endp) + while (!*p && p < endp) ++p; size_t size = endp - p; diff --git a/htop.c b/htop.c index e02f388a..f5c35929 100644 --- a/htop.c +++ b/htop.c @@ -190,7 +190,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) { flags.pidMatchList = Hashtable_new(8, false); } - while(pid) { + while (pid) { unsigned int num_pid = atoi(pid); // deepcode ignore CastIntegerToAddress: we just want a non-NUll pointer here Hashtable_put(flags.pidMatchList, num_pid, (void *) 1); @@ -218,7 +218,7 @@ static void millisleep(unsigned long millisec) { .tv_sec = 0, .tv_nsec = millisec * 1000000L }; - while(nanosleep(&req,&req)==-1) { + while (nanosleep(&req,&req)==-1) { continue; } } diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 577412a9..e500f9dc 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -165,7 +165,7 @@ static int LinuxProcessList_computeCPUcount(void) { int cpus = 0; char buffer[PROC_LINE_LENGTH + 1]; - while(fgets(buffer, sizeof(buffer), file)) { + while (fgets(buffer, sizeof(buffer), file)) { if (String_startsWith(buffer, "cpu")) cpus++; } @@ -221,7 +221,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, ui if (statfile == NULL) CRT_fatalError("Cannot open " PROCSTATFILE); - while(true) { + while (true) { char buffer[PROC_LINE_LENGTH + 1]; if (fgets(buffer, sizeof(buffer), statfile) == NULL) { CRT_fatalError("No btime in " PROCSTATFILE); @@ -498,7 +498,7 @@ static bool LinuxProcessList_readSmapsFile(LinuxProcess* process, const char* di while (fgets(buffer, sizeof(buffer), f)) { if(!strchr(buffer, '\n')) { // Partial line, skip to end of this line - while(fgets(buffer, sizeof(buffer), f)) { + while (fgets(buffer, sizeof(buffer), f)) { if(strchr(buffer, '\n')) { break; } @@ -542,10 +542,10 @@ static void LinuxProcessList_readOpenVZData(LinuxProcess* process, const char* d bool foundEnvID = false; bool foundVPid = false; char linebuf[256]; - while(fgets(linebuf, sizeof(linebuf), file) != NULL) { + while (fgets(linebuf, sizeof(linebuf), file) != NULL) { if(strchr(linebuf, '\n') == NULL) { // Partial line, skip to end of this line - while(fgets(linebuf, sizeof(linebuf), file) != NULL) { + while (fgets(linebuf, sizeof(linebuf), file) != NULL) { if(strchr(linebuf, '\n') != NULL) { break; } @@ -569,11 +569,11 @@ static void LinuxProcessList_readOpenVZData(LinuxProcess* process, const char* d do { name_value_sep++; - } while(*name_value_sep != '\0' && *name_value_sep <= 32); + } while (*name_value_sep != '\0' && *name_value_sep <= 32); char* value_end = name_value_sep; - while(*value_end != '\0' && *value_end > 32) { + while (*value_end != '\0' && *value_end > 32) { value_end++; } -- cgit v1.2.3