From 0209b2c932994e9ca55d39d98a83ea02aacd1332 Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Sat, 18 Mar 2023 23:18:11 -0400 Subject: Modernize code by removing use of old style definitions. Also add -Werror=old-style-definition to enforce new code. Message-Id: --- libshouldbeinlibc/idvec.c | 2 +- libshouldbeinlibc/localhost.c | 2 +- libshouldbeinlibc/portinfo.c | 4 ++-- libshouldbeinlibc/ugids.c | 2 +- libshouldbeinlibc/wire.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'libshouldbeinlibc') diff --git a/libshouldbeinlibc/idvec.c b/libshouldbeinlibc/idvec.c index 84131a62..848c4c52 100644 --- a/libshouldbeinlibc/idvec.c +++ b/libshouldbeinlibc/idvec.c @@ -25,7 +25,7 @@ /* Return a new, empty, idvec, or NULL if there wasn't enough memory. */ struct idvec * -make_idvec () +make_idvec (void) { struct idvec *idvec = malloc (sizeof (struct idvec)); if (idvec) diff --git a/libshouldbeinlibc/localhost.c b/libshouldbeinlibc/localhost.c index 9b7d4e09..96fd649e 100644 --- a/libshouldbeinlibc/localhost.c +++ b/libshouldbeinlibc/localhost.c @@ -28,7 +28,7 @@ after the first call (so the result should be copied before modification). If something goes wrong, 0 is returned, and errno set. */ char * -localhost () +localhost (void) { static char *buf = 0; static size_t buf_len = 0; diff --git a/libshouldbeinlibc/portinfo.c b/libshouldbeinlibc/portinfo.c index 42b22081..75a20bb9 100644 --- a/libshouldbeinlibc/portinfo.c +++ b/libshouldbeinlibc/portinfo.c @@ -43,14 +43,14 @@ print_port_info (mach_port_t name, mach_port_type_t type, task_t task, { int hex_names = (show & PORTINFO_HEX_NAMES); int first = 1, subfirst = 1; - void comma () + void comma (void) { if (first) first = 0; else fprintf (stream, ", "); } - void subcomma () + void subcomma (void) { if (subfirst) subfirst = 0; diff --git a/libshouldbeinlibc/ugids.c b/libshouldbeinlibc/ugids.c index cb2631be..4282c760 100644 --- a/libshouldbeinlibc/ugids.c +++ b/libshouldbeinlibc/ugids.c @@ -26,7 +26,7 @@ /* Return a new ugids structure, or 0 if an allocation error occurs. */ struct ugids * -make_ugids () +make_ugids (void) { struct ugids *u = malloc (sizeof (struct ugids)); if (u) diff --git a/libshouldbeinlibc/wire.c b/libshouldbeinlibc/wire.c index 5d7fcfc5..ea6c5526 100644 --- a/libshouldbeinlibc/wire.c +++ b/libshouldbeinlibc/wire.c @@ -127,7 +127,7 @@ wire_segment (vm_address_t start, /* Wire down all the text and data (including from shared libraries) for the current program. */ error_t -wire_task_self () +wire_task_self (void) { mach_port_t host, device; error_t err; -- cgit v1.2.3