diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-12-15 19:44:48 +0100 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-12-19 21:13:32 +0100 |
commit | 89473cc9ae950bbb5e291d1f186d372f66f66394 (patch) | |
tree | d1e21dbd0df28c00c467695711c8dde884e746a1 /Settings.c | |
parent | d872e363081a892d65dede6a90721d3a2e8b0ee6 (diff) |
Rework enum ProcessField
Use only one enum instead of a global and a platform specific one.
Drop Platform_numberOfFields global variable.
Set known size of Process_fields array
Diffstat (limited to 'Settings.c')
-rw-r--r-- | Settings.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -96,10 +96,10 @@ static void readFields(ProcessField* fields, uint32_t* flags, const char* line) free(trim); int i, j; *flags = 0; - for (j = 0, i = 0; i < Platform_numberOfFields && ids[i]; i++) { + for (j = 0, i = 0; i < LAST_PROCESSFIELD && ids[i]; i++) { // This "+1" is for compatibility with the older enum format. int id = atoi(ids[i]) + 1; - if (id > 0 && id < Platform_numberOfFields && Process_fields[id].name) { + if (id > 0 && id < LAST_PROCESSFIELD && Process_fields[id].name) { fields[j] = id; *flags |= Process_fields[id].flags; j++; @@ -355,7 +355,7 @@ Settings* Settings_new(int initialCpuCount) { #ifdef HAVE_LIBHWLOC this->topologyAffinity = false; #endif - this->fields = xCalloc(Platform_numberOfFields + 1, sizeof(ProcessField)); + this->fields = xCalloc(LAST_PROCESSFIELD + 1, sizeof(ProcessField)); // TODO: turn 'fields' into a Vector, // (and ProcessFields into proper objects). this->flags = 0; |