diff options
author | Nathan Scott <nathans@redhat.com> | 2021-03-05 13:38:19 +1100 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2021-03-05 13:38:19 +1100 |
commit | 31e59cc60dbd1af8a3a0da2e706f816b5be9e7ba (patch) | |
tree | b8132a5513b717d192a46d8aca500e73dee97697 | |
parent | b862e36ee7ce8954b120eab4fc895c9dc7c7f3db (diff) | |
parent | 13b28fa9ed283d9236ceb30f77e403cb451a7cd7 (diff) |
Merge branch 'misc' of https://github.com/cgzones/htop into cgzones-misc
-rw-r--r-- | CRT.c | 3 | ||||
-rw-r--r-- | Meter.c | 4 | ||||
-rw-r--r-- | Process.c | 10 | ||||
-rw-r--r-- | TraceScreen.c | 3 | ||||
-rw-r--r-- | linux/LinuxProcessList.c | 2 |
5 files changed, 9 insertions, 13 deletions
@@ -652,8 +652,7 @@ int CRT_scrollWheelVAmount = 10; ColorScheme CRT_colorScheme = COLORSCHEME_DEFAULT; ATTR_NORETURN -static void CRT_handleSIGTERM(int sgn) { - (void) sgn; +static void CRT_handleSIGTERM(ATTR_UNUSED int sgn) { CRT_done(); _exit(0); } @@ -378,9 +378,7 @@ static void LEDMeterMode_drawDigit(int x, int y, int n) { mvaddstr(y+i, x, LEDMeterMode_digits[i * 10 + n]); } -static void LEDMeterMode_draw(Meter* this, int x, int y, int w) { - (void) w; - +static void LEDMeterMode_draw(Meter* this, int x, int y, ATTR_UNUSED int w) { #ifdef HAVE_LIBNCURSESW if (CRT_utf8) LEDMeterMode_digits = LEDMeterMode_digitsUtf8; @@ -316,12 +316,12 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field if (field == PERCENT_NORM_CPU) { cpuPercentage /= this->processList->cpuCount; } - if (cpuPercentage > 999.9f) { + if (cpuPercentage > 999.9F) { xSnprintf(buffer, n, "%4u ", (unsigned int)cpuPercentage); - } else if (cpuPercentage > 99.9f) { + } else if (cpuPercentage > 99.9F) { xSnprintf(buffer, n, "%3u. ", (unsigned int)cpuPercentage); } else { - if (cpuPercentage < 0.05f) + if (cpuPercentage < 0.05F) attr = CRT_colors[PROCESS_SHADOW]; xSnprintf(buffer, n, "%4.1f ", cpuPercentage); @@ -329,10 +329,10 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field break; } case PERCENT_MEM: - if (this->percent_mem > 99.9f) { + if (this->percent_mem > 99.9F) { xSnprintf(buffer, n, "100. "); } else { - if (this->percent_mem < 0.05f) + if (this->percent_mem < 0.05F) attr = CRT_colors[PROCESS_SHADOW]; xSnprintf(buffer, n, "%4.1f ", this->percent_mem); diff --git a/TraceScreen.c b/TraceScreen.c index c21e4802..50c0eca1 100644 --- a/TraceScreen.c +++ b/TraceScreen.c @@ -93,8 +93,7 @@ bool TraceScreen_forkTracer(TraceScreen* this) { // Should never reach here, unless execlp fails ... const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH."; - ssize_t written = write(STDERR_FILENO, message, strlen(message)); - (void) written; + (void)! write(STDERR_FILENO, message, strlen(message)); exit(127); } diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 69e5b75f..89a39732 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1546,7 +1546,7 @@ static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) { if (String_startsWith(buffer, label)) { \ memory_t parsed_; \ if (sscanf(buffer + strlen(label), "%llu kB", &parsed_) == 1) { \ - variable = parsed_; \ + (variable) = parsed_; \ } \ break; \ } |