Le 18 juil. 2022 02:24, Xin LI <delp...@freebsd.org> a écrit :

The branch main has been updated by delphij:

URL: https://cgit.FreeBSD.org/src/commit/?id=1fbfa7a8dcd091e79754017cb543bab01fa6c157

commit 1fbfa7a8dcd091e79754017cb543bab01fa6c157
Author:     Xin LI <delp...@freebsd.org>
AuthorDate: 2022-07-18 00:24:31 +0000
Commit:     Xin LI <delp...@freebsd.org>
CommitDate: 2022-07-18 00:24:31 +0000

    usr.bin/cksum: localize _total variables.
---
usr.bin/cksum/crc.c    | 2 +-
usr.bin/cksum/crc32.c  | 2 +-
usr.bin/cksum/extern.h | 3 ---
3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/usr.bin/cksum/crc.c b/usr.bin/cksum/crc.c
index e110111084b7..b7285132e9b9 100644
--- a/usr.bin/cksum/crc.c
+++ b/usr.bin/cksum/crc.c
@@ -108,7 +108,7 @@ static const uint32_t crctab[] = {
  * locations to store the crc and the number of bytes read.  It returns 0 on
  * success and 1 on failure.  Errno is set on failure.
  */
-uint32_t crc_total = ~0; /* The crc over a number of files. */
+static uint32_t crc_total = ~0; /* The crc over a number of files. */

int
crc(int fd, uint32_t *cval, off_t *clen)
diff --git a/usr.bin/cksum/crc32.c b/usr.bin/cksum/crc32.c
index cadbc17b69bb..4389969716c3 100644
--- a/usr.bin/cksum/crc32.c
+++ b/usr.bin/cksum/crc32.c
@@ -95,7 +95,7 @@ static const uint32_t crctab[256] = {
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,
};

-uint32_t crc32_total = 0;
+static uint32_t crc32_total = 0;

int
crc32(int fd, uint32_t *cval, off_t *clen)
diff --git a/usr.bin/cksum/extern.h b/usr.bin/cksum/extern.h
index 43a31db704c7..ce18531d0f13 100644
--- a/usr.bin/cksum/extern.h
+++ b/usr.bin/cksum/extern.h
@@ -34,9 +34,6 @@

#include <sys/cdefs.h>

-extern uint32_t crc_total;
-extern uint32_t crc32_total;
-
__BEGIN_DECLS
int crc(int, uint32_t *, off_t *);
void pcrc(char *, uint32_t, off_t);


Reply via email to