Commit Graph

80 Commits

Author SHA1 Message Date
Benny Baumann e1c96879f4 Sort headers/includes 2020-09-29 17:41:49 +02:00
Christian Göttsche 241e4b3dbf Drop redundant declarations
- `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
2020-09-29 10:44:42 +02:00
Christian Göttsche d2b3a7a375 Drop dead process fields
They are nowhere used.
2020-09-24 17:48:38 +02:00
Christian Göttsche c3952e7c20 Use strict function prototypes
int foo(); declares a function taking any number of arguments.
2020-09-18 12:28:40 +02:00
Hugo Musso Gualandi 9207401f97 Clean up some code duplication in the header files
PR htop-dev/htop#70 got rid of the infrastructure for generating header
files, but it left behind some code duplication.

Some of cases are things that belong in the header file and don't need
to be repeated in the C file. Other cases are things that belong in the
C file and don't need to be in the header file.

In this commit I tried to fix all of these that I could find. When given
a choice I preferred keeping things out of the header file, unless they
were being used by someone else.
2020-09-12 19:20:44 -03:00
Zev Weiss 7b7822b896 Remove superfluous 'extern's from function declarations.
Applied via:

  $ find * -name '*.h' -exec sed -i -r 's/^extern (.+\()/\1/;' {} +

Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com>
2020-09-03 11:59:26 -05:00
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.
2020-09-03 11:58:58 -05:00
Christian Göttsche 11f558f934 Avoid discarding const qualifiers 2020-08-25 12:00:03 +02:00
Nathan Scott 45ae6191c1 Merge branch 'hishamhm-pull-866' 2020-08-20 12:29:25 +10:00
Nathan Scott 500fb283e9 Resolve compiler warnings and errors relating to the Arg union
Promote the Arg union to a core data type in Object.c such
that it is visible everywhere (many source files need it),
and correct declarations of several functions that use it.

The Process_sendSignal function is also corrected to have
the expected return type (bool, not void) - an error being
masked by ignoring this not-quite-harmless warning.  I've
also added error checking to the kill(2) call here, which
was previously overlooked / missing (?).
2020-08-20 09:35:33 +10:00
Nathan Scott 00d333cc7b Merge branch 'hishamhm-pull-869' 2020-08-19 18:04:28 +10:00
Nathan Scott 7ac1c709b7 Re-generate all headers with latest scripts/MakeHeader.py
Sync-up missing extern declarations for many functions.
2020-08-18 17:41:49 +10:00
adrien1018 536941fb23 Deal with larger numbers in colorNumber and outputRate 2018-12-30 20:18:35 +08:00
Wataru Ashihara 41754e5632
Remove unnecessary HAVE_SYS_SYSMACROS_H check
HAVE_SYS_SYSMACROS_H is always true if MAJOR_IN_SYSMACROS.

This way of checking is recommended in autoconf 2.70 documentation:
https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blobdiff;f=doc/autoconf.texi;h=4f041bd4e;hp=9ad7dc1c5f02c8ba25b2fe1218bf931c7113a5d5;hb=e17a30e987d7ee695fb4294a82d987ec3dc9b974;hpb=565a6dc50cfa01cec2fb4db894026689cdf4970c

NOTE: currently
      https://www.gnu.org/software/autoconf/manual/autoconf.html is the
      doc for autoconf 2.69.
2018-12-15 22:10:06 +09:00
Hisham Muhammad 0dbedf95a8 Collapse current subtree pressing Backspace 2018-04-05 19:38:13 -03:00
Hisham Muhammad ccd156f8ba Updates to generated header files 2018-02-26 11:44:46 -03:00
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
2018-02-18 10:38:49 -03:00
Vladimir Panteleev 87be623eac Add support for Linux TASK_IDLE
Linux commit 06eb61844d841d0032a9950ce7f8e783ee49c0d0 ("sched/debug:
Add explicit TASK_IDLE printing") exposes kthreads idling using
TASK_IDLE in procfs as "I (idle)".

Until now, when sorting the STATE ("S") column, htop used the raw
value of the state character for comparison, however that led to the
undesirable effect of TASK_IDLE ('I') tasks being sorted above tasks
that were running ('R').

Thus, explicitly recognize the idle process state, and sort it below
others.
2018-02-04 16:44:21 +01:00
Hisham Muhammad e3f65c8ec2 Make 'c' key work with threads as well. 2017-09-14 17:10:39 -03:00
Hisham 7ededce9b5 Silence cast warning. 2016-05-30 12:22:07 -03:00
Hisham 1cfcc42a8f Reuse comm object if possible, avoid useless repetitions of free+strdup. 2016-02-02 15:56:52 +01:00
Hisham Muhammad 802e216870 Extend buffer for reading lines from /proc.
Apparently a line longer than 255 chars was spotted in the wild:
http://serverfault.com/questions/577939/linux-ps-htop-show-processes-running-for-hundreds-or-thousands-of-days-though-h#comment676098_577939
2015-12-14 13:27:11 -02:00
Jardel Weyrich ffacac14a9 Remove duplicate declaration. 2015-09-10 10:45:22 -03:00
Hisham Muhammad 9428010121 Make column width calculation dynamic.
Closes #228.
2015-08-20 00:32:47 -03:00
sherpya a8e1c1c63f added missing defines for android 2015-05-20 04:30:11 +02:00
Hisham Muhammad d880def0e9 Merge branch 'master' into wip
Conflicts:
	Process.c
	Process.h
	htop.c
	linux/LinuxProcess.c
	linux/LinuxProcess.h
	test_spec.lua
2015-04-02 01:57:37 -03:00
Hisham Muhammad 4c24a9b462 Fixes to subclassing Process. 2015-03-31 23:23:10 -03:00
Hisham Muhammad b1b3f57976 Tempus fugit.
Conflicts:
	htop.c
	htop.h
2015-03-23 18:15:56 -03:00
Hisham Muhammad 1e0c530a46 Tempus fugit. 2015-03-21 16:52:54 -03:00
Hisham Muhammad 272e2d9b34 Major advances in FreeBSD port. 2015-03-16 23:02:03 -03:00
Hisham Muhammad be1700cf94 Isolate portable and Linux-specific process fields. 2015-03-16 01:43:04 -03:00
Hisham Muhammad e3fe3962cb Move more Linux-specific code into Linux subdir. 2015-03-15 20:29:13 -03:00
Hisham Muhammad 0a184b769f Merge fixes 2015-02-23 03:53:36 -03:00
Hisham Muhammad 9780c312f4 Fix allocation of processes. Closes #166.
Conflicts:
	Process.c
	Process.h
	ProcessList.c
	ScreenManager.c
	linux/LinuxProcessList.c
2015-02-23 01:13:40 -03:00
Hisham Muhammad 6f868b00c0 Fix allocation of processes. Closes #166. 2015-02-20 14:52:10 -02:00
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.)
2015-01-21 23:27:31 -02:00
Hisham Muhammad b4f6b11092 Move "get max pid" code into platform specific area. 2014-11-27 20:10:23 -02:00
Hisham Muhammad eb229d9aef Changes for supporting separate platform subdirectories. 2014-11-24 18:55:03 -02:00
Hisham Muhammad 78d09f955a Compare with long, for 64-bit systems 2014-04-25 19:41:23 -03:00
Hisham Muhammad e0209da88f Support pagefaults stats. Closes #45. 2014-04-24 19:40:47 -03:00
Hisham Muhammad 5d6ad853fa Support for very large numbers, now tested on a 64-bit machine. 2014-04-09 22:49:36 -03:00
Hisham Muhammad 127f847ca5 Support really large numbers on 64-bit architectures; first try. 2014-04-09 22:32:54 -03:00
Hisham Muhammad f2a190b0e9 New logic for highlighting basenames with spaces 2014-02-27 17:11:23 -03:00
Hisham Muhammad 6d90e58c01 alignment improvements 2014-02-27 16:35:22 -03:00
Leigh Simpson da236ca318 Added additional column to monitor OOM killer score of each process 2014-01-29 22:41:55 +00:00
Hisham Muhammad 6cfa9e0bf2 Performance improvements due to conditional parsing of IO data depending on selected fields.
On my machine, this gives a ~20% improvement in htop process time use with the default config.
2013-05-24 22:46:01 +00:00
Hisham Muhammad 00b324bfc1 Changes in object model: separate class objects to store vtable. Also, nicer UTF-8 display of big numbers. 2012-12-05 15:12:20 +00:00
Hisham Muhammad 47e881f460 Add IO priority support ('i' key) 2012-10-04 23:59:45 +00:00
Hisham Muhammad 84281bdc44 major header cleanup 2011-12-26 21:35:57 +00:00
Hisham Muhammad bc87a8ff8c Remove bundled hwloc-1.2.1. Use either native Linux affinity support or an external libhwloc.
(for details see https://sourceforge.net/mailarchive/forum.php?thread_name=CAJpkDYeZpwqcWxZ77wq6bMrnhn-KzkU1xAqb3cU0drfnA3n9FQ%40mail.gmail.com&forum_name=htop-general )
2011-11-21 02:52:41 +00:00