Module Name: src Committed By: mrg Date: Sun Feb 4 09:15:45 UTC 2018
Modified Files: src/external/bsd/am-utils/dist/amd: amfs_program.c src/external/bsd/flex/dist/src: main.c src/external/bsd/ntp/dist/ntpd: refclock_oncore.c src/external/bsd/ntp/dist/sntp/libopts: nested.c src/external/bsd/nvi/dist/cl: cl_funcs.c src/external/bsd/nvi/dist/vi: vs_refresh.c Log Message: fix GCC 6.4 issues (finally a couple that aren't actual bugs, but only weird code?): amd's amfs_program_exec() has a missing {} issue. flex's check_options() has odd inconsistent identation that trips the new ident checker. ntpd's oncore_check_leap_sec() and oncore_set_traim() have missing {} issues. sntp's optionLoadNested() an identation weirdness that trips the new ident checker. vi's cl_attr() has a wrong {} issue, and its vs_paint() has an identation weirdness that trips the new ident checker. To generate a diff of this commit: cvs rdiff -u -r1.1.1.3 -r1.2 \ src/external/bsd/am-utils/dist/amd/amfs_program.c cvs rdiff -u -r1.6 -r1.7 src/external/bsd/flex/dist/src/main.c cvs rdiff -u -r1.14 -r1.15 src/external/bsd/ntp/dist/ntpd/refclock_oncore.c cvs rdiff -u -r1.10 -r1.11 src/external/bsd/ntp/dist/sntp/libopts/nested.c cvs rdiff -u -r1.7 -r1.8 src/external/bsd/nvi/dist/cl/cl_funcs.c cvs rdiff -u -r1.8 -r1.9 src/external/bsd/nvi/dist/vi/vs_refresh.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/am-utils/dist/amd/amfs_program.c diff -u src/external/bsd/am-utils/dist/amd/amfs_program.c:1.1.1.3 src/external/bsd/am-utils/dist/amd/amfs_program.c:1.2 --- src/external/bsd/am-utils/dist/amd/amfs_program.c:1.1.1.3 Sat Jan 17 16:34:15 2015 +++ src/external/bsd/am-utils/dist/amd/amfs_program.c Sun Feb 4 09:15:44 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: amfs_program.c,v 1.1.1.3 2015/01/17 16:34:15 christos Exp $ */ +/* $NetBSD: amfs_program.c,v 1.2 2018/02/04 09:15:44 mrg Exp $ */ /* * Copyright (c) 1997-2014 Erez Zadok @@ -144,10 +144,11 @@ amfs_program_exec(char *info) * Put stdout to stderr */ (void) fclose(stdout); - if (!logfp) + if (!logfp) { logfp = stderr; /* initialize before possible first use */ if (dup(fileno(logfp)) == -1) goto out; + } if (fileno(logfp) != fileno(stderr)) { (void) fclose(stderr); if (dup(fileno(logfp)) == -1) Index: src/external/bsd/flex/dist/src/main.c diff -u src/external/bsd/flex/dist/src/main.c:1.6 src/external/bsd/flex/dist/src/main.c:1.7 --- src/external/bsd/flex/dist/src/main.c:1.6 Tue Jan 3 01:56:03 2017 +++ src/external/bsd/flex/dist/src/main.c Sun Feb 4 09:15:45 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.6 2017/01/03 01:56:03 christos Exp $ */ +/* $NetBSD: main.c,v 1.7 2018/02/04 09:15:45 mrg Exp $ */ /* flex - tool to generate fast lexical analyzers */ @@ -33,7 +33,7 @@ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ /* PURPOSE. */ #include "flexdef.h" -__RCSID("$NetBSD: main.c,v 1.6 2017/01/03 01:56:03 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.7 2018/02/04 09:15:45 mrg Exp $"); #include "version.h" @@ -313,8 +313,8 @@ void check_options (void) } } - if (extra_type) - buf_m4_define( &m4defs_buf, "M4_EXTRA_TYPE_DEFS", extra_type); + if (extra_type) + buf_m4_define( &m4defs_buf, "M4_EXTRA_TYPE_DEFS", extra_type); if (!use_stdout) { FILE *prev_stdout; @@ -497,12 +497,12 @@ void check_options (void) if (gen_line_dirs) outn("#line 0 \"M4_YY_OUTFILE_NAME\"\n"); - /* Dump the user defined preproc directives. */ - if (userdef_buf.elts) - outn ((char *) (userdef_buf.elts)); + /* Dump the user defined preproc directives. */ + if (userdef_buf.elts) + outn ((char *) (userdef_buf.elts)); - skelout (); - /* %% [1.0] */ + skelout (); + /* %% [1.0] */ } /* flexend - terminate flex Index: src/external/bsd/ntp/dist/ntpd/refclock_oncore.c diff -u src/external/bsd/ntp/dist/ntpd/refclock_oncore.c:1.14 src/external/bsd/ntp/dist/ntpd/refclock_oncore.c:1.15 --- src/external/bsd/ntp/dist/ntpd/refclock_oncore.c:1.14 Thu Apr 13 20:17:42 2017 +++ src/external/bsd/ntp/dist/ntpd/refclock_oncore.c Sun Feb 4 09:15:45 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: refclock_oncore.c,v 1.14 2017/04/13 20:17:42 christos Exp $ */ +/* $NetBSD: refclock_oncore.c,v 1.15 2018/02/04 09:15:45 mrg Exp $ */ /* * ---------------------------------------------------------------------------- @@ -3425,9 +3425,10 @@ oncore_check_leap_sec( instance->Bj_day = instance->BEHa[5]; if (instance->saw_Gj < 0) { /* -1 DONT have Gj use Bj */ - if ((instance->BEHa[4] == 6) || (instance->BEHa[4] == 12)) + if ((instance->BEHa[4] == 6) || (instance->BEHa[4] == 12)) { oncore_sendmsg(instance, oncore_cmd_Bj, sizeof(oncore_cmd_Bj)); oncore_sendmsg(instance, oncore_cmd_Bl, sizeof(oncore_cmd_Bl)); + } return; } @@ -3868,9 +3869,10 @@ oncore_set_traim( oncore_sendmsg(instance, oncore_cmd_Bnx, sizeof(oncore_cmd_Bnx)); else if (instance->chan == 8) oncore_sendmsg(instance, oncore_cmd_Enx, sizeof(oncore_cmd_Enx)); - else /* chan == 12 */ + else { /* chan == 12 */ oncore_sendmsg(instance, oncore_cmd_Ge0, sizeof(oncore_cmd_Ge0)); oncore_sendmsg(instance, oncore_cmd_Hn0, sizeof(oncore_cmd_Hn0)); + } } } Index: src/external/bsd/ntp/dist/sntp/libopts/nested.c diff -u src/external/bsd/ntp/dist/sntp/libopts/nested.c:1.10 src/external/bsd/ntp/dist/sntp/libopts/nested.c:1.11 --- src/external/bsd/ntp/dist/sntp/libopts/nested.c:1.10 Sun May 1 23:32:01 2016 +++ src/external/bsd/ntp/dist/sntp/libopts/nested.c Sun Feb 4 09:15:45 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: nested.c,v 1.10 2016/05/01 23:32:01 christos Exp $ */ +/* $NetBSD: nested.c,v 1.11 2018/02/04 09:15:45 mrg Exp $ */ /** @@ -788,7 +788,8 @@ optionLoadNested(char const * text, char case NUL: goto scan_done; case '<': text = scan_xml(text, res_val); if (text == NULL) goto woops; - if (*text == ',') text++; break; + if (*text == ',') text++; + break; case '#': text = strchr(text, NL); break; default: goto woops; } Index: src/external/bsd/nvi/dist/cl/cl_funcs.c diff -u src/external/bsd/nvi/dist/cl/cl_funcs.c:1.7 src/external/bsd/nvi/dist/cl/cl_funcs.c:1.8 --- src/external/bsd/nvi/dist/cl/cl_funcs.c:1.7 Mon Nov 13 01:51:47 2017 +++ src/external/bsd/nvi/dist/cl/cl_funcs.c Sun Feb 4 09:15:45 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cl_funcs.c,v 1.7 2017/11/13 01:51:47 rin Exp $ */ +/* $NetBSD: cl_funcs.c,v 1.8 2018/02/04 09:15:45 mrg Exp $ */ /*- * Copyright (c) 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -16,7 +16,7 @@ static const char sccsid[] = "Id: cl_funcs.c,v 10.72 2002/03/02 23:18:33 skimo Exp (Berkeley) Date: 2002/03/02 23:18:33 "; #endif /* not lint */ #else -__RCSID("$NetBSD: cl_funcs.c,v 1.7 2017/11/13 01:51:47 rin Exp $"); +__RCSID("$NetBSD: cl_funcs.c,v 1.8 2018/02/04 09:15:45 mrg Exp $"); #endif #include <sys/types.h> @@ -144,22 +144,20 @@ cl_attr(SCR *sp, scr_attr_t attribute, i * do this automatically -- so, this attribute isn't as controlled by * the higher level screen as closely as one might like. */ - if (on) { - if (clp->ti_te != TI_SENT) { - clp->ti_te = TI_SENT; - if (clp->smcup == NULL) - (void)cl_getcap(sp, "smcup", &clp->smcup); - if (clp->smcup != NULL) - (void)tputs(clp->smcup, 1, cl_putchar); - } - } else - if (clp->ti_te != TE_SENT) { + if (on) { + if (clp->ti_te != TI_SENT) { + clp->ti_te = TI_SENT; + if (clp->smcup == NULL) + (void)cl_getcap(sp, "smcup", &clp->smcup); + if (clp->smcup != NULL) + (void)tputs(clp->smcup, 1, cl_putchar); + } + } else if (clp->ti_te != TE_SENT) { clp->ti_te = TE_SENT; if (clp->rmcup == NULL) (void)cl_getcap(sp, "rmcup", &clp->rmcup); if (clp->rmcup != NULL) (void)tputs(clp->rmcup, 1, cl_putchar); - (void)fflush(stdout); } (void)fflush(stdout); break; Index: src/external/bsd/nvi/dist/vi/vs_refresh.c diff -u src/external/bsd/nvi/dist/vi/vs_refresh.c:1.8 src/external/bsd/nvi/dist/vi/vs_refresh.c:1.9 --- src/external/bsd/nvi/dist/vi/vs_refresh.c:1.8 Tue Nov 14 12:20:55 2017 +++ src/external/bsd/nvi/dist/vi/vs_refresh.c Sun Feb 4 09:15:45 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: vs_refresh.c,v 1.8 2017/11/14 12:20:55 rin Exp $ */ +/* $NetBSD: vs_refresh.c,v 1.9 2018/02/04 09:15:45 mrg Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -16,7 +16,7 @@ static const char sccsid[] = "Id: vs_refresh.c,v 10.50 2001/06/25 15:19:37 skimo Exp (Berkeley) Date: 2001/06/25 15:19:37 "; #endif /* not lint */ #else -__RCSID("$NetBSD: vs_refresh.c,v 1.8 2017/11/14 12:20:55 rin Exp $"); +__RCSID("$NetBSD: vs_refresh.c,v 1.9 2018/02/04 09:15:45 mrg Exp $"); #endif #include <sys/types.h> @@ -603,7 +603,8 @@ fast: (void)gp->scr_cursor(sp, &y, ¬u * * Walk through the map and find the current line. */ -slow: for (smp = HMAP; smp->lno != LNO; ++smp); +slow: for (smp = HMAP; smp->lno != LNO; ++smp) + ; /* * 7e: Leftright scrolling adjustment.