From a096270c77b1f6461a2ef58660ad9cfa9cbb32bb Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Sat, 8 Apr 2023 01:03:31 -0400 Subject: Further modernize Hurd code by enforcing strict prototypes and no implicit function declarations. Most of the changes land in one of these buckets: * Removed unused declarations. * Used (void) to represent no parameters instead of () which means an undeterminate number of parameters. * Included missing header files whenever necessary (stdlib.h, sys/mman.h, etc) * Typedefed function pointers to be able to fully declare the parameter types. * Added declarations of library functions that are used elsewhere (example is libps/ps.h). * Made functions static whenever they are only used in that file. * Forwarded declarations of some methods that were made static. Message-Id: --- libps/proclist.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libps/proclist.c') diff --git a/libps/proclist.c b/libps/proclist.c index c9ceaf0a..814ae30e 100644 --- a/libps/proclist.c +++ b/libps/proclist.c @@ -459,9 +459,7 @@ proc_stat_list_filter (struct proc_stat_list *pp, error_t proc_stat_list_sort1 (struct proc_stat_list *pp, const struct ps_getter *getter, - int (*cmp_fn)(struct proc_stat *ps1, - struct proc_stat *ps2, - const struct ps_getter *getter), + proc_stat_cmp_fun cmp_fn, int reverse) { int needs = ps_getter_needs (getter); @@ -521,7 +519,7 @@ error_t proc_stat_list_sort (struct proc_stat_list *pp, const struct ps_fmt_spec *key, int reverse) { - int (*cmp_fn)() = ps_fmt_spec_compare_fn (key); + proc_stat_cmp_fun cmp_fn = ps_fmt_spec_compare_fn (key); if (cmp_fn == NULL) return EINVAL; else -- cgit v1.2.3