Age | Commit message (Collapse) | Author |
|
Print wide characters, like degree sign, properly via mvadd_wch().
Ignore attributes when returning value from RichString_getCharVal() in
non-wide ncurses mode to test against raw characters.
|
|
Allows to set attributes when padding process fields in non-wide ncurses
mode.
Closes: #475
|
|
|
|
Reduces code in callers and helps avoiding memory leaks.
|
|
Fixes: #459
|
|
They are not used in any other function and are not used maybe
uninitialized.
|
|
Change the color and total based on the actual 1min load value:
< 1 : green and total of 1.0
< cpu-count : yellow and total of cpu-count
else : red and total of 2*cpu-count
Closes: #32
|
|
|
|
In case the text is too long for the bar, try to fit by truncating at a
space character.
E.g.
[|24.1% 2000Mhz 40°C]
[24.1% 2000Mhz 40°C]
[||||24.1% 2000Mhz]
[|||24.1% 2000Mhz]
[||24.1% 2000Mhz]
[|24.1% 2000Mhz]
[24.1% 2000Mhz]
[|||| 24.1%]
[|||| 24.1%]
[|||| 24.1%]
[||||24.1%]
[|||24.1%]
[||24.1%]
[|24.1%]
[24.1%]
[24.1]
[24.]
[24]
[2]
|
|
- The Bar Meter might override the right border
- The TextMeter might wrap-around into the next line
|
|
Use mbstowcs() only with wide ncurses support.
Closes: #401
|
|
RichString_writeFrom takes a top spot during performance analysis due to the
calls to mbstowcs() and iswprint().
Most of the time we know in advance that we are only going to print regular
ASCII characters.
|
|
to bar buffers
Closes: #294
|
|
Most of the time the parameter is passed to snprintf type functions
|
|
|
|
attrset() seems to not work with mvaddchnstr()
|
|
|
|
|
|
Use size of actual buffers instead of magic numbers
|
|
Like delay or highlightDelaySecs
|
|
Currently the code does not handle multi-byte characters, so length-
computations take the raw count of C characters and not the to displayed
size into account.
An example is the degree sign for temperatures.
Closes: #329
|
|
|
|
|
|
|
|
|
|
|
|
Allocating zero size memory results in implementation-defined behavior:
man:malloc(3) :
If size is 0, then malloc() returns either NULL, or a unique pointer
value that can later be successfully passed to free().
|
|
Information as seen by IWYU 0.12 + clang 9 on Linux
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear
throughout the codebase with many re-definitions. Make
a single copy of each in a common header file, and use
the BSD variants of MINIMUM/MAXIMUM due to conflicts in
the system <sys/param.h> headers.
|
|
Reasoning:
- implementation was unsound -- broke down when I added a fairly
basic macro definition expanding to a struct initializer in a *.c
file.
- made it way too easy (e.g. via otherwise totally innocuous git
commands) to end up with timestamps such that it always ran
MakeHeader.py but never used its output, leading to overbuild noise
when running what should be a null 'make'.
- but mostly: it's just an awkward way of dealing with C code.
|
|
|
|
The buffer for blank bars was left uninitialized resulting in random
looking characters sometimes even overwriting the end of the bar.
|
|
|
|
Detected by Coverity:
https://scan8.coverity.com/reports.htm#v13252/p10402/fileInstanceId=22093847&defectInstanceId=7543344&mergedDefectId=174181
|
|
|
|
Fixes #733.
|
|
Not for a comparison to zero
|
|
Calls marked with xSnprintf shouldn't fail.
Abort program cleanly if any of them does.
|
|
Round values in graph drawing (instead of implicit truncate)
|
|
Several string pointer arrays pointed to const strings
but were not const themselves.
A few various structures and arrays were also marked const.
|