Christian Göttsche
2d1042adb3
Save text buffer in Meter
5 years ago
Christian Göttsche
c150e4bde9
Enable -Wformat=2
...
Now that the global format variable Process_pidFormat is gone, enable
the compiler warning -Wformat=2.
5 years ago
Christian Göttsche
e1ce141bc3
Use size_t as len type for Meter_UpdateValues
...
Most of the time the parameter is passed to snprintf type functions
5 years ago
Benny Baumann
83bf8cfad6
Make casing of N/A consistent (majority was N/A)
5 years ago
Nathan Scott
0eb3c7589d
Merge individual Battery.[ch] files into Platform.[ch]
...
Small changes from review - keep headers sorted and keep local
variable declarations at the top of source files.
5 years ago
Nathan Scott
ea9622b8c9
Merge individual Battery.[ch] files into Platform.[ch]
...
Consistent with everything else involving platform-specific
calls from core htop code.
5 years ago
Benny Baumann
61e14d4bb2
Spacing around operators
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
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
7ae967a04b
Drop redundant return statements
6 years ago
Christian Göttsche
6db2d52261
Covert Meter attributes to file-local constant arrays
6 years ago
Benny Baumann
47e2cefe02
Update battery API to use NAN on error
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
Daniel Flanagan
dd33444f7e
Clean up existing whitespace
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
Explorer09
9dea20e068
Rename Meter.setValues() functions to updateValues()
...
Rationale (copied from htop issue #471 ):
The function name "setValues" is misleading. For most OOP (object-
oriented programming) contexts, setXXX functions mean they will change
some member variables of an object into something specified in
function arguments. But in the *Meter_setValues() case, the new values
are not from the arguments, but from a hard-coded source. The caller
is not supposed to change the values[] to anything it likes, but
rather to "update" the values from the source. Hence, updateValues is
a better name for this family of functions.
10 years ago
Explorer09
99fb3070a2
Explicit "maxItems" property of meters
...
Two changes in this commit:
- All meters now explicitly specify "maxItems" property, even for just
1 item. (Exception is "container" CPU meter classes, which use
CUSTOM_METERMODE.)
- "maxItems" being 0 is now allowed. This will let bar meters and graph
meters render an empty meter.
10 years ago
David Hunt
5e602f18d5
Rename String to StringUtils.
...
Fixes building on case-insensitive filesystems where String.h gets confused with <string.h>.
From d734dacea0a10d0465dad4e95b3421511e7da112 Mon Sep 17 00:00:00 2001
From: David Hunt <dhunt@iolanthe.attlocal.net>
Date: Sat, 11 Jul 2015 20:56:31 -0500
Subject: [PATCH 1/8] Rename String to StringUtils
11 years ago
Hisham Muhammad
9780c312f4
Fix allocation of processes. Closes #166 .
...
Conflicts:
Process.c
Process.h
ProcessList.c
ScreenManager.c
linux/LinuxProcessList.c
11 years ago
Hisham Muhammad
c2108e5a48
Another mega-patch for the refactoring process.
...
Kinda runs, but functionality from the original main loop
is still missing. Patience.
11 years ago
Hisham Muhammad
430c7c9a9b
Move platform-dependent parts of Linux battery meter.
11 years ago
Hisham Muhammad
9eec37c432
More sanity checks.
12 years ago
Hisham Muhammad
50b701258d
Make static analyzers happy.
12 years ago
Hisham Muhammad
814ce89b45
Oops, fix use of memset.
12 years ago
Hisham Muhammad
659251c501
Fix array limit.
12 years ago
Hisham Muhammad
2fdebf6a29
Remove useless test.
12 years ago
Hisham Muhammad
b1564c2be9
Refactor and fix resource leaks.
12 years ago
Hisham Muhammad
c1e0f6e17c
BUGFIX: Fix crash when adding meters and toggling detailed CPU time.
...
See https://bugzilla.redhat.com/show_bug.cgi?id=987805 for details.
(thanks to Dawid Gajownik for the detailed analysis!)
12 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
58676d7001
minor style cleanups
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
d1b1cbc757
cleanups and fixes, thanks to cppcheck and gcc -Wextra
15 years ago
Hisham Muhammad
300caa076e
Tempus fugit.
15 years ago
Hisham Muhammad
3fcbcbfda6
Improve battery meter support (thanks to Richard W.) Closes #3063541 .
16 years ago
Hisham Muhammad
a600d5a6e9
Tempus fugit.
16 years ago
Hisham Muhammad
02a30bfecd
warning fixes
16 years ago
Hisham Muhammad
c9e59b4a33
minor tweaks by David Weber
16 years ago
Hisham Muhammad
1371ee28a7
don't use unbounded operations
17 years ago
Hisham Muhammad
20bb68824d
updated battery meter code from Ian Hands, slightly tweaked
17 years ago
Hisham Muhammad
11931f1bc8
ACPI Battery meter
...
contributed by Ian Hands
18 years ago