| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rationale (copied from htop issue #471):
The function name "setValues" is misleading. For most OOP (object-
oriented programming) contexts, setXXX functions mean they will change
some member variables of an object into something specified in
function arguments. But in the *Meter_setValues() case, the new values
are not from the arguments, but from a hard-coded source. The caller
is not supposed to change the values[] to anything it likes, but
rather to "update" the values from the source. Hence, updateValues is
a better name for this family of functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removed a loop that sets the bar[] buffer with spaces and merged that
task to the snprintf() call just below. No need for the barOffset
variable. Display behavior is unchanged.
Size comparision (when compiled on Ubuntu 14.04 64-bit):
$ size htop.old htop.new
text data bss dec hex filename
137312 15112 3776 156200 26228 htop.old
137216 15112 3776 156104 261c8 htop.new
|
|
|
|
|
|
|
|
|
| |
Two changes in this commit:
- All meters now explicitly specify "maxItems" property, even for just
1 item. (Exception is "container" CPU meter classes, which use
CUSTOM_METERMODE.)
- "maxItems" being 0 is now allowed. This will let bar meters and graph
meters render an empty meter.
|
|
|
|
| |
Fix by @Explorer09 (see discussion on #355).
|