Spacing after keywords (for)

This commit is contained in:
Benny Baumann 2020-10-31 20:55:36 +01:00
parent 374edb9ed5
commit adf797c295
8 changed files with 15 additions and 15 deletions

View File

@ -114,7 +114,7 @@ static bool IncMode_find(IncMode* mode, Panel* panel, IncMode_GetPanelValue getP
int size = Panel_size(panel); int size = Panel_size(panel);
int here = Panel_getSelectedIndex(panel); int here = Panel_getSelectedIndex(panel);
int i = here; int i = here;
for(;;) { for (;;) {
i+=step; i+=step;
if (i == size) i = 0; if (i == size) i = 0;
if (i == -1) i = size - 1; if (i == -1) i = size - 1;

View File

@ -52,7 +52,7 @@ int Meter_humanUnit(char* buffer, unsigned long int value, int size) {
unsigned long int powi = 1; unsigned long int powi = 1;
unsigned int written, powj = 1, precision = 2; unsigned int written, powj = 1, precision = 2;
for(;;) { for (;;) {
if (value / 1024 < powi) if (value / 1024 < powi)
break; break;

View File

@ -259,7 +259,7 @@ void Panel_draw(Panel* this, bool focus) {
if (this->needsRedraw) { if (this->needsRedraw) {
int line = 0; int line = 0;
for(int i = first; line < h && i < upTo; i++) { for (int i = first; line < h && i < upTo; i++) {
Object* itemObj = Vector_get(this->items, i); Object* itemObj = Vector_get(this->items, i);
RichString_begin(item); RichString_begin(item);
Object_display(itemObj, &item); Object_display(itemObj, &item);

View File

@ -30,7 +30,7 @@ void Battery_getData(double* level, ACPresence* isOnAC) {
len = CFArrayGetCount(list); len = CFArrayGetCount(list);
/* Get the battery */ /* Get the battery */
for(int i = 0; i < len && battery == NULL; ++i) { for (int i = 0; i < len && battery == NULL; ++i) {
CFDictionaryRef candidate = IOPSGetPowerSourceDescription(power_sources, CFDictionaryRef candidate = IOPSGetPowerSourceDescription(power_sources,
CFArrayGetValueAtIndex(list, i)); /* GET rule */ CFArrayGetValueAtIndex(list, i)); /* GET rule */
CFStringRef type; CFStringRef type;

View File

@ -164,8 +164,8 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
/* Get the time difference */ /* Get the time difference */
dpl->global_diff = 0; dpl->global_diff = 0;
for(int i = 0; i < dpl->super.cpuCount; ++i) { for (int i = 0; i < dpl->super.cpuCount; ++i) {
for(size_t j = 0; j < CPU_STATE_MAX; ++j) { for (size_t j = 0; j < CPU_STATE_MAX; ++j) {
dpl->global_diff += dpl->curr_load[i].cpu_ticks[j] - dpl->prev_load[i].cpu_ticks[j]; dpl->global_diff += dpl->curr_load[i].cpu_ticks[j] - dpl->prev_load[i].cpu_ticks[j];
} }
} }
@ -185,7 +185,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
*/ */
ps = ProcessList_getKInfoProcs(&count); ps = ProcessList_getKInfoProcs(&count);
for(size_t i = 0; i < count; ++i) { for (size_t i = 0; i < count; ++i) {
proc = (DarwinProcess *)ProcessList_getProcess(super, ps[i].kp_proc.p_pid, &preExisting, DarwinProcess_new); proc = (DarwinProcess *)ProcessList_getProcess(super, ps[i].kp_proc.p_pid, &preExisting, DarwinProcess_new);
DarwinProcess_setFromKInfoProc(&proc->super, &ps[i], preExisting); DarwinProcess_setFromKInfoProc(&proc->super, &ps[i], preExisting);

View File

@ -206,7 +206,7 @@ double Platform_setCPUValues(Meter* mtr, int cpu) {
double total = 0; double total = 0;
/* Take the sums */ /* Take the sums */
for(size_t i = 0; i < CPU_STATE_MAX; ++i) { for (size_t i = 0; i < CPU_STATE_MAX; ++i) {
total += (double)curr->cpu_ticks[i] - (double)prev->cpu_ticks[i]; total += (double)curr->cpu_ticks[i] - (double)prev->cpu_ticks[i];
} }

View File

@ -168,7 +168,7 @@ static void Battery_getProcData(double* level, ACPresence* isOnAC) {
static inline ssize_t xread(int fd, void *buf, size_t count) { static inline ssize_t xread(int fd, void *buf, size_t count) {
// Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested. // Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested.
size_t alreadyRead = 0; size_t alreadyRead = 0;
for(;;) { for (;;) {
ssize_t res = read(fd, buf, count); ssize_t res = read(fd, buf, count);
if (res == -1 && errno == EINTR) continue; if (res == -1 && errno == EINTR) continue;
if (res > 0) { if (res > 0) {
@ -282,7 +282,7 @@ static void Battery_getSysData(double* level, ACPresence* isOnAC) {
return; return;
} }
char buffer[2] = ""; char buffer[2] = "";
for(;;) { for (;;) {
ssize_t res = read(fd3, buffer, 1); ssize_t res = read(fd3, buffer, 1);
if (res == -1 && errno == EINTR) continue; if (res == -1 && errno == EINTR) continue;
break; break;

View File

@ -54,7 +54,7 @@ in the source distribution for its full text.
static ssize_t xread(int fd, void *buf, size_t count) { static ssize_t xread(int fd, void *buf, size_t count) {
// Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested. // Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested.
size_t alreadyRead = 0; size_t alreadyRead = 0;
for(;;) { for (;;) {
ssize_t res = read(fd, buf, count); ssize_t res = read(fd, buf, count);
if (res == -1 && errno == EINTR) continue; if (res == -1 && errno == EINTR) continue;
if (res > 0) { if (res > 0) {
@ -81,7 +81,7 @@ static void LinuxProcessList_initTtyDrivers(LinuxProcessList* this) {
char* buf = NULL; char* buf = NULL;
int bufSize = MAX_READ; int bufSize = MAX_READ;
int bufLen = 0; int bufLen = 0;
for(;;) { for (;;) {
buf = xRealloc(buf, bufSize); buf = xRealloc(buf, bufSize);
int size = xread(fd, buf + bufLen, MAX_READ); int size = xread(fd, buf + bufLen, MAX_READ);
if (size <= 0) { if (size <= 0) {
@ -255,7 +255,7 @@ void ProcessList_delete(ProcessList* pl) {
ProcessList_done(pl); ProcessList_done(pl);
free(this->cpus); free(this->cpus);
if (this->ttyDrivers) { if (this->ttyDrivers) {
for(int i = 0; this->ttyDrivers[i].path; i++) { for (int i = 0; this->ttyDrivers[i].path; i++) {
free(this->ttyDrivers[i].path); free(this->ttyDrivers[i].path);
} }
free(this->ttyDrivers); free(this->ttyDrivers);
@ -900,7 +900,7 @@ static char* LinuxProcessList_updateTtyDevice(TtyDriver* ttyDrivers, unsigned in
unsigned int idx = min - ttyDrivers[i].minorFrom; unsigned int idx = min - ttyDrivers[i].minorFrom;
struct stat sstat; struct stat sstat;
char* fullPath; char* fullPath;
for(;;) { for (;;) {
xAsprintf(&fullPath, "%s/%d", ttyDrivers[i].path, idx); xAsprintf(&fullPath, "%s/%d", ttyDrivers[i].path, idx);
int err = stat(fullPath, &sstat); int err = stat(fullPath, &sstat);
if (err == 0 && major(sstat.st_rdev) == maj && minor(sstat.st_rdev) == min) return fullPath; if (err == 0 && major(sstat.st_rdev) == maj && minor(sstat.st_rdev) == min) return fullPath;
@ -1162,7 +1162,7 @@ static inline void LinuxProcessList_scanZramInfo(LinuxProcessList* this) {
char disksize[34]; char disksize[34];
unsigned int i = 0; unsigned int i = 0;
for(;;) { for (;;) {
xSnprintf(mm_stat, sizeof(mm_stat), "/sys/block/zram%u/mm_stat", i); xSnprintf(mm_stat, sizeof(mm_stat), "/sys/block/zram%u/mm_stat", i);
xSnprintf(disksize, sizeof(disksize), "/sys/block/zram%u/disksize", i); xSnprintf(disksize, sizeof(disksize), "/sys/block/zram%u/disksize", i);
i++; i++;