Christian Goettsche
f5c3349bdb
IWYU update (FreeBSD)
5 years ago
Christian Göttsche
7cf5277594
IWYU update (Linux)
5 years ago
Christian Göttsche
7914ec201e
Hashtable update
...
- use consistent type for key by introducing a new typedef
- use unsigned types for sizes
- name parameters in foreach function typedef
5 years ago
Christian Göttsche
ad72b747fa
Drop hideThreads Setting
...
It is only used to read process directories on RedHat beginning with a dot.
Unconditionally accept directories with a starting dot.
5 years ago
Benny Baumann
18763051a2
Split platform dependent parts for file locks screen
5 years ago
Fynn Wulf
84dad4c38e
Implement screen for active file locks
5 years ago
Benny Baumann
0d64ca9262
Wrap inline structure definitions
5 years ago
Benny Baumann
45869513bf
Embracing branches
5 years ago
Benny Baumann
61e14d4bb2
Spacing around operators
5 years ago
Benny Baumann
db0a13970e
Convert addattrstr to static inline function
...
NB: The macro could have been a braced while(0) loop, which without optimization produces more code
5 years ago
Christian Göttsche
ac2b07eddd
Avoid some unnecessary casts and mark some not changing variables const
5 years ago
Christian Göttsche
8a08a3209c
IWYU update
...
- Add Settings forward declaration in Process.h
- Add assert.h include in XUitls.c
- Add conditional stdbool.h include in Object.h
- Drop unneeded stddef.h include in Richstring.c
- Drop unneeded unistd.h include in Process.h
- Drop unneeded string.h include in linux/Platform.c
- Use String_eq to avoid string.h include in Action.c
- Improve script to run custom iwyu version
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
Christian Göttsche
af4f58d013
Misc conversion fixes
5 years ago
Christian Göttsche
898a690375
Do not hard-code line numbers in help screen building code
5 years ago
Christian Göttsche
b47bc667a2
Add key to pause process list updates
6 years ago
ryenus
32a2caa692
use 'w' for command wrapping as 'M' is already used
...
since 'M' is already used for sort-by-memory, as with:
keys['M'] = actionSortByMemory;
reorder help info about shortcut keys
6 years ago
Daniel Lange
079c2abf8e
Update License consistently to GPLv2 as per COPYING file
6 years ago
Christian Göttsche
843949131a
Drop redundant casts to the same type
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
ryenus
f4bb50294a
show selected command wrapped in a separate window
...
For a process with a very long command, especially with many long
command line arguments, inspecting the command and its arguments could
become inconvenient.
Meanwhile htop supports the concept of "screen", or window, which is
extended here to create a dedicated "CommandScreen", making it possible
to display the command of the selected process in a separate window
meanwhile being wrapped into multiple lines.
Another benefit of using a command screen is, the user can navigate
through the wrapped lines of the command and perform actions like
searching and filtering.
6 years ago
Christian Göttsche
5233817122
Avoid unsigned integer overflow
...
unsigned integer overflows are well-defined, but they might point to a counting issue.
Having the code free of unsigned overflows makes it easier to spot potential bugs.
Action.c:332:27: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'uid_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Action.c:332:27 in
6 years ago
Christian Göttsche
b85a31415e
Avoid checking of undefined macros
...
These feature macros are either define or not defined at all at the
configure step.
6 years ago
Christian Göttsche
c3952e7c20
Use strict function prototypes
...
int foo(); declares a function taking any number of arguments.
6 years ago
Christian Göttsche
c7568bc054
Fix memory leak in actionSetAffinity()
...
Call correct delete method for AffinityPanel
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
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
Christian Göttsche
4e2b9f0965
Avoid shadowing warnings
6 years ago
Christian Göttsche
b92f62f912
Remove trailing whitespaces
6 years ago
Daniel Flanagan
dd33444f7e
Clean up existing whitespace
6 years ago
senjan
131a6c6e2b
CPU_KERNEL redefined
7 years ago
wangqr
da60309fc9
Don't follow process when selecting non-process-specific options
...
Disable the follow process logic in Action_pickFromVector(), when
selecting sort order or user filter, since they don't apply on specific
process.
Fix #856
7 years ago
syrrim
8d7afb33e2
added MainPanel actions n and N for find next and find prev. closes #601
7 years ago
Hisham Muhammad
666e1e76b3
Fix virtualization color in help screen
...
Closes #785 .
8 years ago
Hisham Muhammad
0dbedf95a8
Collapse current subtree pressing Backspace
8 years ago
Hisham Muhammad
8c653212c0
Replace size_t with int/void* union
...
I was occasionally passing negative values to size_t.
Plus, this better reflects the intent of the variant argument.
Reported by Coverity:
https://scan8.coverity.com/reports.htm#v13253/p10402/fileInstanceId=22093891&defectInstanceId=7543346&mergedDefectId=174179&fileStart=251&fileEnd=500
8 years ago
guoci
5fca258f33
call clear() function when SIGWINCH is received. ( #660 )
8 years ago
Hisham Muhammad
e3f65c8ec2
Make 'c' key work with threads as well.
9 years ago
Richard
d5faf64374
Mark some things as const
...
Several string pointer arrays pointed to const strings
but were not const themselves.
A few various structures and arrays were also marked const.
9 years ago
Hisham
0c168471b6
F6 is actually used for both actions, depending on context.
9 years ago
ryenus
e0e84401e4
update keymap in help
9 years ago
Hisham
572546f806
Auto-follow process after a search.
...
See #237 .
10 years ago
Marco Hinz
0a4a447d0d
Add "p" to Help
10 years ago
Vasyl Boroviak
d43e709364
Typo in the word "priority"
10 years ago
Hisham
474d26cea8
Portable affinity using hwloc
10 years ago
Hisham
c148907e7b
Try to make threads less confusing.
10 years ago
Hisham Muhammad
466d4da0c6
refactor *Screen classes, add InfoScreen superclass
10 years ago
Hisham Muhammad
c6ca311d18
Present IO-Wait as a dot in monochrome. Fixes #345 .
...
Thank you @Explorer09 for the report!
10 years ago