motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 72a7e3dc5e3d2128f4d95b7ba9554ea2e6e35139 (tree)
parent 304420b99ced44e1b7ebd34d7c3917879cb78648
Author: praschke <stel@comfy.monster>
Date:   Wed,  1 Feb 2023 20:52:06 +0000

mingw: stop using K&R-style function definitions

this patch is from upstream, to fix -Wdeprecated-non-prototypes issues.

K&R-style has apparently been deprecated since even C89, and C2x will be
repurposing the syntax space. this warning triggers when the change would
affect the meaning of the code.

Diffstat:
Mlib/libc/mingw/misc/strtoimax.c | 5+----
Mlib/libc/mingw/misc/strtoumax.c | 5+----
Mlib/libc/mingw/misc/wcstoimax.c | 5+----
Mlib/libc/mingw/misc/wcstoumax.c | 5+----
4 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/lib/libc/mingw/misc/strtoimax.c b/lib/libc/mingw/misc/strtoimax.c @@ -31,10 +31,7 @@ #define valid(n, b) ((n) >= 0 && (n) < (b)) intmax_t -strtoimax(nptr, endptr, base) - register const char * __restrict__ nptr; - char ** __restrict__ endptr; - register int base; +strtoimax(const char * __restrict__ nptr, char ** __restrict__ endptr, int base) { register uintmax_t accum; /* accumulates converted value */ register int n; /* numeral from digit character */ diff --git a/lib/libc/mingw/misc/strtoumax.c b/lib/libc/mingw/misc/strtoumax.c @@ -31,10 +31,7 @@ #define valid(n, b) ((n) >= 0 && (n) < (b)) uintmax_t -strtoumax(nptr, endptr, base) - register const char * __restrict__ nptr; - char ** __restrict__ endptr; - register int base; +strtoumax(const char * __restrict__ nptr, char ** __restrict__ endptr, int base) { register uintmax_t accum; /* accumulates converted value */ register uintmax_t next; /* for computing next value of accum */ diff --git a/lib/libc/mingw/misc/wcstoimax.c b/lib/libc/mingw/misc/wcstoimax.c @@ -33,10 +33,7 @@ #define valid(n, b) ((n) >= 0 && (n) < (b)) intmax_t -wcstoimax(nptr, endptr, base) - register const wchar_t * __restrict__ nptr; - wchar_t ** __restrict__ endptr; - register int base; +wcstoimax(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr, int base) { register uintmax_t accum; /* accumulates converted value */ register int n; /* numeral from digit character */ diff --git a/lib/libc/mingw/misc/wcstoumax.c b/lib/libc/mingw/misc/wcstoumax.c @@ -33,10 +33,7 @@ #define valid(n, b) ((n) >= 0 && (n) < (b)) uintmax_t -wcstoumax(nptr, endptr, base) - register const wchar_t * __restrict__ nptr; - wchar_t ** __restrict__ endptr; - register int base; +wcstoumax(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr, int base) { register uintmax_t accum; /* accumulates converted value */ register uintmax_t next; /* for computing next value of accum */