summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-10-09Merge branch 'master' of https://github.com/ryenus/htopDaniel Lange
Closes #223
2020-10-09use 'w' for command wrapping as 'M' is already usedryenus
since 'M' is already used for sort-by-memory, as with: keys['M'] = actionSortByMemory; reorder help info about shortcut keys
2020-10-08Some more locations for ARRAYSIZEBenny Baumann
2020-10-07Handle parsing envID & VPid from process status fileBenny Baumann
Fixes #55 Fixes #192
2020-10-07Mark Object instances constChristian Göttsche
2020-10-07Mark Object classes and Object class fields constChristian Göttsche
2020-10-07Replace copy loop by memmove in Vector_insertBenny Baumann
This is basically the same change like in Vector_take, just in the opposite direction.
2020-10-07Use memmove for Vector_takeBenny Baumann
Doing a quick check with callgrind this gives an average reduction from 1804 cycles/call down to 491 cycles/call on my test system. The average was taken over about 40k calls.
2020-10-07Set a -dev version to bug reports show a useful version and not the last releaseDaniel Lange
2020-10-07Option to set initial filterlaydervus
Closes #219
2020-10-06Simplify statm parsing and document unused fieldsChristian Göttsche
2020-10-06Drop redundant cast to same typeChristian Göttsche
2020-10-06Enclose CLAMP macro arguments in parenthesesChristian Göttsche
2020-10-06Enable -Wcast-qual compiler warningChristian Göttsche
2020-10-06Handle Panel_getSelected() returning NULLChristian Göttsche
Found by compiling with LTO: ColumnsPanel.c: In function ‘ColumnsPanel_eventHandler’: ColumnsPanel.c:46:59: error: potential null pointer dereference [-Werror=null-dereference] 46 | ((ListItem*)Panel_getSelected(super))->moving = this->moving; | ^ AvailableColumnsPanel.c: In function ‘AvailableColumnsPanel_eventHandler’: AvailableColumnsPanel.c:31:8: error: potential null pointer dereference [-Werror=null-dereference] 31 | int key = ((ListItem*) Panel_getSelected(super))->key; | ^ AvailableMetersPanel.c: In function ‘AvailableMetersPanel_eventHandler’: AvailableMetersPanel.c:40:24: error: potential null pointer dereference [-Werror=null-dereference] 40 | int param = selected->key & 0xff; | ^ linux/IOPriorityPanel.c: In function ‘IOPriorityPanel_getIOPriority’: linux/IOPriorityPanel.c:37:11: error: potential null pointer dereference [-Werror=null-dereference] 37 | return (IOPriority) ( ((ListItem*) Panel_getSelected(this))->key ); | ^
2020-10-06Merge branch 'update-license-and-copyright-info'Nathan Scott
2020-10-05DateMeter followupChristian Göttsche
2020-10-05Add a date and datetime meter (#159)Michael F. Schönitzer
Add a date meter and sort header and source files in Makefile Change the lists of header and source files sorted alphabetical and one file per line. This way diffs become better readable and merges easier.
2020-10-05Mention platform for platform specific configure optionsChristian Göttsche
2020-10-05Mark argument in Object_isA constChristian Göttsche
2020-10-05Merge identical declarationsChristian Göttsche
2020-10-05Assert that low value is lower than the high value in CLAMPChristian Göttsche
2020-10-05Add Copyright statement to --help (needed as it has the license info)Daniel Lange
2020-10-05limit max screen title length to window widthryenus
Applies screen title truncating to all InfoScreen classes.
2020-10-05Update License consistently to GPLv2 as per COPYING fileDaniel Lange
2020-10-05Update copyright statementDaniel Lange
2020-10-05Merge branch '0000/int-sizes/00' of https://github.com/mfwitten/htop into ↵Nathan Scott
mfwitten-0000/int-sizes/00
2020-10-05Merge pull request #205 from cgzones/arraysizeNathan Scott
Introduce ARRAYSIZE
2020-10-05Merge branch 'attr-nonnull' of https://github.com/BenBE/htop into ↵Nathan Scott
BenBE-attr-nonnull
2020-10-03Introduce ARRAYSIZEChristian Göttsche
2020-10-03Add clang analyzer CI jobChristian Göttsche
2020-10-03Resolve DEBUG compilation issuesChristian Göttsche
Use NDEBUG conditional instead of DEBUG. Do not call static functions in extern inline ones. Vector.c:67:11: error: static function 'Vector_isConsistent' is used in an inline function with external linkage [-Werror,-Wstatic-in-inline]
2020-10-03Add --enable-debug configure option to enable assertsChristian Göttsche
asserts are still disabled by default.
2020-10-03Add DiskIOMeter for IO read/write usageChristian Göttsche
2020-10-03Add security attribute process columnChristian Göttsche
2020-10-02Adjust colorsChristian Göttsche
- do not reverse CPU steal and guest in monochrome - black on black in Light Terminal is not visible, use blue on black - white on blue in Light Terminal is display as blue on black, use yellow on black - re-draw FunctionBar after color change
2020-10-02InfoScreen: update content on resizeChristian Göttsche
2020-10-02minor typo in Vector.cckath
2020-09-29Enable NULL pointer checks via compiler if supportedBenny Baumann
2020-09-29Process.{h,c}: Use integer types that are more portableMichael Witten
When building on a 32-bit system, the compiler warned that the following line uses a constant whose value is the overflow result of a compile-time computation: Process.c (line 109): } else if (number < 10000 * ONE_M) { Namely, this constant expression: 10000 * ONE_M was intended to produce the following value: 10485760000 However, the result overflowed to produce: 1895825408 The reason for this overflow is as follows: o The macros are expanded: 10000 * (ONE_K * ONE_K) 10000 * (1024L * 1024L) o The untyped constant expression "10000" is typed: 10000U * (1024L * 1024L) o The parenthesized expression is evaluated: 10000U * (1048576L) o The left operand ("10000U") is converted: 10000L * (1048576L) Unbound by integer sizes, that last multiplication would produce the following value: 10485760000 However, on a 32-bit machine, where a long is 32 bits (really 31 bits when talking about positive numbers), the maximum value that can be computed is 2**31-1: 2147483647 Consequently, the computation overflows. o The compiler produces a long int value that is the the result of overflow (10485760000 % 2**31): 1895825408L Actually, I think this overflow is implementation-defined, so it's not even a portable description of what happens. The solution is to use a long long int (or, even better, an unsigned long long int) type for the constant expression; the C standard mandates a sufficiently large maximum value for such types. Hence, the following change is made to the bad line: - } else if (number < 10000 * ONE_M) { + } else if (number < 10000ULL * ONE_M) { However, the whole line is now patently silly, because the variable "number" is typed "unsigned long", and so it will always be less than the constant expression (the compiler will warn about this, too). Hence, "number" must be typed "unsigned long long"; however, this necessitates changing all of the string formats from something like "%lu" to something like "%llu". Et voila! This commit is born. Then, for the sake of completeness, the declared types of the constant-expression macros are updated: o ONE_K is made unsigned (a "UL" instead of "L") o ONE_T is computed by introducing "1ULL *" o Similar changes are made for ONE_DECIMAL_{K,T} Also, a non-portable overflow-conversion to a signed value has been replaced with a portable comparison: - if ((long long) number == -1LL) { + if (number == ULLONG_MAX) { It might be worth reviewing the rest of the code for other cases where overflows are not handled correctly; even at runtime, it's often necessary to check for overflow unless such behavior is expected (especially for signed integer values, for which overflow has implementation-defined behavior).
2020-09-29Sort headers/includesBenny Baumann
2020-09-29Fix FreeBSD compile issueBenny Baumann
This issue was previously hidden as xSnprintf expanded to only one large command that didn't trigger the GCC formatting check.
2020-09-29Cleanse xStrdup messBenny Baumann
2020-09-29Reimplement xAsnprintf and xSnprintf as type-safe functionsBenny Baumann
2020-09-29Drop redundant declarationsChristian Göttsche
- `CRT_fatalError()` is declared twice in CRT.h - `Process_pidFormat`, `Process_writeField()` and `Process_compare` are declared twice in Process.h - `btime` is defined in LinuxProcess.c and also declared in LinuxProcess.h, so drop in LinuxProcessList.h
2020-09-29Drop redundant return statementsChristian Göttsche
2020-09-29Covert Meter attributes to file-local constant arraysChristian Göttsche
2020-09-29Drop redundant casts to the same typeChristian Göttsche
2020-09-29command screen: fill current line when scanningryenus
2020-09-28CPUMeter: add octuple-column CPU meters.multi
This is a straightforward extension of the existing multi-column CPU meter code, which now allows for up CPU meters to be displayed in up to 16 columns. This also adds the meter declarations to all the platform-specific code.