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: --- utils/w.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'utils/w.c') diff --git a/utils/w.c b/utils/w.c index ac5e36f8..d6977c4e 100644 --- a/utils/w.c +++ b/utils/w.c @@ -48,7 +48,7 @@ extern char *canon_host (char *host); extern char *shared_domain (char *host1, char *host2); -extern char *localhost (); +extern char *localhost (void); const char *argp_program_version = STANDARD_HURD_VERSION (w); @@ -218,7 +218,7 @@ w_get_user (struct proc_stat *ps) return hook->user; } const struct ps_getter w_user_getter = -{"user", W_PSTAT_USER, (void (*)())w_get_user}; +{"user", W_PSTAT_USER, (void (*)(void))w_get_user}; static void w_get_host (struct proc_stat *ps, char **host, unsigned *host_len) @@ -230,10 +230,6 @@ w_get_host (struct proc_stat *ps, char **host, unsigned *host_len) const struct ps_getter w_host_getter = {"host", W_PSTAT_HOST, w_get_host}; -extern error_t ps_emit_past_time (), ps_emit_string (), ps_emit_minutes (); -extern error_t ps_emit_user_name (); -extern int ps_cmp_times (), ps_cmp_strings (), ps_cmp_unames (); -extern int ps_nominal_string (); const struct ps_fmt_spec _w_specs[] = { {"User", 0, 8, -1,0, &w_uname_getter,ps_emit_string, ps_cmp_strings}, -- cgit v1.2.3