summaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorHugo Musso Gualandi <hugo_musso_gualandi@hotmail.com>2020-09-12 18:25:25 -0300
committerHugo Musso Gualandi <hugo_musso_gualandi@hotmail.com>2020-09-12 19:20:44 -0300
commit9207401f9711ba026a70d7dd47347d7eab168b3f (patch)
tree959ae417880dda426e3b1bfea904edc6a90fac0c /Process.c
parentcd55cfd6d263a89bbaf401481ea6bd6a5dd8f110 (diff)
Clean up some code duplication in the header files
PR htop-dev/htop#70 got rid of the infrastructure for generating header files, but it left behind some code duplication. Some of cases are things that belong in the header file and don't need to be repeated in the C file. Other cases are things that belong in the C file and don't need to be in the header file. In this commit I tried to fix all of these that I could find. When given a choice I preferred keeping things out of the header file, unless they were being used by someone else.
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/Process.c b/Process.c
index e7ab4929..7a04c0f9 100644
--- a/Process.c
+++ b/Process.c
@@ -21,7 +21,6 @@ in the source distribution for its full text.
#include <sys/resource.h>
#include <sys/param.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
@@ -37,30 +36,8 @@ in the source distribution for its full text.
#include <sys/sysmacros.h>
#endif
-#ifdef __ANDROID__
-#define SYS_ioprio_get __NR_ioprio_get
-#define SYS_ioprio_set __NR_ioprio_set
-#endif
-
-// On Linux, this works only with glibc 2.1+. On earlier versions
-// the behavior is similar to have a hardcoded page size.
-#ifndef PAGE_SIZE
-#define PAGE_SIZE ( sysconf(_SC_PAGESIZE) )
-#endif
-#define PAGE_SIZE_KB ( PAGE_SIZE / ONE_K )
-
static int Process_getuid = -1;
-#define ONE_K 1024L
-#define ONE_M (ONE_K * ONE_K)
-#define ONE_G (ONE_M * ONE_K)
-#define ONE_T ((long long)ONE_G * ONE_K)
-
-#define ONE_DECIMAL_K 1000L
-#define ONE_DECIMAL_M (ONE_DECIMAL_K * ONE_DECIMAL_K)
-#define ONE_DECIMAL_G (ONE_DECIMAL_M * ONE_DECIMAL_K)
-#define ONE_DECIMAL_T ((long long)ONE_DECIMAL_G * ONE_DECIMAL_K)
-
char Process_pidFormat[20] = "%7d ";
static char Process_titleBuffer[20][20];

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