CVS commit: src/sys/uvm
Module Name:src Committed By: mrg Date: Sun Jun 20 07:11:39 UTC 2021 Modified Files: src/sys/uvm: uvm_map.c Log Message: remove diag-only printf() that fires when an unlinked file is mmapped and someone runs ps(1) or similar. To generate a diff of this commit: cvs rdiff -u -r1.388 -r1.389 src/sys/uvm/uvm_map.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_map.c diff -u src/sys/uvm/uvm_map.c:1.388 src/sys/uvm/uvm_map.c:1.389 --- src/sys/uvm/uvm_map.c:1.388 Sat Apr 17 21:37:21 2021 +++ src/sys/uvm/uvm_map.c Sun Jun 20 07:11:38 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_map.c,v 1.388 2021/04/17 21:37:21 mrg Exp $ */ +/* $NetBSD: uvm_map.c,v 1.389 2021/06/20 07:11:38 mrg Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.388 2021/04/17 21:37:21 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.389 2021/06/20 07:11:38 mrg Exp $"); #include "opt_ddb.h" #include "opt_pax.h" @@ -5164,11 +5164,6 @@ fill_vmentry(struct lwp *l, struct proc kve->kve_vn_fsid = va.va_fsid; error = vnode_to_path(kve->kve_path, sizeof(kve->kve_path) / 2, vp, l, p); -#ifdef DIAGNOSTIC -if (error) - printf("%s: vp %p error %d\n", __func__, - vp, error); -#endif } } else if (UVM_OBJ_IS_KERN_OBJECT(uobj)) { kve->kve_type = KVME_TYPE_KERN;
CVS commit: src/crypto/external/bsd/heimdal/lib/libhx509
Module Name:src Committed By: christos Date: Sun Jun 20 10:38:54 UTC 2021 Modified Files: src/crypto/external/bsd/heimdal/lib/libhx509: Makefile Log Message: hide yyerrflag, yyval; centralize lex and yacc settings To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/crypto/external/bsd/heimdal/lib/libhx509/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/heimdal/lib/libhx509/Makefile diff -u src/crypto/external/bsd/heimdal/lib/libhx509/Makefile:1.6 src/crypto/external/bsd/heimdal/lib/libhx509/Makefile:1.7 --- src/crypto/external/bsd/heimdal/lib/libhx509/Makefile:1.6 Sat Feb 3 22:19:51 2018 +++ src/crypto/external/bsd/heimdal/lib/libhx509/Makefile Sun Jun 20 06:38:54 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.6 2018/02/04 03:19:51 christos Exp $ +# $NetBSD: Makefile,v 1.7 2021/06/20 10:38:54 christos Exp $ NOLINT= # defined @@ -19,6 +19,8 @@ LIBDPLIBS+= asn1 ${HEIMBASE}/lib/libasn1 wind ${HEIMBASE}/lib/libwind YHEADER=1 +YPREFIX= _hx509_sel_yy +LPREFIX= _hx509_sel_yy INCSDIR= /usr/include/krb5 INCS+= hx509.h hx509-protos.h ${ASN1_INCS} ${COMPILE_ET_INCS} @@ -56,7 +58,6 @@ SRCS=\ softp11.c \ ${BUILT_SOURCES} -LPREFIX= _hx509_sel_yy CPPFLAGS+=\ -I${HEIMDIST}/lib/hx509/ref \
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 11:00:18 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: decl.c Log Message: lint: fix segmentation fault for malformed struct Code to trigger this bug: struct{char a(_)0} Found using afl. To generate a diff of this commit: cvs rdiff -u -r1.186 -r1.187 src/usr.bin/xlint/lint1/decl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.186 src/usr.bin/xlint/lint1/decl.c:1.187 --- src/usr.bin/xlint/lint1/decl.c:1.186 Sat Jun 19 15:51:11 2021 +++ src/usr.bin/xlint/lint1/decl.c Sun Jun 20 11:00:18 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.186 2021/06/19 15:51:11 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.187 2021/06/20 11:00:18 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.186 2021/06/19 15:51:11 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.187 2021/06/20 11:00:18 rillig Exp $"); #endif #include @@ -198,6 +198,7 @@ setcomplete(type_t *tp, bool complete) { tspec_t t; + lint_assert(tp != NULL); if ((t = tp->t_tspec) == ARRAY) { tp->t_incomplete_array = !complete; } else if (t == STRUCT || t == UNION) {
CVS commit: src
Module Name:src Committed By: rillig Date: Sun Jun 20 11:24:32 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: decl_struct_member.c decl_struct_member.exp src/usr.bin/xlint/lint1: decl.c Log Message: lint: fix assertion failure on malformed struct declaration Found using afl. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/decl_struct_member.c \ src/tests/usr.bin/xlint/lint1/decl_struct_member.exp cvs rdiff -u -r1.187 -r1.188 src/usr.bin/xlint/lint1/decl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/decl_struct_member.c diff -u src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.1 src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.2 --- src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.1 Sat Jun 19 19:49:15 2021 +++ src/tests/usr.bin/xlint/lint1/decl_struct_member.c Sun Jun 20 11:24:32 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl_struct_member.c,v 1.1 2021/06/19 19:49:15 rillig Exp $ */ +/* $NetBSD: decl_struct_member.c,v 1.2 2021/06/20 11:24:32 rillig Exp $ */ # 3 "decl_struct_member.c" /* @@ -10,3 +10,16 @@ struct { char; /* expect: syntax error 'unnamed member' */ }; + +/* + * Before decl.c 1.188 from 2021-06-20, lint ran into a segmentation fault. + */ +struct { + char a(_)0 /* expect: syntax error '0' */ +}/* expect: ';' after last */ +/* + * FIXME: adding a semicolon here triggers another assertion: + * + * assertion "t == NOTSPEC" failed in deftyp at decl.c:774 + */ +/* expect+1: cannot recover from previous errors */ Index: src/tests/usr.bin/xlint/lint1/decl_struct_member.exp diff -u src/tests/usr.bin/xlint/lint1/decl_struct_member.exp:1.1 src/tests/usr.bin/xlint/lint1/decl_struct_member.exp:1.2 --- src/tests/usr.bin/xlint/lint1/decl_struct_member.exp:1.1 Sat Jun 19 19:49:15 2021 +++ src/tests/usr.bin/xlint/lint1/decl_struct_member.exp Sun Jun 20 11:24:32 2021 @@ -1 +1,4 @@ decl_struct_member.c(11): error: syntax error 'unnamed member' [249] +decl_struct_member.c(18): error: syntax error '0' [249] +decl_struct_member.c(19): warning: syntax requires ';' after last struct/union member [66] +decl_struct_member.c(26): error: cannot recover from previous errors [224] Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.187 src/usr.bin/xlint/lint1/decl.c:1.188 --- src/usr.bin/xlint/lint1/decl.c:1.187 Sun Jun 20 11:00:18 2021 +++ src/usr.bin/xlint/lint1/decl.c Sun Jun 20 11:24:32 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.187 2021/06/20 11:00:18 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.188 2021/06/20 11:24:32 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.187 2021/06/20 11:00:18 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.188 2021/06/20 11:24:32 rillig Exp $"); #endif #include @@ -1806,6 +1806,9 @@ complete_tag_struct_or_union(type_t *tp, int n; sym_t *mem; + if (tp == NULL) /* in case of syntax errors */ + return gettyp(INT); + setcomplete(tp, true); t = tp->t_tspec;
CVS commit: src
Module Name:src Committed By: rillig Date: Sun Jun 20 11:42:26 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: d_gcc_compound_statements1.c d_gcc_compound_statements1.exp src/usr.bin/xlint/lint1: cgram.y Log Message: lint: fix crash on semantically wrong code in ({...}) Found by afl. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c cvs rdiff -u -r1.1 -r1.2 \ src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.exp cvs rdiff -u -r1.228 -r1.229 src/usr.bin/xlint/lint1/cgram.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c diff -u src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c:1.5 src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c:1.6 --- src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c:1.5 Sat Jun 19 15:51:11 2021 +++ src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c Sun Jun 20 11:42:26 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: d_gcc_compound_statements1.c,v 1.5 2021/06/19 15:51:11 rillig Exp $ */ +/* $NetBSD: d_gcc_compound_statements1.c,v 1.6 2021/06/20 11:42:26 rillig Exp $ */ # 3 "d_gcc_compound_statements1.c" /* GCC compound statement with expression */ @@ -22,3 +22,15 @@ foo(unsigned long z) int c = ({ return 3; /* expect: return outside function */ }); /* expect: cannot initialize 'int' from 'void' */ + +void +function(void) +{ + /* + * Before cgram.y 1.229 from 2021-06-20, lint crashed due to the + * syntax error, which made an expression NULL. + */ + ({ + 0->e; /* expect: type 'int' does not have member 'e' */ + }); +} Index: src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.exp diff -u src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.exp:1.1 src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.exp:1.2 --- src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.exp:1.1 Sat Jun 19 15:51:11 2021 +++ src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.exp Sun Jun 20 11:42:26 2021 @@ -1,2 +1,3 @@ d_gcc_compound_statements1.c(23): error: syntax error 'return outside function' [249] d_gcc_compound_statements1.c(24): error: cannot initialize 'int' from 'void' [185] +d_gcc_compound_statements1.c(34): error: type 'int' does not have member 'e' [101] Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.228 src/usr.bin/xlint/lint1/cgram.y:1.229 --- src/usr.bin/xlint/lint1/cgram.y:1.228 Sat Jun 19 19:49:15 2021 +++ src/usr.bin/xlint/lint1/cgram.y Sun Jun 20 11:42:25 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.228 2021/06/19 19:49:15 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.229 2021/06/20 11:42:25 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.228 2021/06/19 19:49:15 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.229 2021/06/20 11:42:25 rillig Exp $"); #endif #include @@ -2028,12 +2028,17 @@ gcc_statement_expr_item: $$->tn_type = gettyp(VOID); } | expr T_SEMI { - /* XXX: We should really do that only on the last name */ - if ($1->tn_op == NAME) - $1->tn_sym->s_used = true; - $$ = $1; - expr($1, false, false, false, false); - seen_fallthrough = false; + if ($1 == NULL) { /* in case of syntax errors */ + $$ = expr_zalloc_tnode(); + $$->tn_type = gettyp(VOID); + } else { + /* XXX: do that only on the last name */ + if ($1->tn_op == NAME) +$1->tn_sym->s_used = true; + $$ = $1; + expr($1, false, false, false, false); + seen_fallthrough = false; + } } ;
CVS commit: src/crypto/external/bsd/heimdal/dist/lib/hx509
Module Name:src Committed By: christos Date: Sun Jun 20 12:01:07 UTC 2021 Modified Files: src/crypto/external/bsd/heimdal/dist/lib/hx509: sel-gram.y sel-lex.l sel.c sel.h Removed Files: src/crypto/external/bsd/heimdal/dist/lib/hx509: sel-gram.c sel-gram.h sel-lex.c Log Message: remove generated files, custom #define prefixes to hide lex/yacc symbols and yywrap. To generate a diff of this commit: cvs rdiff -u -r1.2 -r0 \ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.c \ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.h \ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.c cvs rdiff -u -r1.3 -r1.4 \ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y \ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y diff -u src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y:1.3 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y:1.4 --- src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y:1.3 Sun Dec 15 17:50:50 2019 +++ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y Sun Jun 20 08:01:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sel-gram.y,v 1.3 2019/12/15 22:50:50 christos Exp $ */ +/* $NetBSD: sel-gram.y,v 1.4 2021/06/20 12:01:07 christos Exp $ */ /* * Copyright (c) 2017 Kungliga Tekniska Högskolan @@ -41,19 +41,6 @@ #include #include -#if !defined(yylex) -#define yylex _hx509_sel_yylex -#define yywrap _hx509_sel_yywrap -#endif -#if !defined(yyparse) -#define yyparse _hx509_sel_yyparse -#define yyerror _hx509_sel_yyerror -#define yylval _hx509_sel_yylval -#define yychar _hx509_sel_yychar -#define yydebug _hx509_sel_yydebug -#define yynerrs _hx509_sel_yynerrs -#endif - %} %union { Index: src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l diff -u src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l:1.3 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l:1.4 --- src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l:1.3 Sun Dec 15 17:50:50 2019 +++ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l Sun Jun 20 08:01:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sel-lex.l,v 1.3 2019/12/15 22:50:50 christos Exp $ */ +/* $NetBSD: sel-lex.l,v 1.4 2021/06/20 12:01:07 christos Exp $ */ %{ /* @@ -72,6 +72,8 @@ struct hx_expr_input _hx509_expr_input; #undef ECHO %} + +%option noyywrap %% TRUE { return kw_TRUE; } @@ -82,12 +84,12 @@ IN { return kw_IN; } TAILMATCH { return kw_TAILMATCH; } [A-Za-z][-A-Za-z0-9_]* { - yylval.string = strdup ((const char *)yytext); + _hx509_sel_yylval.string = strdup ((const char *)_hx509_sel_yytext); return IDENTIFIER; } -"\"" { yylval.string = handle_string(); return STRING; } +"\"" { _hx509_sel_yylval.string = handle_string(); return STRING; } \n { ++lineno; } -[,.!={}()%] { return *yytext; } +[,.!={}()%] { return *_hx509_sel_yytext; } [ \t] ; %% @@ -122,16 +124,6 @@ handle_string(void) return strdup(x); } -#if !defined(yywrap) -#define yywrap _hx509_sel_yywrap -#endif - -int -yywrap () -{ - return 1; -} - static int lex_input(char *buf, int max_size) { Index: src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c diff -u src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c:1.2 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c:1.3 --- src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c:1.2 Sat Jan 28 16:31:48 2017 +++ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c Sun Jun 20 08:01:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sel.c,v 1.2 2017/01/28 21:31:48 christos Exp $ */ +/* $NetBSD: sel.c,v 1.3 2021/06/20 12:01:07 christos Exp $ */ /* * Copyright (c) 2008 Kungliga Tekniska Högskolan @@ -219,7 +219,7 @@ _hx509_expr_parse(const char *buf) _hx509_expr_input.error = NULL; } -yyparse(); +_hx509_sel_yyparse(); return _hx509_expr_input.expr; } Index: src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h diff -u src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h:1.5 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h:1.6 --- src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h:1.5 Sun Dec 15 17:50:50 2019 +++ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h Sun Jun 20 08:01:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sel.h,v 1.5 2019/12/15 22:50:50 christos Exp $ */ +/* $NetBSD: sel.h,v 1.6 2021/06/20 12:01:07 christos Exp $ */ /* * Copyright (c) 2008 Kungliga Tekniska Högskolan @@ -69,20 +69,6 @@ struct hx_expr_input { extern struct hx_expr_input _hx509_expr_input; -#if !defined(yylex) -#define yylex _hx509_sel_yylex -#define yywrap _hx509_sel_yywrap -#endif -#if !defined(yyparse) -
CVS commit: src/external/gpl3/gdb/bin/gdbserver
Module Name:src Committed By: riastradh Date: Sun Jun 20 12:29:58 UTC 2021 Modified Files: src/external/gpl3/gdb/bin/gdbserver: Makefile Log Message: gdbserver(1): Work around clang build failure. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/bin/gdbserver/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gdb/bin/gdbserver/Makefile diff -u src/external/gpl3/gdb/bin/gdbserver/Makefile:1.3 src/external/gpl3/gdb/bin/gdbserver/Makefile:1.4 --- src/external/gpl3/gdb/bin/gdbserver/Makefile:1.3 Thu Sep 24 14:53:35 2020 +++ src/external/gpl3/gdb/bin/gdbserver/Makefile Sun Jun 20 12:29:58 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2020/09/24 14:53:35 christos Exp $ +# $NetBSD: Makefile,v 1.4 2021/06/20 12:29:58 riastradh Exp $ NOCTF= NOMAN= @@ -30,6 +30,9 @@ CPPFLAGS+= -I${.CURDIR} \ -I${DIST}/include \ ${GCPPFLAGS:M-D*} +# /usr/src/current/external/gpl3/gdb/bin/gdbserver/../../dist/gdb/nat/fork-inferior.c:497:15: error: 6 enumeration values not handled in switch: 'TARGET_WAITKIND_VFORK_DONE', 'TARGET_WAITKIND_IGNORE', 'TARGET_WAITKIND_NO_HISTORY'... [-Werror,-Wswitch] +CXXFLAGS+= ${${ACTIVE_CC} == "clang":? -Wno-error=switch : } + .include "../../Makefile.inc" .include
CVS commit: src
Module Name:src Committed By: rillig Date: Sun Jun 20 18:09:48 UTC 2021 Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/xlint/lint1: Makefile t_integration.sh Added Files: src/tests/usr.bin/xlint/lint1: c99_init_designator.c c99_init_designator.exp Log Message: tests/lint: test syntax error in initialization using designator This test prepares the upcoming refactoring of the grammar. To generate a diff of this commit: cvs rdiff -u -r1.1062 -r1.1063 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.64 -r1.65 src/tests/usr.bin/xlint/lint1/Makefile cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/c99_init_designator.c \ src/tests/usr.bin/xlint/lint1/c99_init_designator.exp cvs rdiff -u -r1.56 -r1.57 src/tests/usr.bin/xlint/lint1/t_integration.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.1062 src/distrib/sets/lists/tests/mi:1.1063 --- src/distrib/sets/lists/tests/mi:1.1062 Sat Jun 19 20:25:57 2021 +++ src/distrib/sets/lists/tests/mi Sun Jun 20 18:09:48 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1062 2021/06/19 20:25:57 rillig Exp $ +# $NetBSD: mi,v 1.1063 2021/06/20 18:09:48 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -6105,6 +6105,8 @@ ./usr/tests/usr.bin/xlint/lint1tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/Atffiletests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua +./usr/tests/usr.bin/xlint/lint1/c99_init_designator.c tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint1/c99_init_designator.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/d_alignof.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/d_bltinoffsetof.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c tests-usr.bin-tests compattestfile,atf Index: src/tests/usr.bin/xlint/lint1/Makefile diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.64 src/tests/usr.bin/xlint/lint1/Makefile:1.65 --- src/tests/usr.bin/xlint/lint1/Makefile:1.64 Sat Jun 19 20:25:58 2021 +++ src/tests/usr.bin/xlint/lint1/Makefile Sun Jun 20 18:09:48 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.64 2021/06/19 20:25:58 rillig Exp $ +# $NetBSD: Makefile,v 1.65 2021/06/20 18:09:48 rillig Exp $ NOMAN= # defined MAX_MESSAGE= 344 # see lint1/err.c @@ -10,6 +10,8 @@ TESTSDIR= ${TESTSBASE}/usr.bin/xlint/lin TESTS_SH= t_integration FILESDIR= ${TESTSDIR} +FILES+= c99_init_designator.c +FILES+= c99_init_designator.exp FILES+= d_alignof.c FILES+= d_bltinoffsetof.c FILES+= d_c99_bool.c Index: src/tests/usr.bin/xlint/lint1/t_integration.sh diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.56 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.57 --- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.56 Sat Jun 19 20:25:58 2021 +++ src/tests/usr.bin/xlint/lint1/t_integration.sh Sun Jun 20 18:09:48 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_integration.sh,v 1.56 2021/06/19 20:25:58 rillig Exp $ +# $NetBSD: t_integration.sh,v 1.57 2021/06/20 18:09:48 rillig Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -99,6 +99,7 @@ test_case() test_case all_messages +test_case c99_init_designator test_case d_alignof test_case d_bltinoffsetof test_case d_c99_anon_struct Added files: Index: src/tests/usr.bin/xlint/lint1/c99_init_designator.c diff -u /dev/null src/tests/usr.bin/xlint/lint1/c99_init_designator.c:1.1 --- /dev/null Sun Jun 20 18:09:48 2021 +++ src/tests/usr.bin/xlint/lint1/c99_init_designator.c Sun Jun 20 18:09:48 2021 @@ -0,0 +1,28 @@ +/* $NetBSD: c99_init_designator.c,v 1.1 2021/06/20 18:09:48 rillig Exp $ */ +# 3 "c99_init_designator.c" + +/* + * Test initialization of structs or unions using designators. + * + * See init.c, 'struct designator' and 'struct designation'. + * + * C99 6.7.8p6, 6.7.8p7 + */ + +struct point { + int x; + int y; +}; + +/* + * Before cgram.y 1.230 from 2021-06-20, the grammar allowed either of the + * operators '.' or '->' to be used for the designators and had extra code + * to ensure that only '.' was actually used. + */ +struct point origin = { +.x = 0, +->y = 0, /* expect: syntax error '->' */ +}; + +/* Ensure that the parser can recover from the parse error. */ +struct point pythagoras = { 3, 4 }; Index: src/tests/usr.bin/xlint/lint1/c99_init_designator.exp diff -u /dev/null src/tests/usr.bin/xlint/lint1/c99_init_designator.exp:1.1 --- /dev/null Sun Jun 20 18:09:48 2021 +++ src/tests/usr.bin/xlint/lint1/c99_init_designator.exp Sun Jun 20 18:09:48 2021 @@ -0,0 +1 @@ +c99_init_designator.c(24): error: syntax error '->' [249]
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 18:11:21 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: d_init_pop_member.c Log Message: tests/lint: document disappearance of bug in pop_member To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/d_init_pop_member.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/d_init_pop_member.c diff -u src/tests/usr.bin/xlint/lint1/d_init_pop_member.c:1.7 src/tests/usr.bin/xlint/lint1/d_init_pop_member.c:1.8 --- src/tests/usr.bin/xlint/lint1/d_init_pop_member.c:1.7 Tue Mar 30 14:25:28 2021 +++ src/tests/usr.bin/xlint/lint1/d_init_pop_member.c Sun Jun 20 18:11:21 2021 @@ -1,8 +1,8 @@ -/* $NetBSD: d_init_pop_member.c,v 1.7 2021/03/30 14:25:28 rillig Exp $ */ +/* $NetBSD: d_init_pop_member.c,v 1.8 2021/06/20 18:11:21 rillig Exp $ */ # 3 "d_init_pop_member.c" /* - * Since init.c 1.27 from 2015-07-28, + * Since init.c 1.27 from 2015-07-28 and before init.c 1.178 from 2021-03-29, * a bug in memberpop or pop_member led to a wrong error message * "undefined struct/union member: capital [101]" in the second and third * named initializer.
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 18:15:12 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: cgram.y scan.l Log Message: lint: use different tokens for operators '.' and '->' Before C99, these tokens were only used in member access expressions. C99 reused the operator '.' in initializations of structs and unions. Let the grammar check for syntax errors instead of writing custom code. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.229 -r1.230 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.133 -r1.134 src/usr.bin/xlint/lint1/scan.l Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.229 src/usr.bin/xlint/lint1/cgram.y:1.230 --- src/usr.bin/xlint/lint1/cgram.y:1.229 Sun Jun 20 11:42:25 2021 +++ src/usr.bin/xlint/lint1/cgram.y Sun Jun 20 18:15:12 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.229 2021/06/20 11:42:25 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.230 2021/06/20 18:15:12 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.229 2021/06/20 11:42:25 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.230 2021/06/20 18:15:12 rillig Exp $"); #endif #include @@ -123,7 +123,7 @@ anonymize(sym_t *s) } %} -%expect 181 +%expect 182 %union { val_t *y_val; @@ -142,7 +142,7 @@ anonymize(sym_t *s) }; %token T_LBRACE T_RBRACE T_LBRACK T_RBRACK T_LPAREN T_RPAREN -%token T_MEMBACC +%token T_POINT T_ARROW %token T_UNARY %token T_INCDEC %token T_SIZEOF @@ -269,7 +269,7 @@ anonymize(sym_t *s) %left T_ADDITIVE %left T_ASTERISK T_MULTIPLICATIVE %right T_UNARY T_INCDEC T_SIZEOF T_REAL T_IMAG -%left T_LPAREN T_LBRACK T_MEMBACC +%left T_LPAREN T_LBRACK T_POINT T_ARROW %token T_NAME %token T_TYPENAME @@ -1420,7 +1420,7 @@ designator: /* C99 6.7.8 "Initializati /* array initializer with des.s is a C9X feature */ warning(321); } - | point identifier { + | T_POINT identifier { if (!Sflag) /* struct or union member name in initializer is ... */ warning(313); @@ -2074,18 +2074,13 @@ func_arg_list: ; point_or_arrow: - T_MEMBACC { + T_POINT { symtyp = FMEMBER; - $$ = $1; + $$ = POINT; } - ; - -point: - T_MEMBACC { - if ($1 != POINT) { - /* syntax error '%s' */ - error(249, yytext); - } + | T_ARROW { + symtyp = FMEMBER; + $$ = ARROW; } ; Index: src/usr.bin/xlint/lint1/scan.l diff -u src/usr.bin/xlint/lint1/scan.l:1.133 src/usr.bin/xlint/lint1/scan.l:1.134 --- src/usr.bin/xlint/lint1/scan.l:1.133 Sun Mar 21 08:55:59 2021 +++ src/usr.bin/xlint/lint1/scan.l Sun Jun 20 18:15:12 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: scan.l,v 1.133 2021/03/21 08:55:59 rillig Exp $ */ +/* $NetBSD: scan.l,v 1.134 2021/06/20 18:15:12 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: scan.l,v 1.133 2021/03/21 08:55:59 rillig Exp $"); +__RCSID("$NetBSD: scan.l,v 1.134 2021/06/20 18:15:12 rillig Exp $"); #endif #include "lint1.h" @@ -94,8 +94,8 @@ TL ([fFlL]?[i]?) ">>"return lex_operator(T_SHIFT, SHR); "++"return lex_operator(T_INCDEC, INC); "--"return lex_operator(T_INCDEC, DEC); -"->"return lex_operator(T_MEMBACC, ARROW); -"."return lex_operator(T_MEMBACC, POINT); +"->"return T_ARROW; +"."return T_POINT; "+"return lex_operator(T_ADDITIVE, PLUS); "-"return lex_operator(T_ADDITIVE, MINUS); "*"return T_ASTERISK;
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 18:23:07 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: lex_char.c lex_char.exp Log Message: tests/lint: remove outdated comment about '\0' That comment was only needed for lex.c 1.38 from 2021-06-18, which was fixed with lex.c 1.39 from 2021-06-19, just a day later. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/lex_char.c \ src/tests/usr.bin/xlint/lint1/lex_char.exp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/lex_char.c diff -u src/tests/usr.bin/xlint/lint1/lex_char.c:1.1 src/tests/usr.bin/xlint/lint1/lex_char.c:1.2 --- src/tests/usr.bin/xlint/lint1/lex_char.c:1.1 Sat Jun 19 08:30:08 2021 +++ src/tests/usr.bin/xlint/lint1/lex_char.c Sun Jun 20 18:23:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex_char.c,v 1.1 2021/06/19 08:30:08 rillig Exp $ */ +/* $NetBSD: lex_char.c,v 1.2 2021/06/20 18:23:07 rillig Exp $ */ # 3 "lex_char.c" /* @@ -23,7 +23,6 @@ test(void) /* expect+2: multi-character character constant */ /* expect+1: conversion of 'int' to 'char' is out of range */ sink('ä'); - /* rescue the parser: ' */ /* GCC extension */ /* expect+1: dubious escape \e */ Index: src/tests/usr.bin/xlint/lint1/lex_char.exp diff -u src/tests/usr.bin/xlint/lint1/lex_char.exp:1.1 src/tests/usr.bin/xlint/lint1/lex_char.exp:1.2 --- src/tests/usr.bin/xlint/lint1/lex_char.exp:1.1 Sat Jun 19 08:30:08 2021 +++ src/tests/usr.bin/xlint/lint1/lex_char.exp Sun Jun 20 18:23:07 2021 @@ -1,5 +1,5 @@ lex_char.c(16): error: empty character constant [73] lex_char.c(25): warning: multi-character character constant [294] lex_char.c(25): warning: conversion of 'int' to 'char' is out of range, arg #1 [295] -lex_char.c(30): warning: dubious escape \e [79] -lex_char.c(42): error: empty character constant [73] +lex_char.c(29): warning: dubious escape \e [79] +lex_char.c(41): error: empty character constant [73]
CVS commit: src
Module Name:src Committed By: rillig Date: Sun Jun 20 18:38:12 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: lex_wide_char.c lex_wide_char.exp src/usr.bin/xlint/lint1: lex.c Log Message: lint: fix check for empty wide character constant This bug got almost 26 years old, it was already there at the initial commit in 1995. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/lex_wide_char.c \ src/tests/usr.bin/xlint/lint1/lex_wide_char.exp cvs rdiff -u -r1.41 -r1.42 src/usr.bin/xlint/lint1/lex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/lex_wide_char.c diff -u src/tests/usr.bin/xlint/lint1/lex_wide_char.c:1.1 src/tests/usr.bin/xlint/lint1/lex_wide_char.c:1.2 --- src/tests/usr.bin/xlint/lint1/lex_wide_char.c:1.1 Sat Jun 19 08:30:08 2021 +++ src/tests/usr.bin/xlint/lint1/lex_wide_char.c Sun Jun 20 18:38:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex_wide_char.c,v 1.1 2021/06/19 08:30:08 rillig Exp $ */ +/* $NetBSD: lex_wide_char.c,v 1.2 2021/06/20 18:38:12 rillig Exp $ */ # 3 "lex_wide_char.c" /* @@ -12,7 +12,7 @@ void sink(int); void test(void) { - /* TODO: expect+1: empty character constant */ + /* expect+1: empty character constant */ sink(L''); sink(L'a'); @@ -22,7 +22,6 @@ test(void) /* UTF-8 */ /* expect+1: too many characters in character constant */ sink(L'ä'); - /* rescue the parser: ' */ /* GCC extension */ /* expect+1: dubious escape \e */ @@ -37,6 +36,6 @@ test(void) /* newline */ sink(L'\n'); - /* TODO: expect+1: empty character constant */ + /* expect+1: empty character constant */ sink(L''); } Index: src/tests/usr.bin/xlint/lint1/lex_wide_char.exp diff -u src/tests/usr.bin/xlint/lint1/lex_wide_char.exp:1.1 src/tests/usr.bin/xlint/lint1/lex_wide_char.exp:1.2 --- src/tests/usr.bin/xlint/lint1/lex_wide_char.exp:1.1 Sat Jun 19 08:30:08 2021 +++ src/tests/usr.bin/xlint/lint1/lex_wide_char.exp Sun Jun 20 18:38:12 2021 @@ -1,2 +1,4 @@ +lex_wide_char.c(16): error: empty character constant [73] lex_wide_char.c(24): error: too many characters in character constant [71] -lex_wide_char.c(29): warning: dubious escape \e [79] +lex_wide_char.c(28): warning: dubious escape \e [79] +lex_wide_char.c(40): error: empty character constant [73] Index: src/usr.bin/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.41 src/usr.bin/xlint/lint1/lex.c:1.42 --- src/usr.bin/xlint/lint1/lex.c:1.41 Sat Jun 19 20:25:58 2021 +++ src/usr.bin/xlint/lint1/lex.c Sun Jun 20 18:38:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.41 2021/06/19 20:25:58 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.42 2021/06/20 18:38:12 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: lex.c,v 1.41 2021/06/19 20:25:58 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.42 2021/06/20 18:38:12 rillig Exp $"); #endif #include @@ -881,7 +881,7 @@ lex_wide_character_constant(void) if (c == -2) { /* unterminated character constant */ error(253); - } else if (c == 0) { + } else if (i == 0) { /* empty character constant */ error(73); } else {
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 18:41:27 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: lex.c Log Message: lint: reduce indentation in lexer for character constants No functional change. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/usr.bin/xlint/lint1/lex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.42 src/usr.bin/xlint/lint1/lex.c:1.43 --- src/usr.bin/xlint/lint1/lex.c:1.42 Sun Jun 20 18:38:12 2021 +++ src/usr.bin/xlint/lint1/lex.c Sun Jun 20 18:41:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.42 2021/06/20 18:38:12 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.43 2021/06/20 18:41:27 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: lex.c,v 1.42 2021/06/20 18:38:12 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.43 2021/06/20 18:41:27 rillig Exp $"); #endif #include @@ -831,18 +831,17 @@ lex_character_constant(void) if (c == -2) { /* unterminated character constant */ error(253); - } else { + } else if (n > sizeof(int) || (n > 1 && (pflag || hflag))) { /* XXX: should rather be sizeof(TARG_INT) */ - if (n > sizeof(int) || (n > 1 && (pflag || hflag))) { - /* too many characters in character constant */ - error(71); - } else if (n > 1) { - /* multi-character character constant */ - warning(294); - } else if (n == 0) { - /* empty character constant */ - error(73); - } + + /* too many characters in character constant */ + error(71); + } else if (n > 1) { + /* multi-character character constant */ + warning(294); + } else if (n == 0) { + /* empty character constant */ + error(73); } if (n == 1) { cv = (char)val; @@ -884,18 +883,16 @@ lex_wide_character_constant(void) } else if (i == 0) { /* empty character constant */ error(73); + } else if (i > imax) { + i = imax; + /* too many characters in character constant */ + error(71); } else { - if (i > imax) { - i = imax; - /* too many characters in character constant */ - error(71); - } else { - buf[i] = '\0'; - (void)mbtowc(NULL, NULL, 0); - if (mbtowc(&wc, buf, imax) < 0) -/* invalid multibyte character */ -error(291); - } + buf[i] = '\0'; + (void)mbtowc(NULL, NULL, 0); + if (mbtowc(&wc, buf, imax) < 0) + /* invalid multibyte character */ + error(291); } yylval.y_val = xcalloc(1, sizeof(*yylval.y_val));
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 18:44:48 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: lex.c Log Message: lint: fix confusing variable name in lex_wide_character_constant By convention, i is an index, not a count. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/usr.bin/xlint/lint1/lex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.43 src/usr.bin/xlint/lint1/lex.c:1.44 --- src/usr.bin/xlint/lint1/lex.c:1.43 Sun Jun 20 18:41:27 2021 +++ src/usr.bin/xlint/lint1/lex.c Sun Jun 20 18:44:48 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.43 2021/06/20 18:41:27 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.44 2021/06/20 18:44:48 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: lex.c,v 1.43 2021/06/20 18:41:27 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.44 2021/06/20 18:44:48 rillig Exp $"); #endif #include @@ -862,17 +862,17 @@ int lex_wide_character_constant(void) { static char buf[MB_LEN_MAX + 1]; - size_t i, imax; + size_t n, nmax; int c; wchar_t wc; - imax = MB_CUR_MAX; + nmax = MB_CUR_MAX; - i = 0; + n = 0; while ((c = get_escaped_char('\'')) >= 0) { - if (i < imax) - buf[i] = (char)c; - i++; + if (n < nmax) + buf[n] = (char)c; + n++; } wc = 0; @@ -880,17 +880,17 @@ lex_wide_character_constant(void) if (c == -2) { /* unterminated character constant */ error(253); - } else if (i == 0) { + } else if (n == 0) { /* empty character constant */ error(73); - } else if (i > imax) { - i = imax; + } else if (n > nmax) { + n = nmax; /* too many characters in character constant */ error(71); } else { - buf[i] = '\0'; + buf[n] = '\0'; (void)mbtowc(NULL, NULL, 0); - if (mbtowc(&wc, buf, imax) < 0) + if (mbtowc(&wc, buf, nmax) < 0) /* invalid multibyte character */ error(291); }
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 18:51:50 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: mem1.c Log Message: lint: sprinkle const in memory management No functional change. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/usr.bin/xlint/lint1/mem1.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/mem1.c diff -u src/usr.bin/xlint/lint1/mem1.c:1.43 src/usr.bin/xlint/lint1/mem1.c:1.44 --- src/usr.bin/xlint/lint1/mem1.c:1.43 Fri Apr 2 12:16:50 2021 +++ src/usr.bin/xlint/lint1/mem1.c Sun Jun 20 18:51:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mem1.c,v 1.43 2021/04/02 12:16:50 rillig Exp $ */ +/* $NetBSD: mem1.c,v 1.44 2021/06/20 18:51:50 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: mem1.c,v 1.43 2021/04/02 12:16:50 rillig Exp $"); +__RCSID("$NetBSD: mem1.c,v 1.44 2021/06/20 18:51:50 rillig Exp $"); #endif #include @@ -49,10 +49,11 @@ __RCSID("$NetBSD: mem1.c,v 1.43 2021/04/ #include "lint1.h" /* - * Filenames allocated by record_filename are shared. + * Filenames allocated by record_filename are shared and have unlimited + * lifetime. */ struct filename { - char *fn_name; + const char *fn_name; size_t fn_len; int fn_id; struct filename *fn_next; @@ -74,10 +75,10 @@ search_filename(const char *s, size_t le } struct filename_replacement { - char *orig; + const char *orig; size_t orig_len; - char *repl; - struct filename_replacement *next; + const char *repl; + const struct filename_replacement *next; }; static struct filename_replacement *filename_replacements; @@ -132,6 +133,7 @@ record_filename(const char *s, size_t sl { const struct filename *existing_fn; struct filename *fn; + char *name; if (s == NULL) return NULL; @@ -139,11 +141,13 @@ record_filename(const char *s, size_t sl if ((existing_fn = search_filename(s, slen)) != NULL) return existing_fn->fn_name; - fn = xmalloc(sizeof(*fn)); /* Do not use strdup() because s is not NUL-terminated.*/ - fn->fn_name = xmalloc(slen + 1); - (void)memcpy(fn->fn_name, s, slen); - fn->fn_name[slen] = '\0'; + name = xmalloc(slen + 1); + (void)memcpy(name, s, slen); + name[slen] = '\0'; + + fn = xmalloc(sizeof(*fn)); + fn->fn_name = name; fn->fn_len = slen; fn->fn_id = next_filename_id(); fn->fn_next = filenames;
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 19:04:50 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: ckbool.c lex.c lint1.h print.c tree.c Log Message: lint: rename val_t.v_ansiu to v_unsigned When lint was written in 1995, traditional C was still nearby since C90 had been around for only 5 years. 26 years later, almost all code adheres to C90 or even C99 or C11, therefore "C90 or later" can safely be assumed as the default. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.bin/xlint/lint1/ckbool.c cvs rdiff -u -r1.44 -r1.45 src/usr.bin/xlint/lint1/lex.c cvs rdiff -u -r1.103 -r1.104 src/usr.bin/xlint/lint1/lint1.h cvs rdiff -u -r1.12 -r1.13 src/usr.bin/xlint/lint1/print.c cvs rdiff -u -r1.287 -r1.288 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/ckbool.c diff -u src/usr.bin/xlint/lint1/ckbool.c:1.1 src/usr.bin/xlint/lint1/ckbool.c:1.2 --- src/usr.bin/xlint/lint1/ckbool.c:1.1 Tue Apr 6 13:17:04 2021 +++ src/usr.bin/xlint/lint1/ckbool.c Sun Jun 20 19:04:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ckbool.c,v 1.1 2021/04/06 13:17:04 rillig Exp $ */ +/* $NetBSD: ckbool.c,v 1.2 2021/06/20 19:04:50 rillig Exp $ */ /*- * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: ckbool.c,v 1.1 2021/04/06 13:17:04 rillig Exp $"); +__RCSID("$NetBSD: ckbool.c,v 1.2 2021/06/20 19:04:50 rillig Exp $"); #endif #include @@ -252,7 +252,7 @@ fallback_symbol_strict_bool(sym_t *sym) sym->s_scl = CTCONST; /* close enough */ sym->s_type = gettyp(BOOL); sym->s_value.v_tspec = BOOL; - sym->s_value.v_ansiu = false; + sym->s_value.v_unsigned = false; sym->s_value.v_quad = 0; return true; } @@ -261,7 +261,7 @@ fallback_symbol_strict_bool(sym_t *sym) sym->s_scl = CTCONST; /* close enough */ sym->s_type = gettyp(BOOL); sym->s_value.v_tspec = BOOL; - sym->s_value.v_ansiu = false; + sym->s_value.v_unsigned = false; sym->s_value.v_quad = 1; return true; } Index: src/usr.bin/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.44 src/usr.bin/xlint/lint1/lex.c:1.45 --- src/usr.bin/xlint/lint1/lex.c:1.44 Sun Jun 20 18:44:48 2021 +++ src/usr.bin/xlint/lint1/lex.c Sun Jun 20 19:04:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.44 2021/06/20 18:44:48 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.45 2021/06/20 19:04:50 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: lex.c,v 1.44 2021/06/20 18:44:48 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.45 2021/06/20 19:04:50 rillig Exp $"); #endif #include @@ -672,7 +672,7 @@ lex_integer_constant(const char *yytext, yylval.y_val = xcalloc(1, sizeof(*yylval.y_val)); yylval.y_val->v_tspec = typ; - yylval.y_val->v_ansiu = ansiu; + yylval.y_val->v_unsigned = ansiu; yylval.y_val->v_quad = (int64_t)uq; return T_CON; Index: src/usr.bin/xlint/lint1/lint1.h diff -u src/usr.bin/xlint/lint1/lint1.h:1.103 src/usr.bin/xlint/lint1/lint1.h:1.104 --- src/usr.bin/xlint/lint1/lint1.h:1.103 Sat Jun 19 15:23:57 2021 +++ src/usr.bin/xlint/lint1/lint1.h Sun Jun 20 19:04:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lint1.h,v 1.103 2021/06/19 15:23:57 rillig Exp $ */ +/* $NetBSD: lint1.h,v 1.104 2021/06/20 19:04:50 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -104,13 +104,11 @@ typedef enum { CONST, VOLATILE, RESTRICT, THREAD } tqual_t; -/* - * Integer and floating point values are stored in this structure - */ +/* An integer or floating-point value. */ typedef struct { tspec_t v_tspec; - bool v_ansiu; /* set if an integer constant is - unsigned in ANSI C */ + bool v_unsigned; /* set if an integer constant is + unsigned in C90 and later */ union { int64_t _v_quad; /* integers */ ldbl_t _v_ldbl; /* floats */ Index: src/usr.bin/xlint/lint1/print.c diff -u src/usr.bin/xlint/lint1/print.c:1.12 src/usr.bin/xlint/lint1/print.c:1.13 --- src/usr.bin/xlint/lint1/print.c:1.12 Sat Jun 19 14:08:45 2021 +++ src/usr.bin/xlint/lint1/print.c Sun Jun 20 19:04:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: print.c,v 1.12 2021/06/19 14:08:45 rillig Exp $ */ +/* $NetBSD: print.c,v 1.13 2021/06/20 19:04:50 rillig Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #ifndef lint -__RCSID("$NetBSD: print.c,v 1.12 2021/06/19 14:08:45 rillig Exp $"); +__RCSID("$NetBSD: print.c,v 1.13 2021/06/20 19:04:50 rillig Exp $"); #endif #include @@ -62,8 +62,9 @@ print_tnode(char *buf, size_t bufsiz, co (void)snprintf(buf, bufsiz, "%Lg", v->v_ldbl); break; default: - (void)snprintf(buf, bufsiz, v->v_ansiu ? "%llu" : - "%lld", (unsigned l
CVS commit: src/sys/stand/efiboot
Module Name:src Committed By: jmcneill Date: Sun Jun 20 19:07:39 UTC 2021 Modified Files: src/sys/stand/efiboot: exec.c Log Message: Enable the twiddle spinner when loading the kernel, ramdisk images, and modules. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/stand/efiboot/exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/stand/efiboot/exec.c diff -u src/sys/stand/efiboot/exec.c:1.21 src/sys/stand/efiboot/exec.c:1.22 --- src/sys/stand/efiboot/exec.c:1.21 Fri May 21 21:53:15 2021 +++ src/sys/stand/efiboot/exec.c Sun Jun 20 19:07:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.21 2021/05/21 21:53:15 jmcneill Exp $ */ +/* $NetBSD: exec.c,v 1.22 2021/06/20 19:07:39 jmcneill Exp $ */ /*- * Copyright (c) 2019 Jason R. Thorpe @@ -246,6 +246,8 @@ exec_netbsd(const char *fname, const cha EFI_STATUS status; int fd, ohowto; + twiddle_toggle = 0; + load_file(get_initrd_path(), 0, false, &initrd_addr, &initrd_size); load_file(get_dtb_path(), 0, false, &dtb_addr, &dtb_size); generate_efirng();
CVS commit: src/sys/stand/efiboot
Module Name:src Committed By: jmcneill Date: Sun Jun 20 19:10:47 UTC 2021 Modified Files: src/sys/stand/efiboot: Makefile.efiboot efiblock.c efiboot.h version Added Files: src/sys/stand/efiboot: efiwatchdog.c Log Message: Add support for the boot services watchdog and pet it on every block I/O access. For slow media (like ISO image redirection on Lenovo HR330A BMC) this is needed because otherwise the default watchdog timeout fires before we can finish loading the kernel from install media. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/stand/efiboot/Makefile.efiboot cvs rdiff -u -r1.11 -r1.12 src/sys/stand/efiboot/efiblock.c cvs rdiff -u -r1.14 -r1.15 src/sys/stand/efiboot/efiboot.h cvs rdiff -u -r0 -r1.1 src/sys/stand/efiboot/efiwatchdog.c cvs rdiff -u -r1.25 -r1.26 src/sys/stand/efiboot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/stand/efiboot/Makefile.efiboot diff -u src/sys/stand/efiboot/Makefile.efiboot:1.21 src/sys/stand/efiboot/Makefile.efiboot:1.22 --- src/sys/stand/efiboot/Makefile.efiboot:1.21 Thu May 27 06:54:45 2021 +++ src/sys/stand/efiboot/Makefile.efiboot Sun Jun 20 19:10:47 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.efiboot,v 1.21 2021/05/27 06:54:45 mrg Exp $ +# $NetBSD: Makefile.efiboot,v 1.22 2021/06/20 19:10:47 jmcneill Exp $ S= ${.CURDIR}/../../.. @@ -24,7 +24,8 @@ SOURCES= crt0-efi-${GNUEFIARCH}.S reloc_ SOURCES+= boot.c bootmenu.c conf.c console.c dev_net.c devopen.c exec.c \ module.c overlay.c panic.c prompt.c SOURCES+= efiboot.c efichar.c efidev.c efigetsecs.c efifdt.c \ - efifile.c efiblock.c efinet.c efipxe.c efiacpi.c efirng.c smbios.c + efifile.c efiblock.c efinet.c efipxe.c efiacpi.c efirng.c efiwatchdog.c \ + smbios.c .PATH: ${S}/external/bsd/libfdt/dist CPPFLAGS+= -I${S}/external/bsd/libfdt/dist Index: src/sys/stand/efiboot/efiblock.c diff -u src/sys/stand/efiboot/efiblock.c:1.11 src/sys/stand/efiboot/efiblock.c:1.12 --- src/sys/stand/efiboot/efiblock.c:1.11 Wed May 26 09:42:36 2021 +++ src/sys/stand/efiboot/efiblock.c Sun Jun 20 19:10:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: efiblock.c,v 1.11 2021/05/26 09:42:36 mrg Exp $ */ +/* $NetBSD: efiblock.c,v 1.12 2021/06/20 19:10:47 jmcneill Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -38,6 +38,9 @@ #include "efiboot.h" #include "efiblock.h" +#define EFI_BLOCK_TIMEOUT 120 +#define EFI_BLOCK_TIMEOUT_CODE 0x810c + /* * The raidframe support is basic. Ideally, it should be expanded to * consider raid volumes a first-class citizen like the x86 efiboot does, @@ -605,6 +608,8 @@ efi_block_strategy(void *devdata, int rw if (rw != F_READ) return EROFS; + efi_set_watchdog(EFI_BLOCK_TIMEOUT, EFI_BLOCK_TIMEOUT_CODE); + switch (bpart->type) { case EFI_BLOCK_PART_DISKLABEL: if (bpart->bdev->bio->Media->BlockSize != bpart->disklabel.secsize) { Index: src/sys/stand/efiboot/efiboot.h diff -u src/sys/stand/efiboot/efiboot.h:1.14 src/sys/stand/efiboot/efiboot.h:1.15 --- src/sys/stand/efiboot/efiboot.h:1.14 Sun Oct 11 14:03:33 2020 +++ src/sys/stand/efiboot/efiboot.h Sun Jun 20 19:10:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.h,v 1.14 2020/10/11 14:03:33 jmcneill Exp $ */ +/* $NetBSD: efiboot.h,v 1.15 2021/06/20 19:10:47 jmcneill Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -104,6 +104,9 @@ extern struct netif_driver efinetif; void efi_pxe_probe(void); bool efi_pxe_match_booted_interface(const EFI_MAC_ADDRESS *, UINT32); +/* efiwatchdog.c */ +void efi_set_watchdog(uint32_t, uint64_t); + /* exec.c */ int exec_netbsd(const char *, const char *); Index: src/sys/stand/efiboot/version diff -u src/sys/stand/efiboot/version:1.25 src/sys/stand/efiboot/version:1.26 --- src/sys/stand/efiboot/version:1.25 Thu May 27 06:54:45 2021 +++ src/sys/stand/efiboot/version Sun Jun 20 19:10:47 2021 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.25 2021/05/27 06:54:45 mrg Exp $ +$NetBSD: version,v 1.26 2021/06/20 19:10:47 jmcneill Exp $ NOTE ANY CHANGES YOU MAKE TO THE EFI BOOTLOADER HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -29,3 +29,4 @@ is taken as the current. 2.6: Disable ACPI support when booting big endian kernels. 2.7: Add basic support for booting from RAID1 volumes. 2.8: Add bi-endian disklabel and FFS support. +2.9: Watchdog support. Added files: Index: src/sys/stand/efiboot/efiwatchdog.c diff -u /dev/null src/sys/stand/efiboot/efiwatchdog.c:1.1 --- /dev/null Sun Jun 20 19:10:47 2021 +++ src/sys/stand/efiboot/efiwatchdog.c Sun Jun 20 19:10:47 2021 @@ -0,0 +1,40 @@ +/* $NetBSD: efiwatchdog.c,v 1.1 2021/06/20 19:10:47 jmcneill Exp $ */ + +/*- + * Copyright (c) 2021 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + *
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 19:15:58 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: ckbool.c Log Message: lint: in strict bool mode, treat boolean constants as unsigned In strict bool mode, bool is not an arithmetic type anyway, therefore it doesn't matter whether the type is signed or unsigned. C99 6.2.5p6 defines _Bool as one of the "standard unsigned integer types", so making the constants unsigned is more accurate. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.bin/xlint/lint1/ckbool.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/ckbool.c diff -u src/usr.bin/xlint/lint1/ckbool.c:1.2 src/usr.bin/xlint/lint1/ckbool.c:1.3 --- src/usr.bin/xlint/lint1/ckbool.c:1.2 Sun Jun 20 19:04:50 2021 +++ src/usr.bin/xlint/lint1/ckbool.c Sun Jun 20 19:15:58 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ckbool.c,v 1.2 2021/06/20 19:04:50 rillig Exp $ */ +/* $NetBSD: ckbool.c,v 1.3 2021/06/20 19:15:58 rillig Exp $ */ /*- * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: ckbool.c,v 1.2 2021/06/20 19:04:50 rillig Exp $"); +__RCSID("$NetBSD: ckbool.c,v 1.3 2021/06/20 19:15:58 rillig Exp $"); #endif #include @@ -252,7 +252,7 @@ fallback_symbol_strict_bool(sym_t *sym) sym->s_scl = CTCONST; /* close enough */ sym->s_type = gettyp(BOOL); sym->s_value.v_tspec = BOOL; - sym->s_value.v_unsigned = false; + sym->s_value.v_unsigned = true; sym->s_value.v_quad = 0; return true; } @@ -261,7 +261,7 @@ fallback_symbol_strict_bool(sym_t *sym) sym->s_scl = CTCONST; /* close enough */ sym->s_type = gettyp(BOOL); sym->s_value.v_tspec = BOOL; - sym->s_value.v_unsigned = false; + sym->s_value.v_unsigned = true; sym->s_value.v_quad = 1; return true; }
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 20:32:42 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: ckbool.c lex.c lint1.h print.c tree.c Log Message: lint: rename val_t.v_unsigned to avoid confusion The name v_unsigned suggested that the value would be interpreted as unsigned, which was wrong. Whether a value is signed or unsigned is decided by v_tspec instead. Revert the previous commit for boolen constants since their value is already interpreted as unsigned, and there is no need for any warning about differences between traditional C and ANSI C since the _Bool type has only been added ten years later in C99. The code for printing a tree node was also confused by this struct member, even with its old name v_ansiu. That code will be fixed in a follow-up commit. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.bin/xlint/lint1/ckbool.c cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/lint1/lex.c cvs rdiff -u -r1.104 -r1.105 src/usr.bin/xlint/lint1/lint1.h cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/lint1/print.c cvs rdiff -u -r1.288 -r1.289 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/ckbool.c diff -u src/usr.bin/xlint/lint1/ckbool.c:1.3 src/usr.bin/xlint/lint1/ckbool.c:1.4 --- src/usr.bin/xlint/lint1/ckbool.c:1.3 Sun Jun 20 19:15:58 2021 +++ src/usr.bin/xlint/lint1/ckbool.c Sun Jun 20 20:32:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ckbool.c,v 1.3 2021/06/20 19:15:58 rillig Exp $ */ +/* $NetBSD: ckbool.c,v 1.4 2021/06/20 20:32:42 rillig Exp $ */ /*- * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: ckbool.c,v 1.3 2021/06/20 19:15:58 rillig Exp $"); +__RCSID("$NetBSD: ckbool.c,v 1.4 2021/06/20 20:32:42 rillig Exp $"); #endif #include @@ -252,7 +252,7 @@ fallback_symbol_strict_bool(sym_t *sym) sym->s_scl = CTCONST; /* close enough */ sym->s_type = gettyp(BOOL); sym->s_value.v_tspec = BOOL; - sym->s_value.v_unsigned = true; + sym->s_value.v_unsigned_since_c90 = false; sym->s_value.v_quad = 0; return true; } @@ -261,7 +261,7 @@ fallback_symbol_strict_bool(sym_t *sym) sym->s_scl = CTCONST; /* close enough */ sym->s_type = gettyp(BOOL); sym->s_value.v_tspec = BOOL; - sym->s_value.v_unsigned = true; + sym->s_value.v_unsigned_since_c90 = false; sym->s_value.v_quad = 1; return true; } Index: src/usr.bin/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.45 src/usr.bin/xlint/lint1/lex.c:1.46 --- src/usr.bin/xlint/lint1/lex.c:1.45 Sun Jun 20 19:04:50 2021 +++ src/usr.bin/xlint/lint1/lex.c Sun Jun 20 20:32:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.45 2021/06/20 19:04:50 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.46 2021/06/20 20:32:42 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: lex.c,v 1.45 2021/06/20 19:04:50 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.46 2021/06/20 20:32:42 rillig Exp $"); #endif #include @@ -672,7 +672,7 @@ lex_integer_constant(const char *yytext, yylval.y_val = xcalloc(1, sizeof(*yylval.y_val)); yylval.y_val->v_tspec = typ; - yylval.y_val->v_unsigned = ansiu; + yylval.y_val->v_unsigned_since_c90 = ansiu; yylval.y_val->v_quad = (int64_t)uq; return T_CON; Index: src/usr.bin/xlint/lint1/lint1.h diff -u src/usr.bin/xlint/lint1/lint1.h:1.104 src/usr.bin/xlint/lint1/lint1.h:1.105 --- src/usr.bin/xlint/lint1/lint1.h:1.104 Sun Jun 20 19:04:50 2021 +++ src/usr.bin/xlint/lint1/lint1.h Sun Jun 20 20:32:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lint1.h,v 1.104 2021/06/20 19:04:50 rillig Exp $ */ +/* $NetBSD: lint1.h,v 1.105 2021/06/20 20:32:42 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -107,8 +107,13 @@ typedef enum { /* An integer or floating-point value. */ typedef struct { tspec_t v_tspec; - bool v_unsigned; /* set if an integer constant is - unsigned in C90 and later */ + /* + * Set if an integer constant is unsigned only in C90 and later, but + * not in traditional C. + * + * See the operators table in ops.def, columns "l r". + */ + bool v_unsigned_since_c90; union { int64_t _v_quad; /* integers */ ldbl_t _v_ldbl; /* floats */ Index: src/usr.bin/xlint/lint1/print.c diff -u src/usr.bin/xlint/lint1/print.c:1.13 src/usr.bin/xlint/lint1/print.c:1.14 --- src/usr.bin/xlint/lint1/print.c:1.13 Sun Jun 20 19:04:50 2021 +++ src/usr.bin/xlint/lint1/print.c Sun Jun 20 20:32:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: print.c,v 1.13 2021/06/20 19:04:50 rillig Exp $ */ +/* $NetBSD: print.c,v 1.14 2021/06/20 20:32:42 rillig Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #ifndef lin
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 20:48:25 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: tree.c Log Message: lint: remove unnecessary call to print_tnode For the possible operators that occur in message 324, print_tnode is equivalent to op_name, and the latter is simpler. When the function print_node was added to the code base, it had another use in init.c, for understanding how initialization works in lint. That code has since been rewritten completely, therefore print_tnode is no longer needed. For debugging, display_expression is the better choice since it has multi-line output and does not suffer from a fixed-length buffer. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.289 -r1.290 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.289 src/usr.bin/xlint/lint1/tree.c:1.290 --- src/usr.bin/xlint/lint1/tree.c:1.289 Sun Jun 20 20:32:42 2021 +++ src/usr.bin/xlint/lint1/tree.c Sun Jun 20 20:48:25 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.289 2021/06/20 20:32:42 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.290 2021/06/20 20:48:25 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.289 2021/06/20 20:32:42 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.290 2021/06/20 20:48:25 rillig Exp $"); #endif #include @@ -1934,12 +1934,10 @@ check_prototype_conversion(int arg, tspe /* * Print warnings for conversions of integer types which may cause problems. */ -/* ARGSUSED */ static void check_integer_conversion(op_t op, int arg, tspec_t nt, tspec_t ot, type_t *tp, tnode_t *tn) { - char opbuf[16]; if (tn->tn_op == CON) return; @@ -1971,7 +1969,7 @@ check_integer_conversion(op_t op, int ar case SHL: /* suggest cast from '%s' to '%s' on op %s to ... */ warning(324, type_name(gettyp(ot)), type_name(tp), - print_tnode(opbuf, sizeof(opbuf), tn)); + op_name(tn->tn_op)); break; default: break;
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jun 20 20:59:09 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: externs1.h print.c Log Message: lint: remove unused print_tnode The function display_expression serves the same purpose and prints more details. To generate a diff of this commit: cvs rdiff -u -r1.110 -r1.111 src/usr.bin/xlint/lint1/externs1.h cvs rdiff -u -r1.14 -r1.15 src/usr.bin/xlint/lint1/print.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/externs1.h diff -u src/usr.bin/xlint/lint1/externs1.h:1.110 src/usr.bin/xlint/lint1/externs1.h:1.111 --- src/usr.bin/xlint/lint1/externs1.h:1.110 Sat Jun 19 14:08:45 2021 +++ src/usr.bin/xlint/lint1/externs1.h Sun Jun 20 20:59:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: externs1.h,v 1.110 2021/06/19 14:08:45 rillig Exp $ */ +/* $NetBSD: externs1.h,v 1.111 2021/06/20 20:59:08 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -338,7 +338,6 @@ extern int lex_input(void); /* * print.c */ -extern char *print_tnode(char *, size_t, const tnode_t *); const char *scl_name(scl_t); /* Index: src/usr.bin/xlint/lint1/print.c diff -u src/usr.bin/xlint/lint1/print.c:1.14 src/usr.bin/xlint/lint1/print.c:1.15 --- src/usr.bin/xlint/lint1/print.c:1.14 Sun Jun 20 20:32:42 2021 +++ src/usr.bin/xlint/lint1/print.c Sun Jun 20 20:59:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: print.c,v 1.14 2021/06/20 20:32:42 rillig Exp $ */ +/* $NetBSD: print.c,v 1.15 2021/06/20 20:59:08 rillig Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,61 +35,11 @@ #include #ifndef lint -__RCSID("$NetBSD: print.c,v 1.14 2021/06/20 20:32:42 rillig Exp $"); +__RCSID("$NetBSD: print.c,v 1.15 2021/06/20 20:59:08 rillig Exp $"); #endif -#include - #include "lint1.h" -char * -print_tnode(char *buf, size_t bufsiz, const tnode_t *tn) -{ - strg_t *st; - val_t *v; - sym_t *s; - switch (tn->tn_op) { - case NAME: - s = tn->tn_sym; - (void)snprintf(buf, bufsiz, "%s", s->s_name); - break; - case CON: - v = tn->tn_val; - switch (v->v_tspec) { - case FLOAT: - case DOUBLE: - case LDOUBLE: - (void)snprintf(buf, bufsiz, "%Lg", v->v_ldbl); - break; - default: - (void)snprintf(buf, bufsiz, - /* FIXME */ - v->v_unsigned_since_c90 ? "%llu" : "%lld", - (unsigned long long)v->v_quad); - break; - } - break; - - case STRING: - st = tn->tn_string; - switch (st->st_tspec) { - case CHAR: - case SCHAR: - case UCHAR: - (void)snprintf(buf, bufsiz, "\"%s\"", st->st_cp); - break; - default: - (void)snprintf(buf, bufsiz, "\"*wide string*\""); - break; - } - break; - default: - (void)snprintf(buf, bufsiz, "%s", modtab[tn->tn_op].m_name); - break; - } - return buf; -} - /* Return the name of the "storage class" in the wider sense. */ const char * scl_name(scl_t scl)
CVS commit: src/sys/arch/alpha/alpha
Module Name:src Committed By: thorpej Date: Mon Jun 21 02:01:13 UTC 2021 Modified Files: src/sys/arch/alpha/alpha: db_disasm.c db_instruction.h Log Message: Allow alpha_print_instruction() to be called from outside DDB, and allow the caller to supply a buffer to contain the pretty-printed insn string, rather than db_printf() (which is used if there is no supplied buffer). To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/alpha/alpha/db_disasm.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/alpha/alpha/db_instruction.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/alpha/alpha/db_disasm.c diff -u src/sys/arch/alpha/alpha/db_disasm.c:1.16 src/sys/arch/alpha/alpha/db_disasm.c:1.17 --- src/sys/arch/alpha/alpha/db_disasm.c:1.16 Thu Mar 20 20:51:40 2014 +++ src/sys/arch/alpha/alpha/db_disasm.c Mon Jun 21 02:01:13 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: db_disasm.c,v 1.16 2014/03/20 20:51:40 christos Exp $ */ +/* $NetBSD: db_disasm.c,v 1.17 2021/06/21 02:01:13 thorpej Exp $ */ /* * Mach Operating System @@ -48,7 +48,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.16 2014/03/20 20:51:40 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.17 2021/06/21 02:01:13 thorpej Exp $"); #include #include @@ -781,31 +781,47 @@ static const char * const name_of_regist "t10", "t11", "ra", "pv", "at", "gp", "sp", "zero" }; -static int regcount; /* how many regs used in this inst */ -static int regnum[3]; /* which regs used in this inst */ - static const char * -register_name(int ireg) +register_name(struct alpha_print_instruction_context *ctx, int ireg) { int i; - for (i = 0; i < regcount; i++) - if (regnum[i] == ireg) + for (i = 0; i < ctx->regcount; i++) + if (ctx->regnum[i] == ireg) break; - if (i >= regcount) - regnum[regcount++] = ireg; + if (i >= ctx->regcount) + ctx->regnum[ctx->regcount++] = ireg; return (name_of_register[ireg]); } +static void +insn_printf(struct alpha_print_instruction_context *ctx, +const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + + if (ctx->buf != NULL) { + if (ctx->cursor < ctx->bufsize) { + ctx->cursor += vsnprintf(ctx->buf + ctx->cursor, + ctx->bufsize - ctx->cursor, fmt, ap); + } + } else { + db_vprintf(fmt, ap); + } + + va_end(ap); +} + /* * Disassemble instruction at 'loc'. 'altfmt' specifies an * (optional) alternate format. Return address of start of * next instruction. */ -static int -alpha_print_instruction(db_addr_t iadr, alpha_instruction i, -bool showregs) +int +alpha_print_instruction(struct alpha_print_instruction_context *ctx) { const char *opcode; int ireg; @@ -813,18 +829,19 @@ alpha_print_instruction(db_addr_t iadr, bool fstore; pal_instruction p; - regcount = 0; + ctx->regcount = 0; fstore = false; - opcode = op_name[i.mem_format.opcode]; + opcode = op_name[ctx->insn.mem_format.opcode]; /* * Dispatch directly on the opcode, save code * duplication sometimes via "harmless gotos". */ - switch (i.mem_format.opcode) { + switch (ctx->insn.mem_format.opcode) { case op_pal: /* "call_pal" is a long string; just use a space. */ - db_printf("%s %s", opcode, pal_opname(i.pal_format.function)); + insn_printf(ctx, "%s %s", opcode, + pal_opname(ctx->insn.pal_format.function)); break; case op_lda: case op_ldah: @@ -846,49 +863,54 @@ alpha_print_instruction(db_addr_t iadr, * For this and the following three groups we * just need different opcode strings */ - opcode = arit_name(i.operate_lit_format.function); + opcode = arit_name(ctx->insn.operate_lit_format.function); goto operate; break; case op_logical: - opcode = logical_name(i.operate_lit_format.function); + opcode = logical_name(ctx->insn.operate_lit_format.function); goto operate; break; case op_bit: - opcode = bitop_name(i.operate_lit_format.function); + opcode = bitop_name(ctx->insn.operate_lit_format.function); goto operate; break; case op_mul: - opcode = mul_name(i.operate_lit_format.function); + opcode = mul_name(ctx->insn.operate_lit_format.function); operate: /* * Nice and uniform, just check for literals */ - db_printf("%s\t%s,", opcode, - register_name(i.operate_lit_format.ra)); - if (i.operate_lit_format.one) - db_printf("#0x%x", i.operate_lit_format.literal); - else - db_printf("%s", register_name(i.operate_reg_format.rb)); - db_printf(",%s", register_name(i.operate_lit_format.rc)); + insn_printf(ctx, "%s\t%s,", opcode, + register_name(ctx, ctx->insn.operate_lit_format.ra)); + if (ctx->insn.operate_lit_format.one) { + insn_printf(ctx, "#0x%x", + ctx->insn.operate_lit_format.literal); + } else { + insn_printf(ctx, "%s", + register_name(ctx, + ctx->insn.operate_reg_format.rb)); + } + insn_print
CVS commit: src/sys/arch/alpha/alpha
Module Name:src Committed By: thorpej Date: Mon Jun 21 02:10:46 UTC 2021 Modified Files: src/sys/arch/alpha/alpha: db_disasm.c db_instruction.h Log Message: Remove the /I "alternate format" from db_disasm(), which was internally interpreted as "showregs", whcih would print the values of the registers at each instruction. Unfortunately, this was fundamentally broken because the saved registers accessible to DDB are only valid for the faulting insn that got us into DDB, and not arbitrary isns that can be examined from within DDB. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/alpha/alpha/db_disasm.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/alpha/alpha/db_instruction.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/alpha/alpha/db_disasm.c diff -u src/sys/arch/alpha/alpha/db_disasm.c:1.17 src/sys/arch/alpha/alpha/db_disasm.c:1.18 --- src/sys/arch/alpha/alpha/db_disasm.c:1.17 Mon Jun 21 02:01:13 2021 +++ src/sys/arch/alpha/alpha/db_disasm.c Mon Jun 21 02:10:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: db_disasm.c,v 1.17 2021/06/21 02:01:13 thorpej Exp $ */ +/* $NetBSD: db_disasm.c,v 1.18 2021/06/21 02:10:46 thorpej Exp $ */ /* * Mach Operating System @@ -48,7 +48,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.17 2021/06/21 02:01:13 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.18 2021/06/21 02:10:46 thorpej Exp $"); #include #include @@ -784,13 +784,6 @@ static const char * const name_of_regist static const char * register_name(struct alpha_print_instruction_context *ctx, int ireg) { - int i; - - for (i = 0; i < ctx->regcount; i++) - if (ctx->regnum[i] == ireg) - break; - if (i >= ctx->regcount) - ctx->regnum[ctx->regcount++] = ireg; return (name_of_register[ireg]); } @@ -824,12 +817,10 @@ int alpha_print_instruction(struct alpha_print_instruction_context *ctx) { const char *opcode; - int ireg; long signed_immediate; bool fstore; pal_instruction p; - ctx->regcount = 0; fstore = false; opcode = op_name[ctx->insn.mem_format.opcode]; @@ -1038,16 +1029,6 @@ loadstore_address: insn_printf(ctx, "%s(%s)", tbuf, register_name(ctx, ctx->insn.mem_format.rb)); } - /* - * For convenience, do the address computation - */ - if (ctx->showregs) { - if (ctx->insn.mem_format.opcode == op_ldah) -signed_immediate <<= 16; - insn_printf(ctx, " <0x%lx>", signed_immediate + - db_register_value(DDB_REGS, - ctx->insn.mem_format.rb)); - } break; case op_br: case op_fbeq: @@ -1084,21 +1065,6 @@ branch_displacement: insn_printf(ctx, "? 0x%x ?", ctx->insn.bits); } - /* - * Print out the registers used in this instruction - */ - if (ctx->showregs && ctx->regcount > 0) { - insn_printf(ctx, "\t<"); - for (ireg = 0; ireg < ctx->regcount; ireg++) { - if (ireg != 0) -insn_printf(ctx, ","); - insn_printf(ctx, "%s=0x%lx", - name_of_register[ctx->regnum[ireg]], - db_register_value(DDB_REGS, ctx->regnum[ireg])); - } - insn_printf(ctx, ">"); - } - /* If printing into a buffer, skip the newline. */ if (ctx->buf == NULL) { insn_printf(ctx, "\n"); @@ -1108,12 +1074,11 @@ branch_displacement: } db_addr_t -db_disasm(db_addr_t loc, bool altfmt) +db_disasm(db_addr_t loc, bool altfmt __unused) { struct alpha_print_instruction_context ctx = { .insn.bits = db_get_value(loc, 4, 0), .pc = loc, - .showregs = altfmt, }; loc += alpha_print_instruction(&ctx); Index: src/sys/arch/alpha/alpha/db_instruction.h diff -u src/sys/arch/alpha/alpha/db_instruction.h:1.11 src/sys/arch/alpha/alpha/db_instruction.h:1.12 --- src/sys/arch/alpha/alpha/db_instruction.h:1.11 Mon Jun 21 02:01:13 2021 +++ src/sys/arch/alpha/alpha/db_instruction.h Mon Jun 21 02:10:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: db_instruction.h,v 1.11 2021/06/21 02:01:13 thorpej Exp $ */ +/* $NetBSD: db_instruction.h,v 1.12 2021/06/21 02:10:46 thorpej Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -748,9 +748,6 @@ struct alpha_print_instruction_context { char *buf; /* output buffer (if not DDB) */ size_t bufsize; /* size of output buffer */ size_t cursor; /* current next output location */ - int regcount; /* how many rebgs used in this insn */ - int regnum[3]; /* which regs are used in this insn */ - bool showregs; /* show registers */ }; int alpha_print_instruction(struct alpha_print_instruction_context *);
CVS commit: src/share/man/man4
Module Name:src Committed By: thorpej Date: Mon Jun 21 02:12:00 UTC 2021 Modified Files: src/share/man/man4: ddb.4 Log Message: x/I no longer has special meaning on alpha, and behaves just like x/i. To generate a diff of this commit: cvs rdiff -u -r1.199 -r1.200 src/share/man/man4/ddb.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/ddb.4 diff -u src/share/man/man4/ddb.4:1.199 src/share/man/man4/ddb.4:1.200 --- src/share/man/man4/ddb.4:1.199 Thu Mar 11 10:34:34 2021 +++ src/share/man/man4/ddb.4 Mon Jun 21 02:12:00 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: ddb.4,v 1.199 2021/03/11 10:34:34 ryo Exp $ +.\" $NetBSD: ddb.4,v 1.200 2021/06/21 02:12:00 thorpej Exp $ .\" .\" Copyright (c) 1997 - 2019 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -56,7 +56,7 @@ .\" any improvements or extensions that they make and grant Carnegie Mellon .\" the rights to redistribute these changes. .\" -.Dd March 11, 2021 +.Dd Jiune 20, 2021 .Dt DDB 4 .Os .Sh NAME @@ -451,8 +451,6 @@ display as a machine instruction. display as a machine instruction, with possible alternative formats depending upon the machine: .Bl -tag -offset indent -width "sparc" -compact -.It alpha -print register operands .It m68k use Motorola syntax .It vax
CVS commit: src/external/gpl2/xcvs/dist/doc
Module Name:src Committed By: christos Date: Mon Jun 21 02:48:01 UTC 2021 Modified Files: src/external/gpl2/xcvs/dist/doc: cvs.texinfo Log Message: PR/56256: Germain: cvs info doc incorrect for update -D To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/external/gpl2/xcvs/dist/doc/cvs.texinfo Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/xcvs/dist/doc/cvs.texinfo diff -u src/external/gpl2/xcvs/dist/doc/cvs.texinfo:1.14 src/external/gpl2/xcvs/dist/doc/cvs.texinfo:1.15 --- src/external/gpl2/xcvs/dist/doc/cvs.texinfo:1.14 Fri Jul 5 20:10:25 2019 +++ src/external/gpl2/xcvs/dist/doc/cvs.texinfo Sun Jun 20 22:48:01 2021 @@ -11807,7 +11807,7 @@ them): @table @code @item -D date Use the most recent revision no later than @var{date}. -This option is sticky, and implies @samp{-P}. +This option is sticky. See @ref{Sticky tags}, for more information on sticky tags/dates. @item -f
CVS commit: src/sys/arch/x86/pci
Module Name:src Committed By: christos Date: Mon Jun 21 03:01:23 UTC 2021 Modified Files: src/sys/arch/x86/pci: pci_ranges.c Log Message: prop_dictionary_set_cstring_nocopy -> prop_dictionary_set_string_nocopy To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/pci/pci_ranges.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/pci/pci_ranges.c diff -u src/sys/arch/x86/pci/pci_ranges.c:1.8 src/sys/arch/x86/pci/pci_ranges.c:1.9 --- src/sys/arch/x86/pci/pci_ranges.c:1.8 Fri Mar 1 04:25:59 2019 +++ src/sys/arch/x86/pci/pci_ranges.c Sun Jun 20 23:01:23 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_ranges.c,v 1.8 2019/03/01 09:25:59 msaitoh Exp $ */ +/* $NetBSD: pci_ranges.c,v 1.9 2021/06/21 03:01:23 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: pci_ranges.c,v 1.8 2019/03/01 09:25:59 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_ranges.c,v 1.9 2021/06/21 03:01:23 christos Exp $"); #include #include @@ -784,7 +784,7 @@ pci_range_record(pci_chipset_tag_t pc, p pci_decompose_tag(pc, pal->pal_tag, &bus, &dev, &fun); ok = ok && - prop_dictionary_set_cstring_nocopy(rsvn, "type", + prop_dictionary_set_string_nocopy(rsvn, "type", pci_alloc_regtype_string(pal->pal_type)) && prop_dictionary_set_uint64(rsvn, "address", pal->pal_addr) &&
CVS commit: src/usr.bin/audiocfg
Module Name:src Committed By: christos Date: Mon Jun 21 03:04:27 UTC 2021 Modified Files: src/usr.bin/audiocfg: drvctl.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.bin/audiocfg/drvctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/audiocfg/drvctl.c diff -u src/usr.bin/audiocfg/drvctl.c:1.2 src/usr.bin/audiocfg/drvctl.c:1.3 --- src/usr.bin/audiocfg/drvctl.c:1.2 Wed Sep 1 22:17:35 2010 +++ src/usr.bin/audiocfg/drvctl.c Sun Jun 20 23:04:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: drvctl.c,v 1.2 2010/09/02 02:17:35 jmcneill Exp $ */ +/* $NetBSD: drvctl.c,v 1.3 2021/06/21 03:04:27 christos Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -64,9 +64,9 @@ drvctl_get_properties(int fd, const char command_dict = prop_dictionary_create(); args_dict = prop_dictionary_create(); - prop_dictionary_set_cstring_nocopy(command_dict, "drvctl-command", + prop_dictionary_set_string_nocopy(command_dict, "drvctl-command", "get-properties"); - prop_dictionary_set_cstring_nocopy(args_dict, "device-name", devnode); + prop_dictionary_set_string_nocopy(args_dict, "device-name", devnode); prop_dictionary_set(command_dict, "drvctl-arguments", args_dict); prop_object_release(args_dict); @@ -115,7 +115,7 @@ drvctl_search(int fd, const char *curnod rv = drvctl_get_properties(fd, laa.l_childname[i], &props); if (rv == false || props == NULL) continue; - rv = prop_dictionary_get_cstring_nocopy(props, + rv = prop_dictionary_get_string(props, "device-driver", &curdvname); if (rv == true && strcmp(curdvname, dvname) == 0) { rv = prop_dictionary_get_uint32(props,
CVS commit: src/sys/arch/zaurus/zaurus
Module Name:src Committed By: christos Date: Mon Jun 21 03:05:24 UTC 2021 Modified Files: src/sys/arch/zaurus/zaurus: autoconf.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/zaurus/zaurus/autoconf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/zaurus/autoconf.c diff -u src/sys/arch/zaurus/zaurus/autoconf.c:1.13 src/sys/arch/zaurus/zaurus/autoconf.c:1.14 --- src/sys/arch/zaurus/zaurus/autoconf.c:1.13 Wed Nov 13 12:48:03 2019 +++ src/sys/arch/zaurus/zaurus/autoconf.c Sun Jun 20 23:05:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.13 2019/11/13 17:48:03 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.14 2021/06/21 03:05:24 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.13 2019/11/13 17:48:03 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.14 2021/06/21 03:05:24 christos Exp $"); #include "opt_md.h" @@ -227,7 +227,7 @@ device_register(device_t dev, void *aux) */ if (device_is_a(dev, "iic") && device_is_a(dev->dv_parent, "ziic")) { - (void)prop_dictionary_set_cstring_nocopy(device_properties(dev), + (void)prop_dictionary_set_string_nocopy(device_properties(dev), I2C_PROP_INDIRECT_PROBE_STRATEGY, I2C_PROBE_STRATEGY_NONE); } }
CVS commit: src/sys/modules/panic
Module Name:src Committed By: christos Date: Mon Jun 21 03:08:07 UTC 2021 Modified Files: src/sys/modules/panic: panic.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/modules/panic/panic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/modules/panic/panic.c diff -u src/sys/modules/panic/panic.c:1.1 src/sys/modules/panic/panic.c:1.2 --- src/sys/modules/panic/panic.c:1.1 Thu Feb 17 20:07:20 2011 +++ src/sys/modules/panic/panic.c Sun Jun 20 23:08:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: panic.c,v 1.1 2011/02/18 01:07:20 jmcneill Exp $ */ +/* $NetBSD: panic.c,v 1.2 2021/06/21 03:08:07 christos Exp $ */ /* * Copyright (c) 2011 Jared D. McNeill @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: panic.c,v 1.1 2011/02/18 01:07:20 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: panic.c,v 1.2 2021/06/21 03:08:07 christos Exp $"); #include @@ -63,7 +63,7 @@ panic_modcmd(modcmd_t cmd, void *opaque) unsigned int i; if (props) - prop_dictionary_get_cstring_nocopy(props, "how", &how); + prop_dictionary_get_string(props, "how", &how); if (how == NULL) how = "panic";
CVS commit: src/usr.sbin/hdaudioctl
Module Name:src Committed By: christos Date: Mon Jun 21 03:09:52 UTC 2021 Modified Files: src/usr.sbin/hdaudioctl: graph.c hdaudioctl.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/hdaudioctl/graph.c \ src/usr.sbin/hdaudioctl/hdaudioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/hdaudioctl/graph.c diff -u src/usr.sbin/hdaudioctl/graph.c:1.5 src/usr.sbin/hdaudioctl/graph.c:1.6 --- src/usr.sbin/hdaudioctl/graph.c:1.5 Mon Jun 15 09:06:39 2020 +++ src/usr.sbin/hdaudioctl/graph.c Sun Jun 20 23:09:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: graph.c,v 1.5 2020/06/15 13:06:39 sborrill Exp $ */ +/* $NetBSD: graph.c,v 1.6 2021/06/21 03:09:52 christos Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd @@ -95,7 +95,7 @@ hdaudioctl_graph(int fd, int argc, char HDAUDIO_FGRP_WIDGET_INFO, &response); if (error != 0) break; - prop_dictionary_get_cstring_nocopy(response, "name", &name); + prop_dictionary_get_string(response, "name", &name); prop_dictionary_get_uint32(response, "cap", &cap); prop_dictionary_get_uint32(response, "config", &config); prop_dictionary_get_uint8(response, "type", &type); @@ -174,7 +174,7 @@ next: HDAUDIO_AFG_WIDGET_INFO, &response); if (error != 0) break; - prop_dictionary_get_cstring_nocopy(response, "name", &name); + prop_dictionary_get_string(response, "name", &name); prop_dictionary_get_uint8(response, "type", &type); prop_dictionary_get_uint8(response, "nid", &nid); @@ -197,7 +197,7 @@ next: HDAUDIO_AFG_WIDGET_INFO, &response); if (error != 0) break; - prop_dictionary_get_cstring_nocopy(response, "name", &name); + prop_dictionary_get_string(response, "name", &name); prop_dictionary_get_uint8(response, "type", &type); prop_dictionary_get_uint8(response, "nid", &nid); Index: src/usr.sbin/hdaudioctl/hdaudioctl.c diff -u src/usr.sbin/hdaudioctl/hdaudioctl.c:1.5 src/usr.sbin/hdaudioctl/hdaudioctl.c:1.6 --- src/usr.sbin/hdaudioctl/hdaudioctl.c:1.5 Wed Jul 1 08:19:45 2020 +++ src/usr.sbin/hdaudioctl/hdaudioctl.c Sun Jun 20 23:09:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudioctl.c,v 1.5 2020/07/01 12:19:45 sborrill Exp $ */ +/* $NetBSD: hdaudioctl.c,v 1.6 2021/06/21 03:09:52 christos Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd @@ -141,7 +141,7 @@ hdaudioctl_list(int fd) prop_dictionary_get_uint16(dict, "vendor-id", &vendor); prop_dictionary_get_uint16(dict, "product-id", &product); prop_dictionary_get_uint32(dict, "subsystem-id", &subsystem); - prop_dictionary_get_cstring_nocopy(dict, "device", &device); + prop_dictionary_get_string(dict, "device", &device); printf("codecid 0x%02X nid 0x%02X vendor 0x%04X " "product 0x%04X subsystem 0x%08X device %s\n",
CVS commit: src/sys/dev
Module Name:src Committed By: christos Date: Mon Jun 21 03:11:05 UTC 2021 Modified Files: src/sys/dev: veriexec.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/veriexec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/veriexec.c diff -u src/sys/dev/veriexec.c:1.1 src/sys/dev/veriexec.c:1.2 --- src/sys/dev/veriexec.c:1.1 Wed Dec 9 13:25:32 2015 +++ src/sys/dev/veriexec.c Sun Jun 20 23:11:05 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: veriexec.c,v 1.1 2015/12/09 18:25:32 maxv Exp $ */ +/* $NetBSD: veriexec.c,v 1.2 2021/06/21 03:11:05 christos Exp $ */ /*- * Copyright (c) 2005, 2006 Elad Efrat @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: veriexec.c,v 1.1 2015/12/09 18:25:32 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: veriexec.c,v 1.2 2021/06/21 03:11:05 christos Exp $"); #include #include @@ -110,7 +110,7 @@ veriexec_delete(prop_dictionary_t dict, const char *file; int error; - if (!prop_dictionary_get_cstring_nocopy(dict, "file", &file)) + if (!prop_dictionary_get_string(dict, "file", &file)) return (EINVAL); error = namei_simple_kernel(file, NSM_FOLLOW_NOEMULROOT, &vp); @@ -135,7 +135,7 @@ veriexec_query(prop_dictionary_t dict, p const char *file; int error; - if (!prop_dictionary_get_cstring_nocopy(dict, "file", &file)) + if (!prop_dictionary_get_string(dict, "file", &file)) return (EINVAL); error = namei_simple_kernel(file, NSM_FOLLOW_NOEMULROOT, &vp);
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: christos Date: Mon Jun 21 03:12:54 UTC 2021 Modified Files: src/sys/dev/i2c: adm1021.c dbcool.c dstemp.c i2c.c lm75.c pcagpio.c pcf8574.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/i2c/adm1021.c cvs rdiff -u -r1.61 -r1.62 src/sys/dev/i2c/dbcool.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/i2c/dstemp.c cvs rdiff -u -r1.78 -r1.79 src/sys/dev/i2c/i2c.c cvs rdiff -u -r1.44 -r1.45 src/sys/dev/i2c/lm75.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/pcagpio.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/i2c/pcf8574.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/i2c/adm1021.c diff -u src/sys/dev/i2c/adm1021.c:1.28 src/sys/dev/i2c/adm1021.c:1.29 --- src/sys/dev/i2c/adm1021.c:1.28 Tue Jun 15 00:41:01 2021 +++ src/sys/dev/i2c/adm1021.c Sun Jun 20 23:12:54 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: adm1021.c,v 1.28 2021/06/15 04:41:01 mlelstv Exp $ */ +/* $NetBSD: adm1021.c,v 1.29 2021/06/21 03:12:54 christos Exp $ */ /* $OpenBSD: adm1021.c,v 1.27 2007/06/24 05:34:35 dlg Exp $ */ /* @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.28 2021/06/15 04:41:01 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.29 2021/06/21 03:12:54 christos Exp $"); #include #include @@ -409,11 +409,11 @@ admtemp_attach(device_t parent, device_t sc->sc_sensor[ADMTEMP_EXT].flags = ENVSYS_FMONLIMITS | ENVSYS_FHAS_ENTROPY; - if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "s00", &desc)) { + if (prop_dictionary_get_string(sc->sc_prop, "s00", &desc)) { strncpy(iname, desc, 64); } - if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "s01", &desc)) { + if (prop_dictionary_get_string(sc->sc_prop, "s01", &desc)) { strncpy(ename, desc, 64); } Index: src/sys/dev/i2c/dbcool.c diff -u src/sys/dev/i2c/dbcool.c:1.61 src/sys/dev/i2c/dbcool.c:1.62 --- src/sys/dev/i2c/dbcool.c:1.61 Tue Jun 15 00:39:49 2021 +++ src/sys/dev/i2c/dbcool.c Sun Jun 20 23:12:54 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: dbcool.c,v 1.61 2021/06/15 04:39:49 mlelstv Exp $ */ +/* $NetBSD: dbcool.c,v 1.62 2021/06/21 03:12:54 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.61 2021/06/15 04:39:49 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.62 2021/06/21 03:12:54 christos Exp $"); #include #include @@ -1697,7 +1697,7 @@ dbcool_attach_sensor(struct dbcool_softc name_index = sc->sc_dc.dc_chip->table[idx].name_index; snprintf(name, 7, "s%02x", sc->sc_dc.dc_chip->table[idx].reg.val_reg); - if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, name, &desc)) { + if (prop_dictionary_get_string(sc->sc_prop, name, &desc)) { strlcpy(sc->sc_sensor[idx].desc, desc, sizeof(sc->sc_sensor[idx].desc)); } else { Index: src/sys/dev/i2c/dstemp.c diff -u src/sys/dev/i2c/dstemp.c:1.13 src/sys/dev/i2c/dstemp.c:1.14 --- src/sys/dev/i2c/dstemp.c:1.13 Tue Jun 15 00:41:01 2021 +++ src/sys/dev/i2c/dstemp.c Sun Jun 20 23:12:54 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: dstemp.c,v 1.13 2021/06/15 04:41:01 mlelstv Exp $ */ +/* $NetBSD: dstemp.c,v 1.14 2021/06/21 03:12:54 christos Exp $ */ /*- * Copyright (c) 2018 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.13 2021/06/15 04:41:01 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.14 2021/06/21 03:12:54 christos Exp $"); #include #include @@ -126,9 +126,9 @@ dstemp_attach(device_t parent, device_t sc->sc_sensor_temp.state = ENVSYS_SINVALID; sc->sc_sensor_temp.flags = ENVSYS_FHAS_ENTROPY; - if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "s00", &desc)) { + if (prop_dictionary_get_string(sc->sc_prop, "s00", &desc)) { strncpy(name, desc, 64); - } else if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "saa", &desc)) { + } else if (prop_dictionary_get_string(sc->sc_prop, "saa", &desc)) { strncpy(name, desc, 64); } Index: src/sys/dev/i2c/i2c.c diff -u src/sys/dev/i2c/i2c.c:1.78 src/sys/dev/i2c/i2c.c:1.79 --- src/sys/dev/i2c/i2c.c:1.78 Sat Apr 24 19:36:54 2021 +++ src/sys/dev/i2c/i2c.c Sun Jun 20 23:12:54 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i2c.c,v 1.78 2021/04/24 23:36:54 thorpej Exp $ */ +/* $NetBSD: i2c.c,v 1.79 2021/06/21 03:12:54 christos Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.78 2021/04/24 23:36:54 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.79 2021/06/21 03:12:54 christos Exp $"); #include #include @@ -452,7 +452,7 @@ iic_attach(device_t parent, device_t sel for (i = 0; i < count; i++) { dev = prop_array_get(child_devices, i); if (!dev) continue; - if (!prop_dictionary_get_cstring_nocopy( + if (!prop_dictionary_get_string( dev, "
CVS commit: src/lib/libdm
Module Name:src Committed By: christos Date: Mon Jun 21 03:13:33 UTC 2021 Modified Files: src/lib/libdm: libdm_ioctl.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libdm/libdm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/libdm_ioctl.c diff -u src/lib/libdm/libdm_ioctl.c:1.5 src/lib/libdm/libdm_ioctl.c:1.6 --- src/lib/libdm/libdm_ioctl.c:1.5 Sun Jun 7 01:57:17 2020 +++ src/lib/libdm/libdm_ioctl.c Sun Jun 20 23:13:32 2021 @@ -266,7 +266,7 @@ libdm_task_get_name(libdm_task_t libdm_t { char *name; - if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task, + if (!prop_dictionary_get_string(libdm_task->ldm_task, DM_IOCTL_NAME, (const char **)&name)) return NULL; @@ -291,7 +291,7 @@ libdm_task_get_uuid(libdm_task_t libdm_t { char *uuid; - if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task, + if (!prop_dictionary_get_string(libdm_task->ldm_task, DM_IOCTL_UUID, (const char **)&uuid)) return NULL; @@ -304,7 +304,7 @@ libdm_task_get_command(libdm_task_t libd { char *command; - if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task, + if (!prop_dictionary_get_string(libdm_task->ldm_task, DM_IOCTL_COMMAND, (const char **)&command)) return NULL; @@ -755,7 +755,7 @@ libdm_table_get_target(libdm_table_t lib { char *target; - if (!prop_dictionary_get_cstring_nocopy(libdm_table->ldm_tbl, DM_TABLE_TYPE, + if (!prop_dictionary_get_string(libdm_table->ldm_tbl, DM_TABLE_TYPE, (const char **)&target)) return NULL; @@ -782,7 +782,7 @@ libdm_table_get_params(libdm_table_t li { char *params; - if (!prop_dictionary_get_cstring_nocopy(libdm_table->ldm_tbl, DM_TABLE_PARAMS, + if (!prop_dictionary_get_string(libdm_table->ldm_tbl, DM_TABLE_PARAMS, (const char **)¶ms)) return NULL; @@ -816,7 +816,7 @@ libdm_target_get_name(libdm_target_t lib { char *name; - if (!prop_dictionary_get_cstring_nocopy(libdm_target->ldm_trgt, + if (!prop_dictionary_get_string(libdm_target->ldm_trgt, DM_TARGETS_NAME, (const char **)&name)) return NULL; @@ -860,7 +860,7 @@ libdm_dev_get_name(libdm_dev_t libdm_dev { char *name; - if (!prop_dictionary_get_cstring_nocopy(libdm_dev->ldm_dev, + if (!prop_dictionary_get_string(libdm_dev->ldm_dev, DM_DEV_NAME, (const char **)&name)) return NULL;
CVS commit: src/sbin/devpubd
Module Name:src Committed By: christos Date: Mon Jun 21 03:14:12 UTC 2021 Modified Files: src/sbin/devpubd: devpubd.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sbin/devpubd/devpubd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/devpubd/devpubd.c diff -u src/sbin/devpubd/devpubd.c:1.6 src/sbin/devpubd/devpubd.c:1.7 --- src/sbin/devpubd/devpubd.c:1.6 Mon Feb 24 06:45:30 2020 +++ src/sbin/devpubd/devpubd.c Sun Jun 20 23:14:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: devpubd.c,v 1.6 2020/02/24 11:45:30 mlelstv Exp $ */ +/* $NetBSD: devpubd.c,v 1.7 2021/06/21 03:14:12 christos Exp $ */ /*- * Copyright (c) 2011 Jared D. McNeill @@ -36,7 +36,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2011-2015\ Jared D. McNeill . All rights reserved."); -__RCSID("$NetBSD: devpubd.c,v 1.6 2020/02/24 11:45:30 mlelstv Exp $"); +__RCSID("$NetBSD: devpubd.c,v 1.7 2021/06/21 03:14:12 christos Exp $"); #include #include @@ -144,8 +144,8 @@ devpubd_eventloop(void) res = prop_dictionary_recv_ioctl(drvctl_fd, DRVGETEVENT, &ev); if (res) err(EXIT_FAILURE, "DRVGETEVENT failed"); - prop_dictionary_get_cstring_nocopy(ev, "event", &event); - prop_dictionary_get_cstring_nocopy(ev, "device", &device[0]); + prop_dictionary_get_string(ev, "event", &event); + prop_dictionary_get_string(ev, "device", &device[0]); printf("%s: event='%s', device='%s'\n", __func__, event, device[0]);
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: christos Date: Mon Jun 21 03:14:41 UTC 2021 Modified Files: src/sbin/ifconfig: agr.c env.c lagg.c pfsync.c vlan.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sbin/ifconfig/agr.c src/sbin/ifconfig/vlan.c cvs rdiff -u -r1.13 -r1.14 src/sbin/ifconfig/env.c cvs rdiff -u -r1.1 -r1.2 src/sbin/ifconfig/lagg.c cvs rdiff -u -r1.3 -r1.4 src/sbin/ifconfig/pfsync.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/agr.c diff -u src/sbin/ifconfig/agr.c:1.15 src/sbin/ifconfig/agr.c:1.16 --- src/sbin/ifconfig/agr.c:1.15 Tue Jul 15 17:27:58 2008 +++ src/sbin/ifconfig/agr.c Sun Jun 20 23:14:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: agr.c,v 1.15 2008/07/15 21:27:58 dyoung Exp $ */ +/* $NetBSD: agr.c,v 1.16 2021/06/21 03:14:40 christos Exp $ */ /*- * Copyright (c)2005 YAMAMOTO Takashi, @@ -28,7 +28,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: agr.c,v 1.15 2008/07/15 21:27:58 dyoung Exp $"); +__RCSID("$NetBSD: agr.c,v 1.16 2021/06/21 03:14:40 christos Exp $"); #endif /* !defined(lint) */ #include @@ -101,7 +101,7 @@ agrsetport(prop_dictionary_t env, prop_d return -1; } - if (!prop_dictionary_get_cstring_nocopy(env, "agrport", &port)) { + if (!prop_dictionary_get_string(env, "agrport", &port)) { warnx("%s.%d", __func__, __LINE__); errno = ENOENT; return -1; Index: src/sbin/ifconfig/vlan.c diff -u src/sbin/ifconfig/vlan.c:1.15 src/sbin/ifconfig/vlan.c:1.16 --- src/sbin/ifconfig/vlan.c:1.15 Fri Aug 16 06:33:17 2019 +++ src/sbin/ifconfig/vlan.c Sun Jun 20 23:14:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: vlan.c,v 1.15 2019/08/16 10:33:17 msaitoh Exp $ */ +/* $NetBSD: vlan.c,v 1.16 2021/06/21 03:14:40 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: vlan.c,v 1.15 2019/08/16 10:33:17 msaitoh Exp $"); +__RCSID("$NetBSD: vlan.c,v 1.16 2021/06/21 03:14:40 christos Exp $"); #endif /* not lint */ #include @@ -140,7 +140,7 @@ setvlanif(prop_dictionary_t env, prop_di if (getvlan(env, &vlr, false) == -1) err(EXIT_FAILURE, "%s: getsock", __func__); - if (!prop_dictionary_get_cstring_nocopy(env, "vlanif", &parent)) { + if (!prop_dictionary_get_string(env, "vlanif", &parent)) { errno = ENOENT; return -1; } Index: src/sbin/ifconfig/env.c diff -u src/sbin/ifconfig/env.c:1.13 src/sbin/ifconfig/env.c:1.14 --- src/sbin/ifconfig/env.c:1.13 Sun Jun 7 02:02:58 2020 +++ src/sbin/ifconfig/env.c Sun Jun 20 23:14:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: env.c,v 1.13 2020/06/07 06:02:58 thorpej Exp $ */ +/* $NetBSD: env.c,v 1.14 2021/06/21 03:14:40 christos Exp $ */ /*- * Copyright (c) 2008 David Young. All rights reserved. @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: env.c,v 1.13 2020/06/07 06:02:58 thorpej Exp $"); +__RCSID("$NetBSD: env.c,v 1.14 2021/06/21 03:14:40 christos Exp $"); #endif /* not lint */ #include @@ -122,7 +122,7 @@ getifname(prop_dictionary_t env) { const char *s; - return prop_dictionary_get_cstring_nocopy(env, "if", &s) ? s : NULL; + return prop_dictionary_get_string(env, "if", &s) ? s : NULL; } ssize_t Index: src/sbin/ifconfig/lagg.c diff -u src/sbin/ifconfig/lagg.c:1.1 src/sbin/ifconfig/lagg.c:1.2 --- src/sbin/ifconfig/lagg.c:1.1 Mon May 17 00:07:42 2021 +++ src/sbin/ifconfig/lagg.c Sun Jun 20 23:14:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lagg.c,v 1.1 2021/05/17 04:07:42 yamaguchi Exp $ */ +/* $NetBSD: lagg.c,v 1.2 2021/06/21 03:14:40 christos Exp $ */ /* * Copyright (c) 2021 Internet Initiative Japan Inc. @@ -28,7 +28,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: lagg.c,v 1.1 2021/05/17 04:07:42 yamaguchi Exp $"); +__RCSID("$NetBSD: lagg.c,v 1.2 2021/06/21 03:14:40 christos Exp $"); #endif /* !defined(lint) */ #include @@ -391,7 +391,7 @@ setlaggport(prop_dictionary_t env, prop_ enum lagg_ioctl ioc; int64_t lpcmd, pri; - if (!prop_dictionary_get_cstring_nocopy(env, "laggport", &ifname)) { + if (!prop_dictionary_get_string(env, "laggport", &ifname)) { if (lagg_debug) warnx("%s.%d", __func__, __LINE__); errno = ENOENT; Index: src/sbin/ifconfig/pfsync.c diff -u src/sbin/ifconfig/pfsync.c:1.3 src/sbin/ifconfig/pfsync.c:1.4 --- src/sbin/ifconfig/pfsync.c:1.3 Sun Jun 7 02:02:58 2020 +++ src/sbin/ifconfig/pfsync.c Sun Jun 20 23:14:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pfsync.c,v 1.3 2020/06/07 06:02:58 thorpej Exp $ */ +/* $NetBSD: pfsync.c,v 1.4 2021/06/21 03:14:40 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. * All rights reserved. @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: pfsync.c,v 1.3 2020/06/07 06:02:58 thorpej Exp $"); +__RCSID("$NetBSD: pfsync.c,v 1.4 2021/06/21 03:14:40 christos Exp $"); #endif /* not lint */ #include @@ -155,7 +155,7 @@ setpfsyncdev(prop_dictionary_t en
CVS commit: src/sys/arch/arm/nvidia
Module Name:src Committed By: christos Date: Mon Jun 21 03:15:22 UTC 2021 Modified Files: src/sys/arch/arm/nvidia: tegra_cec.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/nvidia/tegra_cec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/nvidia/tegra_cec.c diff -u src/sys/arch/arm/nvidia/tegra_cec.c:1.9 src/sys/arch/arm/nvidia/tegra_cec.c:1.10 --- src/sys/arch/arm/nvidia/tegra_cec.c:1.9 Sat Apr 24 19:36:27 2021 +++ src/sys/arch/arm/nvidia/tegra_cec.c Sun Jun 20 23:15:22 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_cec.c,v 1.9 2021/04/24 23:36:27 thorpej Exp $ */ +/* $NetBSD: tegra_cec.c,v 1.10 2021/06/21 03:15:22 christos Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_cec.c,v 1.9 2021/04/24 23:36:27 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_cec.c,v 1.10 2021/06/21 03:15:22 christos Exp $"); #include #include @@ -179,7 +179,7 @@ tegra_cec_attach(device_t parent, device } aprint_normal_dev(self, "interrupting on %s\n", intrstr); - prop_dictionary_get_cstring_nocopy(prop, "hdmi-device", + prop_dictionary_get_string(prop, "hdmi-device", &sc->sc_hdmidevname); fdtbus_reset_assert(sc->sc_rst);
CVS commit: src/sys/dev/dm
Module Name:src Committed By: christos Date: Mon Jun 21 03:16:43 UTC 2021 Modified Files: src/sys/dev/dm: dm_ioctl.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/dm/dm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_ioctl.c diff -u src/sys/dev/dm/dm_ioctl.c:1.51 src/sys/dev/dm/dm_ioctl.c:1.52 --- src/sys/dev/dm/dm_ioctl.c:1.51 Fri May 7 05:53:39 2021 +++ src/sys/dev/dm/dm_ioctl.c Sun Jun 20 23:16:43 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: dm_ioctl.c,v 1.51 2021/05/07 09:53:39 hannken Exp $ */ +/* $NetBSD: dm_ioctl.c,v 1.52 2021/06/21 03:16:43 christos Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.51 2021/05/07 09:53:39 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.52 2021/06/21 03:16:43 christos Exp $"); /* * Locking is used to synchronise between ioctl calls and between dm_table's @@ -910,8 +910,8 @@ dm_table_status_ioctl(prop_dictionary_t name = NULL; flags = 0; - prop_dictionary_get_cstring_nocopy(dm_dict, DM_IOCTL_NAME, &name); - prop_dictionary_get_cstring_nocopy(dm_dict, DM_IOCTL_UUID, &uuid); + prop_dictionary_get_string(dm_dict, DM_IOCTL_NAME, &name); + prop_dictionary_get_string(dm_dict, DM_IOCTL_UUID, &uuid); prop_dictionary_get_uint32(dm_dict, DM_IOCTL_FLAGS, &flags); prop_dictionary_get_uint32(dm_dict, DM_IOCTL_MINOR, &minor);
CVS commit: src/sys/dev/sdmmc
Module Name:src Committed By: christos Date: Mon Jun 21 03:18:00 UTC 2021 Modified Files: src/sys/dev/sdmmc: if_bwfm_sdio.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/sdmmc/if_bwfm_sdio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/sdmmc/if_bwfm_sdio.c diff -u src/sys/dev/sdmmc/if_bwfm_sdio.c:1.25 src/sys/dev/sdmmc/if_bwfm_sdio.c:1.26 --- src/sys/dev/sdmmc/if_bwfm_sdio.c:1.25 Tue Jan 26 22:10:21 2021 +++ src/sys/dev/sdmmc/if_bwfm_sdio.c Sun Jun 20 23:17:59 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bwfm_sdio.c,v 1.25 2021/01/27 03:10:21 thorpej Exp $ */ +/* $NetBSD: if_bwfm_sdio.c,v 1.26 2021/06/21 03:17:59 christos Exp $ */ /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation @@ -565,7 +565,7 @@ bwfm_fdt_find_phandle(device_t self, dev /* locate in FDT */ dict = device_properties(self); - if (prop_dictionary_get_cstring_nocopy(dict, "fdt-path", &str)) { + if (prop_dictionary_get_string(dict, "fdt-path", &str)) { /* search in FDT */ phandle = OF_finddevice(str); } else { @@ -576,7 +576,7 @@ bwfm_fdt_find_phandle(device_t self, dev return -1; /* locate in FDT */ dict = device_properties(dev); - if (!prop_dictionary_get_cstring_nocopy(dict, "fdt-path", &str)) + if (!prop_dictionary_get_string(dict, "fdt-path", &str)) return -1; /* are we the only FDT child ? */
CVS commit: src/sys/arch/arm/omap
Module Name:src Committed By: christos Date: Mon Jun 21 03:18:40 UTC 2021 Modified Files: src/sys/arch/arm/omap: omap3_ehci.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/omap/omap3_ehci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/omap/omap3_ehci.c diff -u src/sys/arch/arm/omap/omap3_ehci.c:1.14 src/sys/arch/arm/omap/omap3_ehci.c:1.15 --- src/sys/arch/arm/omap/omap3_ehci.c:1.14 Sat Apr 24 19:36:28 2021 +++ src/sys/arch/arm/omap/omap3_ehci.c Sun Jun 20 23:18:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: omap3_ehci.c,v 1.14 2021/04/24 23:36:28 thorpej Exp $ */ +/* $NetBSD: omap3_ehci.c,v 1.15 2021/06/21 03:18:40 christos Exp $ */ /*- * Copyright (c) 2010-2012 Jared D. McNeill @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: omap3_ehci.c,v 1.14 2021/04/24 23:36:28 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: omap3_ehci.c,v 1.15 2021/06/21 03:18:40 christos Exp $"); #include "locators.h" @@ -365,7 +365,7 @@ omap3_ehci_get_port_mode(prop_dictionary const char *s = NULL; enum omap3_ehci_port_mode mode = OMAP3_EHCI_PORT_MODE_NONE; - if (prop_dictionary_get_cstring_nocopy(prop, key, &s) && s != NULL) { + if (prop_dictionary_get_string(prop, key, &s) && s != NULL) { if (strcmp(s, "phy") == 0) { mode = OMAP3_EHCI_PORT_MODE_PHY; #ifdef OMAP_3XXX
CVS commit: src/sys/dev/pci
Module Name:src Committed By: christos Date: Mon Jun 21 03:19:21 UTC 2021 Modified Files: src/sys/dev/pci: machfb.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/dev/pci/machfb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/machfb.c diff -u src/sys/dev/pci/machfb.c:1.104 src/sys/dev/pci/machfb.c:1.105 --- src/sys/dev/pci/machfb.c:1.104 Sat Apr 24 19:36:57 2021 +++ src/sys/dev/pci/machfb.c Sun Jun 20 23:19:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: machfb.c,v 1.104 2021/04/24 23:36:57 thorpej Exp $ */ +/* $NetBSD: machfb.c,v 1.105 2021/06/21 03:19:21 christos Exp $ */ /* * Copyright (c) 2002 Bang Jun-Young @@ -34,7 +34,7 @@ #include __KERNEL_RCSID(0, - "$NetBSD: machfb.c,v 1.104 2021/04/24 23:36:57 thorpej Exp $"); + "$NetBSD: machfb.c,v 1.105 2021/06/21 03:19:21 christos Exp $"); #include #include @@ -520,7 +520,7 @@ mach64_attach(device_t parent, device_t default_mode.hdisplay = width; default_mode.vdisplay = height; - prop_dictionary_get_cstring_nocopy(device_properties(sc->sc_dev), + prop_dictionary_get_string(device_properties(sc->sc_dev), "videomode", &mptr); memset(&sc->sc_ei, 0, sizeof(sc->sc_ei));
CVS commit: src/sys/dev/pci
Module Name:src Committed By: christos Date: Mon Jun 21 03:21:17 UTC 2021 Modified Files: src/sys/dev/pci: radeonfb.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pci/radeonfb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/radeonfb.c diff -u src/sys/dev/pci/radeonfb.c:1.114 src/sys/dev/pci/radeonfb.c:1.115 --- src/sys/dev/pci/radeonfb.c:1.114 Sat Apr 24 19:36:57 2021 +++ src/sys/dev/pci/radeonfb.c Sun Jun 20 23:21:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: radeonfb.c,v 1.114 2021/04/24 23:36:57 thorpej Exp $ */ +/* $NetBSD: radeonfb.c,v 1.115 2021/06/21 03:21:17 christos Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.114 2021/04/24 23:36:57 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.115 2021/06/21 03:21:17 christos Exp $"); #include #include @@ -812,7 +812,7 @@ radeonfb_attach(device_t parent, device_ /* setup default video mode from devprop (allows PROM override) */ sc->sc_defaultmode = radeonfb_default_mode; - if (prop_dictionary_get_cstring_nocopy(device_properties(sc->sc_dev), + if (prop_dictionary_get_string(device_properties(sc->sc_dev), "videomode", &mptr)) { strncpy(sc->sc_modebuf, mptr, sizeof(sc->sc_modebuf));
CVS commit: src/usr.bin/make
Module Name:src Committed By: sjg Date: Mon Jun 21 04:24:17 UTC 2021 Modified Files: src/usr.bin/make: var.c src/usr.bin/make/unit-tests: moderrs.exp moderrs.mk Log Message: Do not report unmatched regex subexpressions It is not always an error for a subexpression to have not matched, since the regex library can/does not convey how many matches are expected, only report an error if opts.strict (-dL) Reviewed by: christos To generate a diff of this commit: cvs rdiff -u -r1.932 -r1.933 src/usr.bin/make/var.c cvs rdiff -u -r1.29 -r1.30 src/usr.bin/make/unit-tests/moderrs.exp cvs rdiff -u -r1.27 -r1.28 src/usr.bin/make/unit-tests/moderrs.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.932 src/usr.bin/make/var.c:1.933 --- src/usr.bin/make/var.c:1.932 Sun May 30 20:41:34 2021 +++ src/usr.bin/make/var.c Mon Jun 21 04:24:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.932 2021/05/30 20:41:34 rillig Exp $ */ +/* $NetBSD: var.c,v 1.933 2021/06/21 04:24:17 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -140,7 +140,7 @@ #include "metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.932 2021/05/30 20:41:34 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.933 2021/06/21 04:24:17 sjg Exp $"); /* * Variables are defined using one of the VAR=value assignments. Their @@ -1651,9 +1651,11 @@ tryagain: Error("No subexpression \\%u", (unsigned)n); } else if (m[n].rm_so == -1) { - Error( - "No match for subexpression \\%u", - (unsigned)n); + if (opts.strict) { + Error( + "No match for subexpression \\%u", + (unsigned)n); + } } else { SepBuf_AddBytesBetween(buf, wp + m[n].rm_so, wp + m[n].rm_eo); Index: src/usr.bin/make/unit-tests/moderrs.exp diff -u src/usr.bin/make/unit-tests/moderrs.exp:1.29 src/usr.bin/make/unit-tests/moderrs.exp:1.30 --- src/usr.bin/make/unit-tests/moderrs.exp:1.29 Tue Feb 23 16:07:14 2021 +++ src/usr.bin/make/unit-tests/moderrs.exp Mon Jun 21 04:24:17 2021 @@ -143,4 +143,4 @@ make: Unclosed variable expression, expe 1 1 2 x3 5 8 1x3 21 34 -exit status 0 +exit status 2 Index: src/usr.bin/make/unit-tests/moderrs.mk diff -u src/usr.bin/make/unit-tests/moderrs.mk:1.27 src/usr.bin/make/unit-tests/moderrs.mk:1.28 --- src/usr.bin/make/unit-tests/moderrs.mk:1.27 Tue Feb 23 16:04:16 2021 +++ src/usr.bin/make/unit-tests/moderrs.mk Mon Jun 21 04:24:17 2021 @@ -1,7 +1,10 @@ -# $NetBSD: moderrs.mk,v 1.27 2021/02/23 16:04:16 rillig Exp $ +# $NetBSD: moderrs.mk,v 1.28 2021/06/21 04:24:17 sjg Exp $ # # various modifier error tests +# report unmatched subexpressions +.MAKEFLAGS: -dL + '= '\'' VAR= TheVariable # in case we have to change it ;-)
CVS commit: src/share/man/man4
Module Name:src Committed By: yamaguchi Date: Mon Jun 21 06:36:28 UTC 2021 Modified Files: src/share/man/man4: lagg.4 Log Message: lagg: fix typo To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/lagg.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/lagg.4 diff -u src/share/man/man4/lagg.4:1.1 src/share/man/man4/lagg.4:1.2 --- src/share/man/man4/lagg.4:1.1 Mon May 17 04:07:42 2021 +++ src/share/man/man4/lagg.4 Mon Jun 21 06:36:28 2021 @@ -1,5 +1,5 @@ -.\" $NetBSD: lagg.4,v 1.1 2021/05/17 04:07:42 yamaguchi Exp $ +.\" $NetBSD: lagg.4,v 1.2 2021/06/21 06:36:28 yamaguchi Exp $ .\" .\" Copyright (c) 2005, 2006 Reyk Floeter .\" @@ -136,7 +136,7 @@ The maximum number of active ports in a .Ic lagglacp Nm maxports Ar N option. .It Ic none -THis protocol is intended to do nothing: it disables any traffic without +This protocol is intended to do nothing: it disables any traffic without disabling the .Nm interface itself.