diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2023-04-08 01:03:31 -0400 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-04-08 10:55:59 +0200 |
commit | a096270c77b1f6461a2ef58660ad9cfa9cbb32bb (patch) | |
tree | b9c713ad70ae6705a1dfe6d76c35c0d918515d2e /utils | |
parent | 5de1b81f0bb24ba38d0a819bba9bd526863b5385 (diff) | |
download | hurd-a096270c77b1f6461a2ef58660ad9cfa9cbb32bb.tar.gz hurd-a096270c77b1f6461a2ef58660ad9cfa9cbb32bb.tar.bz2 hurd-a096270c77b1f6461a2ef58660ad9cfa9cbb32bb.zip |
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: <ZDD1o7/tVYeZew+G@jupiter.tail36e24.ts.net>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/rpcscan.c | 2 | ||||
-rw-r--r-- | utils/w.c | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/utils/rpcscan.c b/utils/rpcscan.c index c5a8addc..dc7dec3c 100644 --- a/utils/rpcscan.c +++ b/utils/rpcscan.c @@ -83,7 +83,7 @@ send (mach_msg_id_t msgid) return Message.Reply.RetCode; } -typedef error_t (*setup_function_t) (); +typedef error_t (*setup_function_t) (void); setup_function_t setup_target; void *setup_argument; @@ -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}, |