Daniel Lange
94ad111391
Update license headers to explicitly say GPLv2+
5 years ago
Christian Göttsche
d0f5b61aa5
hwloc: use int in hwloc_bitmap_foreach_begin loop
...
Affinity.c:67:10: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
5 years ago
Christian Göttsche
11d2206f40
Add ProcessList_isCPUonline
5 years ago
Christian Göttsche
41af31be7f
Rework CPU counting
...
Currently htop does not support offline CPUs and hot-swapping, e.g. via
echo 0 > /sys/devices/system/cpu/cpu2/online
Split the current single cpuCount variable into activeCPUs and
existingCPUs.
Supersedes: #650
Related: #580
5 years ago
Christian Göttsche
a11d01568c
Use unsigned types for CPU counts and associated variables
5 years ago
Christian Göttsche
d72b0a682e
Mark several non-modified pointer variables const
5 years ago
Christian Göttsche
e3862aa67e
Rework drawing of FunctionBar
...
Draw the FunctionBar within Panel_draw instead of manually throughout
the code.
Add an optional PanelClass function drawFunctionBar, to allow specific
panels to override the default FunctionBar_draw call.
Rework the code on color change, to really change all colors (selection
markers and panel headers).
Closes : #402
5 years ago
Christian Göttsche
6b100b0cf4
Use upper case numeric literals
...
See https://rules.sonarsource.com/c/RSPEC-818
5 years ago
Christian Göttsche
157086e750
Split RichString_(append|appendn|write) into wide and ascii
...
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.
5 years ago
Christian Göttsche
ea4f33409a
Update even more snprintfs
...
Use size of actual buffers instead of magic numbers
5 years ago
Benny Baumann
45869513bf
Embracing branches
5 years ago
Benny Baumann
61e14d4bb2
Spacing around operators
5 years ago
Benny Baumann
b23f8235e2
Whitespace and indentation issues
5 years ago
Benny Baumann
0f5262917f
Make all required includes explicit
...
Information as seen by IWYU 0.12 + clang 9 on Linux
5 years ago
Benny Baumann
872e542f4e
Rename StringUtils.[ch] to XUtils.[ch]
5 years ago
Benny Baumann
c6f04a9c5d
Move xAsprintf, xSnprintf and xStrdup to StringUtils.h
5 years ago
Christian Göttsche
7af06659e2
Mark remaining classes const
5 years ago
Christian Göttsche
b47bc667a2
Add key to pause process list updates
5 years ago
Christian Göttsche
79ad39c718
Mark Object pointer to _display function const
5 years ago
Christian Göttsche
ba282cfe19
Mark Object instances const
6 years ago
Daniel Lange
079c2abf8e
Update License consistently to GPLv2 as per COPYING file
6 years ago
Christian Göttsche
b82a13c6ba
Add clang analyzer CI job
6 years ago
Christian Göttsche
18b1e9fba9
Do not drop qualifier in cast
...
ListItem.c:73:33: warning: cast from 'const void *' to 'struct ListItem_ *' drops const qualifier [-Wcast-qual]
ListItem* obj1 = (ListItem*) cast1;
^
ListItem.c:74:33: warning: cast from 'const void *' to 'struct ListItem_ *' drops const qualifier [-Wcast-qual]
ListItem* obj2 = (ListItem*) cast2;
^
Process.c:434:28: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
Process* p1 = (Process*)v1;
^
Process.c:435:28: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
Process* p2 = (Process*)v2;
^
Process.c:441:36: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
Settings *settings = ((Process*)v1)->settings;
^
Process.c:443:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
p1 = (Process*)v1;
^
Process.c:444:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
p2 = (Process*)v2;
^
Process.c:446:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
p2 = (Process*)v1;
^
Process.c:447:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
p1 = (Process*)v2;
^
AffinityPanel.c:37:16: warning: cast from 'const char *' to 'void *' drops const qualifier [-Wcast-qual]
free((void*)this->text);
^
AffinityPanel.c:39:19: warning: cast from 'const char *' to 'void *' drops const qualifier [-Wcast-qual]
free((void*)this->indent);
^
linux/LinuxProcess.c:294:36: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
Settings *settings = ((Process*)v1)->settings;
^
linux/LinuxProcess.c:296:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual]
p1 = (LinuxProcess*)v1;
^
linux/LinuxProcess.c:297:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual]
p2 = (LinuxProcess*)v2;
^
linux/LinuxProcess.c:299:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual]
p2 = (LinuxProcess*)v1;
^
linux/LinuxProcess.c:300:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual]
p1 = (LinuxProcess*)v2;
^
linux/LinuxProcessList.c:62:32: warning: cast from 'const void *' to 'struct TtyDriver_ *' drops const qualifier [-Wcast-qual]
TtyDriver* a = (TtyDriver*) va;
^
linux/LinuxProcessList.c:63:32: warning: cast from 'const void *' to 'struct TtyDriver_ *' drops const qualifier [-Wcast-qual]
TtyDriver* b = (TtyDriver*) vb;
^
linux/Battery.c:130:21: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
free((char *) isOnline);
^
linux/Battery.c:197:26: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/type", entryName);
^
linux/Battery.c:209:29: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/uevent", entryName);
^
linux/Battery.c:262:29: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/online", entryName);
^
6 years ago
Christian Göttsche
4a1f3fca96
Drop unnecessary usage of comma operator
6 years ago
Christian Göttsche
6b11738744
Avoid arithmetic on booleans
6 years ago
Benny Baumann
13b1e96b12
Avoid shadowing of variables
6 years ago
Zev Weiss
a1a027b9bd
Axe automated header generation.
...
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.
6 years ago
Bert Wesarg
19359cec5a
affinity panel: use the tree collapsing as in the process list
...
With one exception, the root node does also have a `-`/`+` as a prefix.
6 years ago
Bert Wesarg
b0f1336f79
affinity panel: show CPUs in the topology tree as `CPU x`
...
As it is in the non-topology list.
6 years ago
Bert Wesarg
f861a2c616
Revert "Use UTF-8 for check buttons and tree open/closed"
...
This reverts commit 5d5913d355b3a9f03da589b3542b8f55467b4ed6.
6 years ago
Bert Wesarg
94b8c2e714
fix width of `AffinitPanel`
...
The panel size of 15 includes the gap to the next panel, thus use 14 as
the minimum size and let the caller of `AffinityPanel_new` handle the
gap.
6 years ago
Nathan Scott
728b04bbb5
Merge branch 'ci-hwloc-job' of https://github.com/bertwesarg/htop into bertwesarg-ci-hwloc-job
6 years ago
Hisham Muhammad
09e241fb12
Security review: check results of snprintf.
...
Calls marked with xSnprintf shouldn't fail.
Abort program cleanly if any of them does.
9 years ago
Hisham
b54d2dde40
Check for failure in allocations.
10 years ago
Hisham Muhammad
f6c31eeaf5
Handle KEY_RECLICK events generated by ScreenManager
11 years ago
Hisham Muhammad
0ebe688d24
Avoid future confusions with how default values are set.
11 years ago
Hisham Muhammad
7cb8cb05fb
Simplify constructors.
11 years ago
Hisham Muhammad
d0c72c3fb2
Move FunctionBar inside Panel
11 years ago
Hisham Muhammad
3383d8e556
Sorry about the mega-patch.
...
This is a work-in-progress, code is currently broken.
(Some actions, and notably, the header, are missing.)
11 years ago
Hisham Muhammad
00b324bfc1
Changes in object model: separate class objects to store vtable. Also, nicer UTF-8 display of big numbers.
13 years ago
Hisham Muhammad
47e881f460
Add IO priority support ('i' key)
14 years ago
Hisham Muhammad
45f7a4fc8d
Remove old memory debugging routines. We have Valgrind nowadays.
14 years ago
Hisham Muhammad
84281bdc44
major header cleanup
14 years ago
Hisham Muhammad
81e44312b4
Use strdup explicitly
14 years ago
Hisham Muhammad
539b32dc31
simplify code
15 years ago
Hisham Muhammad
ec17b7029a
Convert affinity control from the deprecated PLPA to HWLOC
15 years ago
Hisham Muhammad
f7fe4b4722
Fix off-by-one error in PROCESSOR display
15 years ago
Hisham Muhammad
a9c0ea3753
* Option for counting CPUs from zero
...
(thanks to Sean Noonan)
* Meters update in every screen (no longer halting while on Setup, etc.)
15 years ago
Hisham Muhammad
6330ff3a0a
changes for htop 0.8.2
17 years ago
Hisham Muhammad
15ab0ad706
Let mouseclicks tick/untick checkboxes
18 years ago