Skip to content

Commit f8570f8

Browse files
fix simple mis-matched function prototype and definitions.
most of these are like, eg void foo(int[2]); with either of these void foo(int*) { ... } void foo(int[]) { ... } in some cases (such as stat or utimes* calls found in our header files), we now match standard definition from opengroup. found by GCC 12.
1 parent 718c7fa commit f8570f8

File tree

33 files changed

+125
-115
lines changed

33 files changed

+125
-115
lines changed

bin/ed/cbc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: cbc.c,v 1.25 2018/02/08 09:05:16 dholland Exp $ */
1+
/* $NetBSD: cbc.c,v 1.26 2023/08/01 07:04:14 mrg Exp $ */
22

33
/* cbc.c: This file contains the encryption routines for the ed line editor */
44
/*-
@@ -72,7 +72,7 @@
7272
#if 0
7373
static char *rcsid = "@(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp";
7474
#else
75-
__RCSID("$NetBSD: cbc.c,v 1.25 2018/02/08 09:05:16 dholland Exp $");
75+
__RCSID("$NetBSD: cbc.c,v 1.26 2023/08/01 07:04:14 mrg Exp $");
7676
#endif
7777
#endif /* not lint */
7878

@@ -145,7 +145,7 @@ static int des_n = 0; /* index for put_des_char/get_des_char */
145145
static void des_error(const char *);
146146
static int hex_to_binary(int, int);
147147
static void expand_des_key(char *, char *);
148-
static void set_des_key(char *);
148+
static void set_des_key(Desbuf);
149149
static int cbc_decode(char *, FILE *);
150150
static int cbc_encode(char *, int, FILE *);
151151
#endif

crypto/external/bsd/netpgp/dist/src/netpgpverify/sha2.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: sha2.c,v 1.4 2018/08/13 09:54:19 christos Exp $ */
1+
/* $NetBSD: sha2.c,v 1.5 2023/08/01 07:04:14 mrg Exp $ */
22
/* $KAME: sha2.c,v 1.9 2003/07/20 00:28:38 itojun Exp $ */
33

44
/*
@@ -588,7 +588,7 @@ netpgpv_SHA224_256_Final(uint8_t digest[], NETPGPV_SHA256_CTX *context, size_t l
588588
}
589589

590590
int
591-
netpgpv_SHA256_Final(uint8_t digest[], NETPGPV_SHA256_CTX *context)
591+
netpgpv_SHA256_Final(uint8_t digest[32], NETPGPV_SHA256_CTX *context)
592592
{
593593
return netpgpv_SHA224_256_Final(digest, context, SHA256_DIGEST_LENGTH);
594594
}
@@ -622,7 +622,7 @@ netpgpv_SHA224_Transform(NETPGPV_SHA224_CTX *context, const uint32_t *data)
622622
}
623623

624624
int
625-
netpgpv_SHA224_Final(uint8_t digest[], NETPGPV_SHA224_CTX *context)
625+
netpgpv_SHA224_Final(uint8_t digest[28], NETPGPV_SHA224_CTX *context)
626626
{
627627
return netpgpv_SHA224_256_Final(digest, (NETPGPV_SHA256_CTX *)context,
628628
SHA224_DIGEST_LENGTH);
@@ -915,7 +915,7 @@ netpgpv_SHA512_Last(NETPGPV_SHA512_CTX *context)
915915
}
916916

917917
int
918-
netpgpv_SHA512_Final(uint8_t digest[], NETPGPV_SHA512_CTX *context)
918+
netpgpv_SHA512_Final(uint8_t digest[64], NETPGPV_SHA512_CTX *context)
919919
{
920920
size_t i;
921921

@@ -962,7 +962,7 @@ netpgpv_SHA384_Transform(NETPGPV_SHA512_CTX *context, const uint64_t *data)
962962
}
963963

964964
int
965-
netpgpv_SHA384_Final(uint8_t digest[], NETPGPV_SHA384_CTX *context)
965+
netpgpv_SHA384_Final(uint8_t digest[48], NETPGPV_SHA384_CTX *context)
966966
{
967967
size_t i;
968968

dist/pf/sbin/pfctl/pfctl_radix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: pfctl_radix.c,v 1.5 2008/06/18 09:06:26 yamt Exp $ */
1+
/* $NetBSD: pfctl_radix.c,v 1.6 2023/08/01 07:04:14 mrg Exp $ */
22
/* $OpenBSD: pfctl_radix.c,v 1.27 2005/05/21 21:03:58 henning Exp $ */
33

44
/*
@@ -52,7 +52,7 @@
5252

5353
extern int dev;
5454

55-
static int pfr_next_token(char buf[], FILE *);
55+
static int pfr_next_token(char buf[BUF_SIZE], FILE *);
5656

5757

5858
int

external/bsd/libarchive/dist/libarchive/archive_read_support_format_warc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static int _warc_skip(struct archive_read *a);
127127
static int _warc_rdhdr(struct archive_read *a, struct archive_entry *e);
128128

129129
/* private routines */
130-
static unsigned int _warc_rdver(const char buf[10], size_t bsz);
130+
static unsigned int _warc_rdver(const char *buf, size_t bsz);
131131
static unsigned int _warc_rdtyp(const char *buf, size_t bsz);
132132
static warc_string_t _warc_rduri(const char *buf, size_t bsz);
133133
static ssize_t _warc_rdlen(const char *buf, size_t bsz);

external/bsd/libevent/dist/util-internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: util-internal.h,v 1.7 2021/04/10 19:18:45 rillig Exp $ */
1+
/* $NetBSD: util-internal.h,v 1.8 2023/08/01 07:04:14 mrg Exp $ */
22

33
/*
44
* Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -305,7 +305,7 @@ int evutil_socket_connect_(evutil_socket_t *fd_ptr, const struct sockaddr *sa, i
305305
int evutil_socket_finished_connecting_(evutil_socket_t fd);
306306

307307
EVENT2_EXPORT_SYMBOL
308-
int evutil_ersatz_socketpair_(int, int , int, evutil_socket_t[]);
308+
int evutil_ersatz_socketpair_(int, int , int, evutil_socket_t[2]);
309309

310310
int evutil_resolve_(int family, const char *hostname, struct sockaddr *sa,
311311
ev_socklen_t *socklen, int port);

external/bsd/ntp/dist/sntp/libevent/util-internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: util-internal.h,v 1.6 2020/05/25 20:47:33 christos Exp $ */
1+
/* $NetBSD: util-internal.h,v 1.7 2023/08/01 07:04:14 mrg Exp $ */
22

33
/*
44
* Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -267,7 +267,7 @@ int evutil_socket_connect_(evutil_socket_t *fd_ptr, struct sockaddr *sa, int soc
267267

268268
int evutil_socket_finished_connecting_(evutil_socket_t fd);
269269

270-
int evutil_ersatz_socketpair_(int, int , int, evutil_socket_t[]);
270+
int evutil_ersatz_socketpair_(int, int , int, evutil_socket_t[2]);
271271

272272
int evutil_resolve_(int family, const char *hostname, struct sockaddr *sa,
273273
ev_socklen_t *socklen, int port);

external/bsd/nvi/dist/ex/ex_subst.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: ex_subst.c,v 1.4 2014/01/26 21:43:45 christos Exp $ */
1+
/* $NetBSD: ex_subst.c,v 1.5 2023/08/01 07:04:14 mrg Exp $ */
22
/*-
33
* Copyright (c) 1992, 1993, 1994
44
* The Regents of the University of California. All rights reserved.
@@ -16,7 +16,7 @@
1616
static const char sccsid[] = "Id: ex_subst.c,v 10.50 2002/02/09 21:18:23 skimo Exp (Berkeley) Date: 2002/02/09 21:18:23 ";
1717
#endif /* not lint */
1818
#else
19-
__RCSID("$NetBSD: ex_subst.c,v 1.4 2014/01/26 21:43:45 christos Exp $");
19+
__RCSID("$NetBSD: ex_subst.c,v 1.5 2023/08/01 07:04:14 mrg Exp $");
2020
#endif
2121

2222
#include <sys/types.h>
@@ -1320,7 +1320,7 @@ re_error(SCR *sp, int errcode, regex_t *preg)
13201320
* Do the substitution for a regular expression.
13211321
*/
13221322
static int
1323-
re_sub(SCR *sp, CHAR_T *ip, CHAR_T **lbp, size_t *lbclenp, size_t *lblenp, regmatch_t *match)
1323+
re_sub(SCR *sp, CHAR_T *ip, CHAR_T **lbp, size_t *lbclenp, size_t *lblenp, regmatch_t match[10])
13241324

13251325
/* Input line. */
13261326

external/bsd/ppp/dist/pppd/chap_ms.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: chap_ms.c,v 1.5 2021/01/09 16:39:28 christos Exp $ */
1+
/* $NetBSD: chap_ms.c,v 1.6 2023/08/01 07:04:15 mrg Exp $ */
22

33
/*
44
* chap_ms.c - Microsoft MS-CHAP compatible implementation.
@@ -81,7 +81,7 @@
8181
#define RCSID "Id: chap_ms.c,v 1.38 2007/12/01 20:10:51 carlsonj Exp "
8282
static const char rcsid[] = RCSID;
8383
#else
84-
__RCSID("$NetBSD: chap_ms.c,v 1.5 2021/01/09 16:39:28 christos Exp $");
84+
__RCSID("$NetBSD: chap_ms.c,v 1.6 2023/08/01 07:04:15 mrg Exp $");
8585
#endif
8686

8787
#ifdef CHAPMS
@@ -108,7 +108,8 @@ __RCSID("$NetBSD: chap_ms.c,v 1.5 2021/01/09 16:39:28 christos Exp $");
108108

109109
static void ascii2unicode (char[], int, u_char[]);
110110
static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]);
111-
static void ChallengeResponse (u_char *, u_char *, u_char[24]);
111+
static void ChallengeResponse (u_char *, u_char[MD4_SIGNATURE_SIZE],
112+
u_char[24]);
112113
static void ChapMS_NT (u_char *, char *, int, u_char[24]);
113114
static void ChapMS2_NT (u_char *, u_char[16], char *, char *, int,
114115
u_char[24]);
@@ -923,7 +924,7 @@ ChapMS(u_char *rchallenge, char *secret, int secret_len,
923924
void
924925
ChapMS2(u_char *rchallenge, u_char *PeerChallenge,
925926
char *user, char *secret, int secret_len, unsigned char *response,
926-
u_char authResponse[], int authenticator)
927+
u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1], int authenticator)
927928
{
928929
/* ARGSUSED */
929930
u_char *p = &response[MS_CHAP2_PEER_CHALLENGE];

games/sail/dr_5.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: dr_5.c,v 1.14 2009/03/14 22:52:52 dholland Exp $ */
1+
/* $NetBSD: dr_5.c,v 1.15 2023/08/01 07:04:15 mrg Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -34,15 +34,15 @@
3434
#if 0
3535
static char sccsid[] = "@(#)dr_5.c 8.2 (Berkeley) 4/28/95";
3636
#else
37-
__RCSID("$NetBSD: dr_5.c,v 1.14 2009/03/14 22:52:52 dholland Exp $");
37+
__RCSID("$NetBSD: dr_5.c,v 1.15 2023/08/01 07:04:15 mrg Exp $");
3838
#endif
3939
#endif /* not lint */
4040

4141
#include <sys/types.h>
4242
#include "extern.h"
4343

4444
void
45-
subtract(struct ship *from, struct ship *fromcap, int totalfrom, int *crewfrom,
45+
subtract(struct ship *from, struct ship *fromcap, int totalfrom, int crewfrom[3],
4646
int pcfrom)
4747
{
4848
int n;
@@ -66,7 +66,7 @@ subtract(struct ship *from, struct ship *fromcap, int totalfrom, int *crewfrom,
6666
}
6767

6868
int
69-
mensent(struct ship *from, struct ship *to, int *crew, struct ship **captured,
69+
mensent(struct ship *from, struct ship *to, int crew[3], struct ship **captured,
7070
int *pc, int isdefense)
7171
{ /* returns # of crew squares sent */
7272
int men = 0;

include/md2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: md2.h,v 1.7 2016/07/01 16:42:46 christos Exp $ */
1+
/* $NetBSD: md2.h,v 1.8 2023/08/01 07:04:15 mrg Exp $ */
22

33
#ifndef _MD2_H_
44
#define _MD2_H_
@@ -21,10 +21,10 @@ __BEGIN_DECLS
2121
void MD2Init(MD2_CTX *);
2222
void MD2Update(MD2_CTX *, const unsigned char *, unsigned int);
2323
void MD2Final(unsigned char[16], MD2_CTX *);
24-
char *MD2End(MD2_CTX *, char *);
24+
char *MD2End(MD2_CTX *, char[MD2_DIGEST_STRING_LENGTH]);
2525
char *MD2File(const char *, char *);
2626
char *MD2FileChunk(const char *, char *, off_t, off_t);
27-
char *MD2Data(const unsigned char *, size_t, char *);
27+
char *MD2Data(const unsigned char *, size_t, char[MD2_DIGEST_STRING_LENGTH]);
2828
__END_DECLS
2929

3030
#endif /* _MD2_H_ */

0 commit comments

Comments
 (0)