From 1f551737e838723f9ad9be1692bb12a9a3b4cdd9 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 23 Feb 2023 18:15:50 -0500 Subject: [PATCH] libvbr/vbr.c: modernize vbr_strlcpy() signature. The vbr_strlcpy() function declares that its arguments should live in registers: vbr_strlcpy(dst, src, size) register char *dst; register const char *src; ssize_t size; { ... This makes GCC unhappy when -Werror=strict-prototypes is used: vbr.c:167:1: error: function declaration isn't a prototype [-Werror=strict-prototypes] 167 | vbr_strlcpy(dst, src, size) The "register" keyword is largely obsolete on modern systems anyway, since the compiler is better at determining how to move memory around than the programmer is. So to appease GCC and simplify the code a bit, the signature has been changed to, vbr_strlcpy(char *dst, const char *src, ssize_t size) { ... } changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch configure.ac-c-standard # Your branch is up to date with 'origin/configure.ac-c-standard'. # # Changes to be committed: # modified: libvbr/vbr.c # # Changes not staged for commit: # modified: configure # # Untracked files: # 0000-cover-letter.patch # --- libvbr/vbr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libvbr/vbr.c b/libvbr/vbr.c index cb9124d7..c6a2439f 100644 --- a/libvbr/vbr.c +++ b/libvbr/vbr.c @@ -164,12 +164,9 @@ static void vbr_error __P((VBR *, const char *, ...)); */ size_t -vbr_strlcpy(dst, src, size) - register char *dst; - register const char *src; - ssize_t size; +vbr_strlcpy(char *dst, const char *src, ssize_t size) { - register ssize_t i; + ssize_t i; if (size-- <= 0) return strlen(src);