mirror of https://github.com/xzeldon/htop.git
Merge branch 'misc' of https://github.com/cgzones/htop into cgzones-misc
This commit is contained in:
commit
31e59cc60d
3
CRT.c
3
CRT.c
|
@ -652,8 +652,7 @@ int CRT_scrollWheelVAmount = 10;
|
||||||
ColorScheme CRT_colorScheme = COLORSCHEME_DEFAULT;
|
ColorScheme CRT_colorScheme = COLORSCHEME_DEFAULT;
|
||||||
|
|
||||||
ATTR_NORETURN
|
ATTR_NORETURN
|
||||||
static void CRT_handleSIGTERM(int sgn) {
|
static void CRT_handleSIGTERM(ATTR_UNUSED int sgn) {
|
||||||
(void) sgn;
|
|
||||||
CRT_done();
|
CRT_done();
|
||||||
_exit(0);
|
_exit(0);
|
||||||
}
|
}
|
||||||
|
|
4
Meter.c
4
Meter.c
|
@ -378,9 +378,7 @@ static void LEDMeterMode_drawDigit(int x, int y, int n) {
|
||||||
mvaddstr(y+i, x, LEDMeterMode_digits[i * 10 + n]);
|
mvaddstr(y+i, x, LEDMeterMode_digits[i * 10 + n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LEDMeterMode_draw(Meter* this, int x, int y, int w) {
|
static void LEDMeterMode_draw(Meter* this, int x, int y, ATTR_UNUSED int w) {
|
||||||
(void) w;
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSESW
|
#ifdef HAVE_LIBNCURSESW
|
||||||
if (CRT_utf8)
|
if (CRT_utf8)
|
||||||
LEDMeterMode_digits = LEDMeterMode_digitsUtf8;
|
LEDMeterMode_digits = LEDMeterMode_digitsUtf8;
|
||||||
|
|
10
Process.c
10
Process.c
|
@ -316,12 +316,12 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field
|
||||||
if (field == PERCENT_NORM_CPU) {
|
if (field == PERCENT_NORM_CPU) {
|
||||||
cpuPercentage /= this->processList->cpuCount;
|
cpuPercentage /= this->processList->cpuCount;
|
||||||
}
|
}
|
||||||
if (cpuPercentage > 999.9f) {
|
if (cpuPercentage > 999.9F) {
|
||||||
xSnprintf(buffer, n, "%4u ", (unsigned int)cpuPercentage);
|
xSnprintf(buffer, n, "%4u ", (unsigned int)cpuPercentage);
|
||||||
} else if (cpuPercentage > 99.9f) {
|
} else if (cpuPercentage > 99.9F) {
|
||||||
xSnprintf(buffer, n, "%3u. ", (unsigned int)cpuPercentage);
|
xSnprintf(buffer, n, "%3u. ", (unsigned int)cpuPercentage);
|
||||||
} else {
|
} else {
|
||||||
if (cpuPercentage < 0.05f)
|
if (cpuPercentage < 0.05F)
|
||||||
attr = CRT_colors[PROCESS_SHADOW];
|
attr = CRT_colors[PROCESS_SHADOW];
|
||||||
|
|
||||||
xSnprintf(buffer, n, "%4.1f ", cpuPercentage);
|
xSnprintf(buffer, n, "%4.1f ", cpuPercentage);
|
||||||
|
@ -329,10 +329,10 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PERCENT_MEM:
|
case PERCENT_MEM:
|
||||||
if (this->percent_mem > 99.9f) {
|
if (this->percent_mem > 99.9F) {
|
||||||
xSnprintf(buffer, n, "100. ");
|
xSnprintf(buffer, n, "100. ");
|
||||||
} else {
|
} else {
|
||||||
if (this->percent_mem < 0.05f)
|
if (this->percent_mem < 0.05F)
|
||||||
attr = CRT_colors[PROCESS_SHADOW];
|
attr = CRT_colors[PROCESS_SHADOW];
|
||||||
|
|
||||||
xSnprintf(buffer, n, "%4.1f ", this->percent_mem);
|
xSnprintf(buffer, n, "%4.1f ", this->percent_mem);
|
||||||
|
|
|
@ -93,8 +93,7 @@ bool TraceScreen_forkTracer(TraceScreen* this) {
|
||||||
|
|
||||||
// Should never reach here, unless execlp fails ...
|
// Should never reach here, unless execlp fails ...
|
||||||
const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH.";
|
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)! write(STDERR_FILENO, message, strlen(message));
|
||||||
(void) written;
|
|
||||||
|
|
||||||
exit(127);
|
exit(127);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1546,7 +1546,7 @@ static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) {
|
||||||
if (String_startsWith(buffer, label)) { \
|
if (String_startsWith(buffer, label)) { \
|
||||||
memory_t parsed_; \
|
memory_t parsed_; \
|
||||||
if (sscanf(buffer + strlen(label), "%llu kB", &parsed_) == 1) { \
|
if (sscanf(buffer + strlen(label), "%llu kB", &parsed_) == 1) { \
|
||||||
variable = parsed_; \
|
(variable) = parsed_; \
|
||||||
} \
|
} \
|
||||||
break; \
|
break; \
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue