Commit Graph

1207 Commits

Author SHA1 Message Date
Xavi
7fa92c402d Initialize pti struct 2025-05-01 11:14:20 +00:00
Xavi
da9a53f4a9 Fix macos tree-mode + aggregate memory issue 2025-05-01 11:14:20 +00:00
Marie Ramlow
4812ac8280 Fix typo: Mhz -> MHz 2025-05-01 10:53:44 +00:00
aristocratos
666d31b1ab v1.4.1 v1.4.1 2025-04-27 15:52:29 +02:00
Steffen Winter
ffb764734f CI: Pass link flags as LDFLAGS to avoid unused argument warning 2025-04-24 20:17:43 +00:00
Steffen Winter
fda186800b CI: Remove debug leftover 2025-04-24 20:17:43 +00:00
Steffen Winter
6cab38f097 Fix various typos in code, themes and workflows 2025-04-24 19:39:27 +00:00
bad code
d40cd430b8 Mark destructor noexcept and satisfy rule-of-five
Follow the RAII paradigm and define all 5 special class function if any
of them has a non-default implementation. Avoids duplicate destruction
or other unwanted effects.
2025-04-24 19:04:02 +00:00
bad code
81cdf9d7c4 Initialize all struct fields
Avoid uninitialized members.
2025-04-24 19:04:02 +00:00
bad code
08706f49d3 Mark member variables private
Hide class internals.
2025-04-24 19:04:02 +00:00
bad code
4c4a161421 Use explicit single parameter constructor
Avoid implicit conversions; these might be unwanted or truncating.
2025-04-24 19:04:02 +00:00
bad code
5ff01e1987 Ensure NUL-termination on truncation
gethostname() might not NUL-terminate the passed buffer on truncation.
2025-04-24 19:04:02 +00:00
bad code
4d67f3211d Avoid repeated bounds check
The bounds check is done explicitly in the line before.
2025-04-24 19:04:02 +00:00
bad code
73e0520fb0 Use O_CLOEXEC
Avoid leaking file descriptor via potential sibling threads.
2025-04-24 19:04:02 +00:00
bad code
c37f68f088 Use member function instead of cast
Avoid C-style cast.
2025-04-24 19:04:02 +00:00
bad code
f72d11fe52 Avoid copy in constructor
Enable compilers to move temporary variables into the constructor.
2025-04-24 19:04:02 +00:00
bad code
889d8efce4 Drop trailing newlines 2025-04-24 19:04:02 +00:00
bad code
48a1fbe3a7 Declare local function static
Clarifies the intended scope of the functions.
2025-04-24 19:04:02 +00:00
bad code
0d14d8672f Drop duplicate include 2025-04-24 19:04:02 +00:00
bad code
c1a31fa167 Simplify ternary expression 2025-04-24 19:04:02 +00:00
bad code
b2b54b5bd7 Use explicit initialization
Avoid uninitialized member variable.
2025-04-24 19:04:02 +00:00
bad code
92ae38d804 Use nullptr for pointer argument
Avoid implicit integer to pointer conversion.
2025-04-24 19:04:02 +00:00
bad code
e0914771cd Add missing override annotations
Help the compiler in finding mismatches.
2025-04-24 19:04:02 +00:00
bad code
bdec3d653f Avoid comma operator
Simply split the expressions.
2025-04-24 19:04:02 +00:00
Stefan
e96f692be5 Fixed typo 2025-04-23 20:40:21 +00:00
bad code
f366b38f85 Avoid copies in ltrim() and ltrim() 2025-04-23 20:15:12 +00:00
bad code
7d3f73b392 Avoid string copies
The sensor data is not modified for the lifetime of the vector and
outlives it.
2025-04-23 20:15:12 +00:00
bad code
de5c8d75ba Drop unused struct members 2025-04-23 20:15:12 +00:00
bad code
34c0532ca7 Reduce variable scope 2025-04-23 20:15:12 +00:00
bad code
c139ded7db Avoid string copy 2025-04-23 20:15:12 +00:00
bad code
124aa592e3 Initialize vector in one step 2025-04-23 20:15:12 +00:00
bad code
ef13690601 Avoid repeated lookup
erase() works fine if the key does not exist.
2025-04-23 20:15:12 +00:00
bad code
b276a60cd3 Avoid repeated lookup
Cache the value once.
2025-04-23 20:15:12 +00:00
bad code
e94a6dc8c0 Avoid repeated lookup
Use find() instead of contains() followed by at().
2025-04-23 20:15:12 +00:00
bad code
4272d32257 Drop unnecessary string construction 2025-04-23 20:15:12 +00:00
bad code
38886e703f Avoid unnecessary copy of vector 2025-04-23 20:15:12 +00:00
bad code
da9d5a47bc Avoid copies in loop iterator 2025-04-23 20:15:12 +00:00
bad code
46d160e91a Reserve known vector size
Allocate the required memory at once.
2025-04-23 20:15:12 +00:00
bad code
124ff839f0 Exit loop only if element found
Currently the loop is only executed at most once, the break probably
should be inside the if block.
2025-04-23 20:15:12 +00:00
Steffen Winter
de0d295f6f Move the config parser in it's own module
Return a struct with options instead of settings globals.
2025-04-23 16:48:02 +00:00
georgev93
25cb3f5a08 Adding a menu option to show bitrates in base 10 separate from the setting to show bytes/bits in base 10 2025-04-23 12:00:57 +00:00
Jakob P. Liljenberg
a168981e68 Update README.md GCC10 -> GCC11 2025-04-22 20:41:40 +02:00
Lucas Holt
1f0b49fa92 Allow MidnightBSD to build btop using the existing freebsd support.
Works with GCC 14 / gmake

use filter and remove duplicated block

Add MidnightBSD support for cmake
2025-04-22 10:18:10 +00:00
Steffen Winter
b21b1daa84 Drop workarounds for GCC 10
GCC 10 and even 11 don't receive updates anymore.

Using Debian stable as the baseline (as done previously), most major
distributions have a recent enought toolchain with GCC 11 or later. The
same applies for LLVM.

Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 15:09:58 +00:00
Steffen Winter
fa5189c6e6 CI: Bump gcc version for NetBSD
Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 15:09:58 +00:00
Steffen Winter
976fd1d1f5 CMake: Downgrade lowdown not found warning to a message
Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 14:26:58 +00:00
Steffen Winter
4df81010a7 Make arg parser function to snake_case
Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 12:26:30 +00:00
Steffen Winter
161c53b978 Combine help function calls in argument parser
Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 12:26:30 +00:00
Steffen Winter
e6dc808cee Add CLI flag to specify a different config file
Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 12:26:30 +00:00
Steffen Winter
1dfaf96979 Make: Disable LTO for debug builds
Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 12:26:17 +00:00