diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-01-05 23:42:55 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-01-11 20:12:34 +0100 |
commit | d72b0a682ecad0a8d5793022733447e855a61798 (patch) | |
tree | d9bc511bb716030fd73675bd3474e5a043636d73 /linux/Platform.c | |
parent | 1b2d48bc9aa93254c48d10bb34acde9596b526b9 (diff) |
Mark several non-modified pointer variables const
Diffstat (limited to 'linux/Platform.c')
-rw-r--r-- | linux/Platform.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/linux/Platform.c b/linux/Platform.c index dd80ded7..23163212 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -131,13 +131,13 @@ void Platform_done(void) { static Htop_Reaction Platform_actionSetIOPriority(State* st) { Panel* panel = st->panel; - LinuxProcess* p = (LinuxProcess*) Panel_getSelected(panel); + const LinuxProcess* p = (const LinuxProcess*) Panel_getSelected(panel); if (!p) return HTOP_OK; IOPriority ioprio1 = p->ioPriority; Panel* ioprioPanel = IOPriorityPanel_new(ioprio1); - void* set = Action_pickFromVector(st, ioprioPanel, 21, true); + const void* set = Action_pickFromVector(st, ioprioPanel, 21, true); if (set) { IOPriority ioprio2 = IOPriorityPanel_getIOPriority(ioprioPanel); bool ok = MainPanel_foreachProcess((MainPanel*)panel, LinuxProcess_setIOPriority, (Arg) { .i = ioprio2 }, NULL); @@ -366,7 +366,7 @@ char* Platform_getProcessEnv(pid_t pid) { */ char* Platform_getInodeFilename(pid_t pid, ino_t inode) { struct stat sb; - struct dirent *de; + const struct dirent *de; DIR *dirp; ssize_t len; int fd; @@ -596,11 +596,11 @@ static unsigned long int parseBatInfo(const char* fileName, const unsigned short memset(batteries, 0, MAX_BATTERIES * sizeof(char*)); while (nBatteries < MAX_BATTERIES) { - struct dirent* dirEntry = readdir(batteryDir); + const struct dirent* dirEntry = readdir(batteryDir); if (!dirEntry) break; - char* entryName = dirEntry->d_name; + const char* entryName = dirEntry->d_name; if (!String_startsWith(entryName, "BAT")) continue; @@ -653,7 +653,7 @@ static ACPresence procAcpiCheck(void) { return AC_ERROR; for (;;) { - struct dirent* dirEntry = readdir(dir); + const struct dirent* dirEntry = readdir(dir); if (!dirEntry) break; @@ -728,7 +728,7 @@ static void Platform_Battery_getSysData(double* percent, ACPresence* isOnAC) { unsigned long int totalRemain = 0; for (;;) { - struct dirent* dirEntry = readdir(dir); + const struct dirent* dirEntry = readdir(dir); if (!dirEntry) break; |