mirror of https://github.com/xzeldon/htop.git
Fix whitespace
This commit is contained in:
parent
12805f61d8
commit
9ed47a213b
16
Settings.c
16
Settings.c
|
@ -31,7 +31,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct Settings_ {
|
typedef struct Settings_ {
|
||||||
char* filename;
|
char* filename;
|
||||||
|
|
||||||
MeterColumnSettings columns[2];
|
MeterColumnSettings columns[2];
|
||||||
|
|
||||||
ProcessField* fields;
|
ProcessField* fields;
|
||||||
|
@ -115,7 +115,7 @@ static void Settings_defaultMeters(Settings* this) {
|
||||||
this->columns[i].modes = xCalloc(sizes[i], sizeof(int));
|
this->columns[i].modes = xCalloc(sizes[i], sizeof(int));
|
||||||
this->columns[i].len = sizes[i];
|
this->columns[i].len = sizes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
int r = 0;
|
int r = 0;
|
||||||
if (this->cpuCount > 8) {
|
if (this->cpuCount > 8) {
|
||||||
this->columns[0].names[0] = xStrdup("LeftCPUs2");
|
this->columns[0].names[0] = xStrdup("LeftCPUs2");
|
||||||
|
@ -135,7 +135,7 @@ static void Settings_defaultMeters(Settings* this) {
|
||||||
this->columns[0].modes[1] = BAR_METERMODE;
|
this->columns[0].modes[1] = BAR_METERMODE;
|
||||||
this->columns[0].names[2] = xStrdup("Swap");
|
this->columns[0].names[2] = xStrdup("Swap");
|
||||||
this->columns[0].modes[2] = BAR_METERMODE;
|
this->columns[0].modes[2] = BAR_METERMODE;
|
||||||
|
|
||||||
this->columns[1].names[r] = xStrdup("Tasks");
|
this->columns[1].names[r] = xStrdup("Tasks");
|
||||||
this->columns[1].modes[r++] = TEXT_METERMODE;
|
this->columns[1].modes[r++] = TEXT_METERMODE;
|
||||||
this->columns[1].names[r] = xStrdup("LoadAverage");
|
this->columns[1].names[r] = xStrdup("LoadAverage");
|
||||||
|
@ -166,13 +166,13 @@ static void readFields(ProcessField* fields, int* flags, const char* line) {
|
||||||
|
|
||||||
static bool Settings_read(Settings* this, const char* fileName) {
|
static bool Settings_read(Settings* this, const char* fileName) {
|
||||||
FILE* fd;
|
FILE* fd;
|
||||||
|
|
||||||
CRT_dropPrivileges();
|
CRT_dropPrivileges();
|
||||||
fd = fopen(fileName, "r");
|
fd = fopen(fileName, "r");
|
||||||
CRT_restorePrivileges();
|
CRT_restorePrivileges();
|
||||||
if (!fd)
|
if (!fd)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool didReadMeters = false;
|
bool didReadMeters = false;
|
||||||
bool didReadFields = false;
|
bool didReadFields = false;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -329,7 +329,7 @@ bool Settings_write(Settings* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings* Settings_new(int cpuCount) {
|
Settings* Settings_new(int cpuCount) {
|
||||||
|
|
||||||
Settings* this = xCalloc(1, sizeof(Settings));
|
Settings* this = xCalloc(1, sizeof(Settings));
|
||||||
|
|
||||||
this->sortKey = PERCENT_CPU;
|
this->sortKey = PERCENT_CPU;
|
||||||
|
@ -348,7 +348,7 @@ Settings* Settings_new(int cpuCount) {
|
||||||
this->cpuCount = cpuCount;
|
this->cpuCount = cpuCount;
|
||||||
this->showProgramPath = true;
|
this->showProgramPath = true;
|
||||||
this->highlightThreads = true;
|
this->highlightThreads = true;
|
||||||
|
|
||||||
this->fields = xCalloc(Platform_numberOfFields+1, sizeof(ProcessField));
|
this->fields = xCalloc(Platform_numberOfFields+1, sizeof(ProcessField));
|
||||||
// TODO: turn 'fields' into a Vector,
|
// TODO: turn 'fields' into a Vector,
|
||||||
// (and ProcessFields into proper objects).
|
// (and ProcessFields into proper objects).
|
||||||
|
@ -379,7 +379,7 @@ Settings* Settings_new(int cpuCount) {
|
||||||
htopDir = String_cat(home, "/.config/htop");
|
htopDir = String_cat(home, "/.config/htop");
|
||||||
}
|
}
|
||||||
legacyDotfile = String_cat(home, "/.htoprc");
|
legacyDotfile = String_cat(home, "/.htoprc");
|
||||||
|
|
||||||
CRT_dropPrivileges();
|
CRT_dropPrivileges();
|
||||||
(void) mkdir(configDir, 0700);
|
(void) mkdir(configDir, 0700);
|
||||||
(void) mkdir(htopDir, 0700);
|
(void) mkdir(htopDir, 0700);
|
||||||
|
|
|
@ -22,7 +22,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct Settings_ {
|
typedef struct Settings_ {
|
||||||
char* filename;
|
char* filename;
|
||||||
|
|
||||||
MeterColumnSettings columns[2];
|
MeterColumnSettings columns[2];
|
||||||
|
|
||||||
ProcessField* fields;
|
ProcessField* fields;
|
||||||
|
|
Loading…
Reference in New Issue