From 0dc4923bc1229ac056b114a0f0a64a380092b615 Mon Sep 17 00:00:00 2001 From: cheusov Date: Thu, 18 Mar 2021 18:12:35 +0000 Subject: [PATCH] cksum: use POSIX type uint32_t instead of u_int32_t --- usr.bin/cksum/cksum.c | 12 ++++++------ usr.bin/cksum/crc.c | 10 +++++----- usr.bin/cksum/crc_extern.h | 4 ++-- usr.bin/cksum/extern.h | 14 +++++++------- usr.bin/cksum/print.c | 10 +++++----- usr.bin/cksum/sum1.c | 6 +++--- usr.bin/cksum/sum2.c | 8 ++++---- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/usr.bin/cksum/cksum.c b/usr.bin/cksum/cksum.c index 9e7e87aad346..d6ec9bfe1f20 100644 --- a/usr.bin/cksum/cksum.c +++ b/usr.bin/cksum/cksum.c @@ -1,4 +1,4 @@ -/* $NetBSD: cksum.c,v 1.48 2015/06/16 22:54:10 christos Exp $ */ +/* $NetBSD: cksum.c,v 1.49 2021/03/18 18:12:35 cheusov Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\ #if 0 static char sccsid[] = "@(#)cksum.c 8.2 (Berkeley) 4/28/95"; #endif -__RCSID("$NetBSD: cksum.c,v 1.48 2015/06/16 22:54:10 christos Exp $"); +__RCSID("$NetBSD: cksum.c,v 1.49 2021/03/18 18:12:35 cheusov Exp $"); #endif /* not lint */ #include @@ -153,12 +153,12 @@ int main(int argc, char **argv) { int ch, fd, rval, pflag, nohashstdin; - u_int32_t val; + uint32_t val; off_t len; char *fn; const char *progname; - int (*cfncn) (int, u_int32_t *, off_t *); - void (*pfncn) (char *, u_int32_t, off_t); + int (*cfncn) (int, uint32_t *, off_t *); + void (*pfncn) (char *, uint32_t, off_t); const struct hash *hash; int i, check_warn, do_check; int print_flags; @@ -436,7 +436,7 @@ main(int argc, char **argv) if (cfncn(fd, &val, &len)) ok = 0; else { - u_int32_t should_val; + uint32_t should_val; should_val = strtoul(cksum, NULL, 10); diff --git a/usr.bin/cksum/crc.c b/usr.bin/cksum/crc.c index 96dc33eabfb8..8d42856eb53f 100644 --- a/usr.bin/cksum/crc.c +++ b/usr.bin/cksum/crc.c @@ -1,4 +1,4 @@ -/* $NetBSD: crc.c,v 1.21 2020/04/27 07:30:54 martin Exp $ */ +/* $NetBSD: crc.c,v 1.22 2021/03/18 18:12:35 cheusov Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 6/17/93"; #else -__RCSID("$NetBSD: crc.c,v 1.21 2020/04/27 07:30:54 martin Exp $"); +__RCSID("$NetBSD: crc.c,v 1.22 2021/03/18 18:12:35 cheusov Exp $"); #endif #endif /* not lint */ @@ -52,7 +52,7 @@ __RCSID("$NetBSD: crc.c,v 1.21 2020/04/27 07:30:54 martin Exp $"); #include "extern.h" -static const u_int32_t crctab[] = { +static const uint32_t crctab[] = { 0x0, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, @@ -114,10 +114,10 @@ static const u_int32_t crctab[] = { * success and 1 on failure. Errno is set on failure. */ int -crc(int fd, u_int32_t *cval, off_t *clen) +crc(int fd, uint32_t *cval, off_t *clen) { ssize_t nr; - u_int32_t thecrc; + uint32_t thecrc; off_t len; u_char buf[16 * 1024]; diff --git a/usr.bin/cksum/crc_extern.h b/usr.bin/cksum/crc_extern.h index b0c1c33d2f4f..65f32dd16069 100644 --- a/usr.bin/cksum/crc_extern.h +++ b/usr.bin/cksum/crc_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: crc_extern.h,v 1.1 2006/09/04 20:01:10 dsl Exp $ */ +/* $NetBSD: crc_extern.h,v 1.2 2021/03/18 18:12:35 cheusov Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -32,7 +32,7 @@ */ __BEGIN_DECLS -int crc(int, u_int32_t *, off_t *); +int crc(int, uint32_t *, off_t *); uint32_t crc_buf(uint32_t, const void *, size_t); uint32_t crc_byte(uint32_t, unsigned int); __END_DECLS diff --git a/usr.bin/cksum/extern.h b/usr.bin/cksum/extern.h index 8384110ca8ec..dd8b762a3c83 100644 --- a/usr.bin/cksum/extern.h +++ b/usr.bin/cksum/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.19 2006/09/04 20:01:10 dsl Exp $ */ +/* $NetBSD: extern.h,v 1.20 2021/03/18 18:12:35 cheusov Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,12 +39,12 @@ #include "crc_extern.h" __BEGIN_DECLS -void pcrc(char *, u_int32_t, off_t); -void psum1(char *, u_int32_t, off_t); -void psum2(char *, u_int32_t, off_t); -int csum1(int, u_int32_t *, off_t *); -int csum2(int, u_int32_t *, off_t *); -int md5(int, u_int32_t *, u_int32_t *); +void pcrc(char *, uint32_t, off_t); +void psum1(char *, uint32_t, off_t); +void psum2(char *, uint32_t, off_t); +int csum1(int, uint32_t *, off_t *); +int csum2(int, uint32_t *, off_t *); +int md5(int, uint32_t *, uint32_t *); void MD2String(const char *); void MD2TimeTrial(void); diff --git a/usr.bin/cksum/print.c b/usr.bin/cksum/print.c index 03dbd5a9e980..cb6240ec6b0e 100644 --- a/usr.bin/cksum/print.c +++ b/usr.bin/cksum/print.c @@ -1,4 +1,4 @@ -/* $NetBSD: print.c,v 1.11 2005/01/12 17:04:35 xtraeme Exp $ */ +/* $NetBSD: print.c,v 1.12 2021/03/18 18:12:35 cheusov Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: print.c,v 1.11 2005/01/12 17:04:35 xtraeme Exp $"); +__RCSID("$NetBSD: print.c,v 1.12 2021/03/18 18:12:35 cheusov Exp $"); #endif #endif /* not lint */ @@ -47,7 +47,7 @@ __RCSID("$NetBSD: print.c,v 1.11 2005/01/12 17:04:35 xtraeme Exp $"); #include "extern.h" void -pcrc(char *fn, u_int32_t val, off_t len) +pcrc(char *fn, uint32_t val, off_t len) { (void)printf("%lu %lld", (unsigned long)val, (long long)len); if (fn) @@ -56,7 +56,7 @@ pcrc(char *fn, u_int32_t val, off_t len) } void -psum1(char *fn, u_int32_t val, off_t len) +psum1(char *fn, uint32_t val, off_t len) { (void)printf("%lu %lld", (unsigned long)val, (long long)(len + 1023) / 1024); @@ -66,7 +66,7 @@ psum1(char *fn, u_int32_t val, off_t len) } void -psum2(char *fn, u_int32_t val, off_t len) +psum2(char *fn, uint32_t val, off_t len) { (void)printf("%lu %lld", (unsigned long)val, (long long)(len + 511) / 512); diff --git a/usr.bin/cksum/sum1.c b/usr.bin/cksum/sum1.c index 22e466e5ff52..92b82981788b 100644 --- a/usr.bin/cksum/sum1.c +++ b/usr.bin/cksum/sum1.c @@ -1,4 +1,4 @@ -/* $NetBSD: sum1.c,v 1.13 2005/02/05 00:13:34 simonb Exp $ */ +/* $NetBSD: sum1.c,v 1.14 2021/03/18 18:12:35 cheusov Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)sum1.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: sum1.c,v 1.13 2005/02/05 00:13:34 simonb Exp $"); +__RCSID("$NetBSD: sum1.c,v 1.14 2021/03/18 18:12:35 cheusov Exp $"); #endif #endif /* not lint */ @@ -48,7 +48,7 @@ __RCSID("$NetBSD: sum1.c,v 1.13 2005/02/05 00:13:34 simonb Exp $"); #include "extern.h" int -csum1(int fd, u_int32_t *cval, off_t *clen) +csum1(int fd, uint32_t *cval, off_t *clen) { off_t total; int nr; diff --git a/usr.bin/cksum/sum2.c b/usr.bin/cksum/sum2.c index 34b3e2ec491f..e043316288a2 100644 --- a/usr.bin/cksum/sum2.c +++ b/usr.bin/cksum/sum2.c @@ -1,4 +1,4 @@ -/* $NetBSD: sum2.c,v 1.13 2005/02/05 00:13:34 simonb Exp $ */ +/* $NetBSD: sum2.c,v 1.14 2021/03/18 18:12:35 cheusov Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)sum2.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: sum2.c,v 1.13 2005/02/05 00:13:34 simonb Exp $"); +__RCSID("$NetBSD: sum2.c,v 1.14 2021/03/18 18:12:35 cheusov Exp $"); #endif #endif /* not lint */ @@ -48,9 +48,9 @@ __RCSID("$NetBSD: sum2.c,v 1.13 2005/02/05 00:13:34 simonb Exp $"); #include "extern.h" int -csum2(int fd, u_int32_t *cval, off_t *clen) +csum2(int fd, uint32_t *cval, off_t *clen) { - u_int32_t thecrc; + uint32_t thecrc; off_t total; int nr; u_char *p;