From 3873297b3ceb92a1a9dda56e7a1c900b37c83638 Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 24 Oct 2021 10:05:22 +0000 Subject: [PATCH] ansi ok mpi@ deraadt@ --- lib/libc/db/btree/bt_close.c | 9 +++---- lib/libc/db/btree/bt_utils.c | 5 ++-- lib/libc/db/hash/ndbm.c | 47 ++++++++++-------------------------- lib/libc/net/base64.c | 14 +++-------- lib/libc/stdio/fputws.c | 6 ++--- lib/libc/stdio/getwchar.c | 4 +-- lib/libc/stdlib/atoll.c | 5 ++-- 7 files changed, 28 insertions(+), 62 deletions(-) diff --git a/lib/libc/db/btree/bt_close.c b/lib/libc/db/btree/bt_close.c index 31cbec35fc8..745fd62e821 100644 --- a/lib/libc/db/btree/bt_close.c +++ b/lib/libc/db/btree/bt_close.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_close.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: bt_close.c,v 1.11 2021/10/24 10:05:22 jsg Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -107,9 +107,7 @@ __bt_close(DB *dbp) * RET_SUCCESS, RET_ERROR. */ int -__bt_sync(dbp, flags) - const DB *dbp; - u_int flags; +__bt_sync(const DB *dbp, u_int flags) { BTREE *t; int status; @@ -150,8 +148,7 @@ __bt_sync(dbp, flags) * RET_ERROR, RET_SUCCESS */ static int -bt_meta(t) - BTREE *t; +bt_meta(BTREE *t) { BTMETA m; void *p; diff --git a/lib/libc/db/btree/bt_utils.c b/lib/libc/db/btree/bt_utils.c index f442ff0ba4e..d3a66e663e7 100644 --- a/lib/libc/db/btree/bt_utils.c +++ b/lib/libc/db/btree/bt_utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_utils.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: bt_utils.c,v 1.12 2021/10/24 10:05:22 jsg Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -226,8 +226,7 @@ __bt_defcmp(const DBT *a, const DBT *b) * Number of bytes needed to distinguish b from a. */ size_t -__bt_defpfx(a, b) - const DBT *a, *b; +__bt_defpfx(const DBT *a, const DBT *b) { u_char *p1, *p2; size_t cnt, len; diff --git a/lib/libc/db/hash/ndbm.c b/lib/libc/db/hash/ndbm.c index 01c521f14cc..cc54ccf928a 100644 --- a/lib/libc/db/hash/ndbm.c +++ b/lib/libc/db/hash/ndbm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ndbm.c,v 1.26 2016/05/07 21:58:06 tedu Exp $ */ +/* $OpenBSD: ndbm.c,v 1.27 2021/10/24 10:05:22 jsg Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -57,11 +57,7 @@ static DBM *_dbm_open(const char *, const char *, int, mode_t); * NULL on failure */ static DBM * -_dbm_open(file, suff, flags, mode) - const char *file; - const char *suff; - int flags; - mode_t mode; +_dbm_open(const char *file, const char *suff, int flags, mode_t mode) { HASHINFO info; char path[PATH_MAX]; @@ -92,10 +88,7 @@ _dbm_open(file, suff, flags, mode) * NULL on failure */ DBM * -dbm_open(file, flags, mode) - const char *file; - int flags; - mode_t mode; +dbm_open(const char *file, int flags, mode_t mode) { return(_dbm_open(file, DBM_SUFFIX, flags, mode)); @@ -106,8 +99,7 @@ dbm_open(file, flags, mode) * Nothing. */ void -dbm_close(db) - DBM *db; +dbm_close(DBM *db) { (void)(db->close)(db); @@ -120,9 +112,7 @@ DEF_WEAK(dbm_close); * NULL on failure */ datum -dbm_fetch(db, key) - DBM *db; - datum key; +dbm_fetch(DBM *db, datum key) { datum retdata; int status; @@ -147,8 +137,7 @@ DEF_WEAK(dbm_fetch); * NULL on failure */ datum -dbm_firstkey(db) - DBM *db; +dbm_firstkey(DBM *db) { int status; datum retkey; @@ -169,8 +158,7 @@ DEF_WEAK(dbm_firstkey); * NULL on failure */ datum -dbm_nextkey(db) - DBM *db; +dbm_nextkey(DBM *db) { int status; datum retkey; @@ -191,9 +179,7 @@ DEF_WEAK(dbm_nextkey); * <0 on failure */ int -dbm_delete(db, key) - DBM *db; - datum key; +dbm_delete(DBM *db, datum key) { int status; DBT dbtkey; @@ -215,10 +201,7 @@ DEF_WEAK(dbm_delete); * 1 if DBM_INSERT and entry exists */ int -dbm_store(db, key, data, flags) - DBM *db; - datum key, data; - int flags; +dbm_store(DBM *db, datum key, datum data, int flags) { DBT dbtkey, dbtdata; @@ -232,8 +215,7 @@ dbm_store(db, key, data, flags) DEF_WEAK(dbm_store); int -dbm_error(db) - DBM *db; +dbm_error(DBM *db) { HTAB *hp; @@ -242,8 +224,7 @@ dbm_error(db) } int -dbm_clearerr(db) - DBM *db; +dbm_clearerr(DBM *db) { HTAB *hp; @@ -253,16 +234,14 @@ dbm_clearerr(db) } int -dbm_dirfno(db) - DBM *db; +dbm_dirfno(DBM *db) { return(((HTAB *)db->internal)->fp); } int -dbm_rdonly(dbp) - DBM *dbp; +dbm_rdonly(DBM *dbp) { HTAB *hashp = (HTAB *)dbp->internal; diff --git a/lib/libc/net/base64.c b/lib/libc/net/base64.c index 5b150d38810..76f2f910a26 100644 --- a/lib/libc/net/base64.c +++ b/lib/libc/net/base64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: base64.c,v 1.12 2021/10/22 10:22:15 tb Exp $ */ +/* $OpenBSD: base64.c,v 1.13 2021/10/24 10:05:22 jsg Exp $ */ /* * Copyright (c) 1996 by Internet Software Consortium. @@ -121,11 +121,8 @@ static const char Pad64 = '='; */ int -b64_ntop(src, srclength, target, targsize) - unsigned char const *src; - size_t srclength; - char *target; - size_t targsize; +b64_ntop(unsigned char const *src, size_t srclength, char *target, + size_t targsize) { size_t datalength = 0; unsigned char input[3]; @@ -185,10 +182,7 @@ b64_ntop(src, srclength, target, targsize) */ int -b64_pton(src, target, targsize) - char const *src; - unsigned char *target; - size_t targsize; +b64_pton(char const *src, unsigned char *target, size_t targsize) { int tarindex, state, ch; unsigned char nextbyte; diff --git a/lib/libc/stdio/fputws.c b/lib/libc/stdio/fputws.c index 8961571188d..4f619b6d89f 100644 --- a/lib/libc/stdio/fputws.c +++ b/lib/libc/stdio/fputws.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fputws.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */ +/* $OpenBSD: fputws.c,v 1.9 2021/10/24 10:05:23 jsg Exp $ */ /* $NetBSD: fputws.c,v 1.1 2003/03/07 07:11:37 tshiozak Exp $ */ /*- @@ -37,9 +37,7 @@ #include "fvwrite.h" int -fputws(ws, fp) - const wchar_t * __restrict ws; - FILE * __restrict fp; +fputws(const wchar_t * __restrict ws, FILE * __restrict fp) { FLOCKFILE(fp); _SET_ORIENTATION(fp, 1); diff --git a/lib/libc/stdio/getwchar.c b/lib/libc/stdio/getwchar.c index 644b553ce6c..73a91cb0b12 100644 --- a/lib/libc/stdio/getwchar.c +++ b/lib/libc/stdio/getwchar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getwchar.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */ +/* $OpenBSD: getwchar.c,v 1.3 2021/10/24 10:05:23 jsg Exp $ */ /* $NetBSD: getwchar.c,v 1.2 2003/01/18 11:29:55 thorpej Exp $ */ /*- @@ -38,7 +38,7 @@ #undef getwchar wint_t -getwchar() +getwchar(void) { return fgetwc(stdin); diff --git a/lib/libc/stdlib/atoll.c b/lib/libc/stdlib/atoll.c index a65e682cfb4..32caf299e42 100644 --- a/lib/libc/stdlib/atoll.c +++ b/lib/libc/stdlib/atoll.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atoll.c,v 1.3 2005/08/08 08:05:36 espie Exp $ */ +/* $OpenBSD: atoll.c,v 1.4 2021/10/24 10:05:23 jsg Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -31,8 +31,7 @@ #include long long -atoll(str) - const char *str; +atoll(const char *str) { return(strtoll(str, (char **)NULL, 10)); } -- 2.20.1