Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd fix GCC 6.4 issues (finally a couple that aren'...



details:   https://anonhg.NetBSD.org/src/rev/0eac852b642d
branches:  trunk
changeset: 829499:0eac852b642d
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Feb 04 09:15:44 2018 +0000

description:
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.

diffstat:

 external/bsd/am-utils/dist/amd/amfs_program.c |   5 +++--
 external/bsd/flex/dist/src/main.c             |  18 +++++++++---------
 external/bsd/ntp/dist/ntpd/refclock_oncore.c  |   8 +++++---
 external/bsd/ntp/dist/sntp/libopts/nested.c   |   5 +++--
 external/bsd/nvi/dist/cl/cl_funcs.c           |  24 +++++++++++-------------
 external/bsd/nvi/dist/vi/vs_refresh.c         |   7 ++++---
 6 files changed, 35 insertions(+), 32 deletions(-)

diffs (199 lines):

diff -r f2283e9557ec -r 0eac852b642d external/bsd/am-utils/dist/amd/amfs_program.c
--- a/external/bsd/am-utils/dist/amd/amfs_program.c     Sun Feb 04 09:03:23 2018 +0000
+++ b/external/bsd/am-utils/dist/amd/amfs_program.c     Sun Feb 04 09:15:44 2018 +0000
@@ -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 @@
    * 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)
diff -r f2283e9557ec -r 0eac852b642d external/bsd/flex/dist/src/main.c
--- a/external/bsd/flex/dist/src/main.c Sun Feb 04 09:03:23 2018 +0000
+++ b/external/bsd/flex/dist/src/main.c Sun Feb 04 09:15:44 2018 +0000
@@ -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 @@
                }
        }
 
-    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 @@
     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
diff -r f2283e9557ec -r 0eac852b642d external/bsd/ntp/dist/ntpd/refclock_oncore.c
--- a/external/bsd/ntp/dist/ntpd/refclock_oncore.c      Sun Feb 04 09:03:23 2018 +0000
+++ b/external/bsd/ntp/dist/ntpd/refclock_oncore.c      Sun Feb 04 09:15:44 2018 +0000
@@ -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 @@
                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_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));
+               }
        }
 }
 
diff -r f2283e9557ec -r 0eac852b642d external/bsd/ntp/dist/sntp/libopts/nested.c
--- a/external/bsd/ntp/dist/sntp/libopts/nested.c       Sun Feb 04 09:03:23 2018 +0000
+++ b/external/bsd/ntp/dist/sntp/libopts/nested.c       Sun Feb 04 09:15:44 2018 +0000
@@ -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 @@
         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;
         }
diff -r f2283e9557ec -r 0eac852b642d external/bsd/nvi/dist/cl/cl_funcs.c
--- a/external/bsd/nvi/dist/cl/cl_funcs.c       Sun Feb 04 09:03:23 2018 +0000
+++ b/external/bsd/nvi/dist/cl/cl_funcs.c       Sun Feb 04 09:15:44 2018 +0000
@@ -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 @@
         * 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;
diff -r f2283e9557ec -r 0eac852b642d external/bsd/nvi/dist/vi/vs_refresh.c
--- a/external/bsd/nvi/dist/vi/vs_refresh.c     Sun Feb 04 09:03:23 2018 +0000
+++ b/external/bsd/nvi/dist/vi/vs_refresh.c     Sun Feb 04 09:15:44 2018 +0000
@@ -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 @@
         *
         * 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.



Home | Main Index | Thread Index | Old Index