summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSohaib Mohamed <sohaib.amhmd@gmail.com>2021-10-26 13:07:24 +0200
committerNathan Scott <nathans@redhat.com>2021-12-07 17:04:49 +1100
commitba3a1df8069ca6aa858ed2c79ad9ace63883b70b (patch)
tree54daf5321e64ef2b0da4d5b429ad075be777e54d
parentb672e60886a9f1473d437d065de2d86b4febc543 (diff)
Fix misc styleguide issues and add missing header files
Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
-rw-r--r--ScreenManager.c1
-rw-r--r--ScreensPanel.c11
-rw-r--r--ScreensPanel.h7
-rw-r--r--Settings.c8
-rw-r--r--pcp/PCPMetric.c2
5 files changed, 17 insertions, 12 deletions
diff --git a/ScreenManager.c b/ScreenManager.c
index d45f3afc..b5e73db3 100644
--- a/ScreenManager.c
+++ b/ScreenManager.c
@@ -16,6 +16,7 @@ in the source distribution for its full text.
#include "CRT.h"
#include "FunctionBar.h"
+#include "Macros.h"
#include "Object.h"
#include "Platform.h"
#include "ProcessList.h"
diff --git a/ScreensPanel.c b/ScreensPanel.c
index 845c4945..3eacacd6 100644
--- a/ScreensPanel.c
+++ b/ScreensPanel.c
@@ -6,16 +6,17 @@ in the source distribution for its full text.
*/
#include "ScreensPanel.h"
-#include "Platform.h"
-#include "CRT.h"
-#include "XUtils.h"
-
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
+#include "CRT.h"
+#include "FunctionBar.h"
+#include "Hashtable.h"
+#include "ProvideCurses.h"
+#include "XUtils.h"
+
ObjectClass ScreenListItem_class = {
.extends = Class(ListItem),
diff --git a/ScreensPanel.h b/ScreensPanel.h
index 52c5fff3..6c8df805 100644
--- a/ScreensPanel.h
+++ b/ScreensPanel.h
@@ -7,11 +7,14 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
+#include <stdbool.h>
+
+#include "ColumnsPanel.h"
+#include "ListItem.h"
+#include "Object.h"
#include "Panel.h"
#include "ScreenManager.h"
-#include "ColumnsPanel.h"
#include "Settings.h"
-#include "ListItem.h"
#ifndef SCREEN_NAME_LEN
#define SCREEN_NAME_LEN 20
diff --git a/Settings.c b/Settings.c
index b1cf21a0..e587537d 100644
--- a/Settings.c
+++ b/Settings.c
@@ -219,12 +219,12 @@ static int toFieldIndex(Hashtable* columns, const char* str) {
if (sscanf(str, "Dynamic(%30s)", dynamic)) {
char* end;
if ((end = strrchr(dynamic, ')')) != NULL) {
- bool success;
+ bool success;
unsigned int key;
*end = '\0';
success = DynamicColumn_search(columns, dynamic, &key) != NULL;
*end = ')';
- if (success)
+ if (success)
return key;
}
}
@@ -248,7 +248,7 @@ static void ScreenSettings_readFields(ScreenSettings* ss, Hashtable* columns, co
if (j >= UINT_MAX / sizeof(ProcessField))
continue;
if (j >= LAST_PROCESSFIELD) {
- ss->fields = xRealloc(ss->fields, (j+1) * sizeof(ProcessField));
+ ss->fields = xRealloc(ss->fields, (j + 1) * sizeof(ProcessField));
memset(&ss->fields[j], 0, sizeof(ProcessField));
}
int id = toFieldIndex(columns, ids[i]);
@@ -494,7 +494,7 @@ static void writeFields(FILE* fd, const ProcessField* fields, Hashtable* columns
if (fields[i] < LAST_PROCESSFIELD && byName) {
const char* pName = toFieldName(columns, fields[i]);
fprintf(fd, "%s%s", sep, pName);
- } else if(fields[i] >= LAST_PROCESSFIELD && byName) {
+ } else if (fields[i] >= LAST_PROCESSFIELD && byName) {
const char* pName = toFieldName(columns, fields[i]);
fprintf(fd, " Dynamic(%s)", pName);
} else {
diff --git a/pcp/PCPMetric.c b/pcp/PCPMetric.c
index f6d4c97b..606a5df0 100644
--- a/pcp/PCPMetric.c
+++ b/pcp/PCPMetric.c
@@ -166,7 +166,7 @@ bool PCPMetric_fetch(struct timeval* timestamp) {
}
int sts, count = 0;
do {
- sts = pmFetch(pcp->totalMetrics, pcp->fetch, &pcp->result);
+ sts = pmFetch(pcp->totalMetrics, pcp->fetch, &pcp->result);
} while (sts == PM_ERR_IPC && ++count < 3);
if (sts < 0) {
if (pmDebugOptions.appl0)

© 2014-2024 Faster IT GmbH | imprint | privacy policy