Age | Commit message (Collapse) | Author |
|
|
|
|
|
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 );
| ^
|
|
|
|
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.
|
|
|
|
|
|
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]
|
|
|
|
|
|
- `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
|
|
|
|
|
|
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.
|
|
multiplexd-arc-is-not-cache
|
|
This commit is based on a patch originally by @edef1c. The ZFS ARC is a cache
(it's in the name), which will be evicted by the kernel if memory pressure so
requires. Hence, the ARC should not be counted towards a system's total used
memory, and should instead be grouped with the other caches in the system.
Signed-off-by: edef <edef@edef.eu>
|
|
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);
^
|
|
linux/Platform.c:142:17: warning: cast from function call of type 'double' to non-matching type 'int' [-Wbad-function-cast]
return (int) floor(uptime);
^~~~~~~~~~~~~
|
|
linux/Battery.c:291:6: warning: no previous prototype for function 'Battery_getData' [-Wmissing-prototypes]
void Battery_getData(double* level, ACPresence* isOnAC) {
^
|
|
Use the more portable sysfs node /sys/devices/system/cpu/cpuX/cpufreq/scaling_cur_freq
to get the CPU frequency.
In case of an error fall back to /proc/cpuinfo .
Also use a fixed width of 4 for the frequency to avoid position jumps
in case the frequency moves in the range 900-1100 MHz.
|
|
commsize is bounded by the allocated length passed in by commLen, saved
into commLenIn
|
|
|
|
|
|
|
|
This also fixes an issue with time returned negative if sysconf(_SC_CLK_TCK) returned an error.
|
|
|
|
|
|
|
|
|
|
|
|
int foo(); declares a function taking any number of arguments.
|
|
For example from sanitizers.
|
|
unsigned overflow is well defined, but creates noise when using
sanitizers. unsigned overflow can be a symptom of logic issues of
counter, so its reasonable to use.
linux/LinuxProcessList.c:64:50: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior linux/LinuxProcessList.c:64:50 in
linux/LinuxProcessList.c:64:11: runtime error: implicit conversion from type 'unsigned int' of value 4294967295 (32-bit, unsigned) to type 'int' changed the value to -1 (32-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior linux/LinuxProcessList.c:64:11 in
linux/LinuxProcessList.c:64:78: runtime error: unsigned integer overflow: 4 - 136 cannot be represented in type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior linux/LinuxProcessList.c:64:78 in
|
|
Displays the incremental sum of voluntary_ctxt_switches and nonvoluntary_ctxt_switches.
|
|
|
|
Pass size of allocated command buffer and limit write.
|
|
`env` is allocated by checked allocation functions and can not be NULL.
This checks confuses clang analyzer and causes a null-dereference
warning on `env[size-1]`.
|
|
|
|
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.
|
|
Remove leftover empty ifdef/endif pairs, whitespace.
The generated htop.h file was also unused - removed.
|
|
Applied via:
$ find * -name '*.h' -exec sed -i -r 's/^extern (.+\()/\1/;' {} +
Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com>
|
|
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.
|
|
Oom values should never be greater then INT_MAX, they should be in the
range 0 - 1000.
Improves: d9a5dd4b916636b5e7ba8631885427372f0cfcad
|
|
cgzones-configure
|
|
|
|
Found by Coverity
|
|
Found by Coverity
|
|
Found by Coverity
|
|
Found by Coverity
|
|
* Fix sort by adding cast
* Shrink column size to 4
* Drop unnecessary maximum field width specifier in sscanf
|