Source-Changes-HG archive

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

[src/trunk]: src fixes for GCC 6.4:



details:   https://anonhg.NetBSD.org/src/rev/c024e0f9fb4a
branches:  trunk
changeset: 829497:c024e0f9fb4a
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Feb 04 09:01:12 2018 +0000

description:
fixes for GCC 6.4:

mail's execute() needs a volatile for setjmp().

telnet has a missing {} issue.

isdnd's print_config() has a missing/wrong {} issue, and
its p_q931bc() has inconsistent indentation (but not any
actual problem.)

map-mbone's accept_neighbors2() compares a vs. a instead
of a vs. b.

sysinst's pm_cgd_check() has missing {} issue.

timed's main() has missing {} issue.

diffstat:

 usr.bin/mail/lex.c                  |   6 +-
 usr.bin/telnet/sys_bsd.c            |   7 ++-
 usr.sbin/isdn/isdnd/rc_config.c     |  28 ++++++++--------
 usr.sbin/isdn/isdntrace/q931_util.c |  58 ++++++++++++++++++------------------
 usr.sbin/map-mbone/mapper.c         |   4 +-
 usr.sbin/sysinst/partman.c          |   5 +-
 usr.sbin/timed/timed/timed.c        |   7 ++-
 7 files changed, 59 insertions(+), 56 deletions(-)

diffs (261 lines):

diff -r 1a64a20d4461 -r c024e0f9fb4a usr.bin/mail/lex.c
--- a/usr.bin/mail/lex.c        Sun Feb 04 09:00:51 2018 +0000
+++ b/usr.bin/mail/lex.c        Sun Feb 04 09:01:12 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lex.c,v 1.44 2017/11/09 20:27:50 christos Exp $        */
+/*     $NetBSD: lex.c,v 1.45 2018/02/04 09:01:12 mrg Exp $     */
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)lex.c      8.2 (Berkeley) 4/20/95";
 #else
-__RCSID("$NetBSD: lex.c,v 1.44 2017/11/09 20:27:50 christos Exp $");
+__RCSID("$NetBSD: lex.c,v 1.45 2018/02/04 09:01:12 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -627,7 +627,7 @@
        char *volatile cp;
        int retval;
        int c;
-       int e = 1;
+       volatile int e = 1;
 
        /*
         * Strip the white space away from the beginning
diff -r 1a64a20d4461 -r c024e0f9fb4a usr.bin/telnet/sys_bsd.c
--- a/usr.bin/telnet/sys_bsd.c  Sun Feb 04 09:00:51 2018 +0000
+++ b/usr.bin/telnet/sys_bsd.c  Sun Feb 04 09:01:12 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_bsd.c,v 1.33 2012/01/09 16:08:55 christos Exp $    */
+/*     $NetBSD: sys_bsd.c,v 1.34 2018/02/04 09:01:12 mrg Exp $ */
 
 /*
  * Copyright (c) 1988, 1990, 1993
@@ -34,7 +34,7 @@
 #if 0
 from: static char sccsid[] = "@(#)sys_bsd.c    8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: sys_bsd.c,v 1.33 2012/01/09 16:08:55 christos Exp $");
+__RCSID("$NetBSD: sys_bsd.c,v 1.34 2018/02/04 09:01:12 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -468,11 +468,12 @@
 
     out = cfgetospeed(&old_tc);
     in = cfgetispeed(&old_tc);
-    if (in == 0)
+    if (in == 0) {
        in = out;
 
        *ispeed = in;
        *ospeed = out;
+    }
 }
 
 int
diff -r 1a64a20d4461 -r c024e0f9fb4a usr.sbin/isdn/isdnd/rc_config.c
--- a/usr.sbin/isdn/isdnd/rc_config.c   Sun Feb 04 09:00:51 2018 +0000
+++ b/usr.sbin/isdn/isdnd/rc_config.c   Sun Feb 04 09:01:12 2018 +0000
@@ -27,7 +27,7 @@
  *     i4b daemon - config file processing
  *     -----------------------------------
  *
- *     $Id: rc_config.c,v 1.26 2012/03/01 22:31:48 joerg Exp $ 
+ *     $Id: rc_config.c,v 1.27 2018/02/04 09:01:12 mrg Exp $ 
  *
  * $FreeBSD$
  *
@@ -1564,20 +1564,19 @@
                        for (j = 0; j < cep->remote_numbers_count; j++)
                                fprintf(PFILE, "remote-phone-dialout  = %s\t\t# telephone number %d for dialing out to remote\n", cep->remote_numbers[j].number, j+1);
 
-                               fprintf(PFILE, "remdial-handling      = ");
+                       fprintf(PFILE, "remdial-handling      = ");
        
-                               switch (cep->remote_numbers_handling)
-                               {
-                               case RNH_NEXT:
-                                       fprintf(PFILE, "next\t\t# use next number after last successful for new dial\n");
-                                       break;
-                               case RNH_LAST:
-                                       fprintf(PFILE, "last\t\t# use last successful number for new dial\n");
-                                       break;
-                               case RNH_FIRST:
-                                       fprintf(PFILE, "first\t\t# always start with first number for new dial\n");
-                                       break;
-                               }
+                       switch (cep->remote_numbers_handling)
+                       {
+                       case RNH_NEXT:
+                               fprintf(PFILE, "next\t\t# use next number after last successful for new dial\n");
+                               break;
+                       case RNH_LAST:
+                               fprintf(PFILE, "last\t\t# use last successful number for new dial\n");
+                               break;
+                       case RNH_FIRST:
+                               fprintf(PFILE, "first\t\t# always start with first number for new dial\n");
+                               break;
                        }
 
                        if (cep->local_phone_dialout[0])
@@ -1752,6 +1751,7 @@
                                        fprintf(PFILE, "downtime              = %d\t\t# time device is switched off\n", cep->downtime);
                                }
                        }
+               }
        }
        fprintf(PFILE, "\n");   
 }
diff -r 1a64a20d4461 -r c024e0f9fb4a usr.sbin/isdn/isdntrace/q931_util.c
--- a/usr.sbin/isdn/isdntrace/q931_util.c       Sun Feb 04 09:00:51 2018 +0000
+++ b/usr.sbin/isdn/isdntrace/q931_util.c       Sun Feb 04 09:01:12 2018 +0000
@@ -27,7 +27,7 @@
  *     q931_util.c - utility functions to print Q.931 traces
  *     -----------------------------------------------------
  *
- *     $Id: q931_util.c,v 1.3 2003/10/06 09:43:28 itojun Exp $ 
+ *     $Id: q931_util.c,v 1.4 2018/02/04 09:01:12 mrg Exp $ 
  *
  * $FreeBSD$
  *
@@ -405,38 +405,38 @@
        if (!len)
                goto exit;
 
-               switch (buf[i] & 0x7f)
-               {
-                       case 0x42:
-                               sprintf((pbuf+strlen(pbuf)), "\n          layer2=Q.921/I.441");
-                               break;
-                       case 0x46:
-                               sprintf((pbuf+strlen(pbuf)), "\n          layer2=X.25 link");
-                               break;
-                       default:
-                               sprintf((pbuf+strlen(pbuf)), "\n          layer2=0x%02x",(buf[i] & 0x7f));
-                               break;
-               }
-               i++;
-               len--;
+       switch (buf[i] & 0x7f)
+       {
+               case 0x42:
+                       sprintf((pbuf+strlen(pbuf)), "\n          layer2=Q.921/I.441");
+                       break;
+               case 0x46:
+                       sprintf((pbuf+strlen(pbuf)), "\n          layer2=X.25 link");
+                       break;
+               default:
+                       sprintf((pbuf+strlen(pbuf)), "\n          layer2=0x%02x",(buf[i] & 0x7f));
+                       break;
+       }
+       i++;
+       len--;
 
        if (!len)
                goto exit;
        
-               switch (buf[i] & 0x7f)
-               {
-                       case 0x62:
-                               sprintf((pbuf+strlen(pbuf)), "\n          layer3=Q.921/I.441");
-                               break;
-                       case 0x66:
-                               sprintf((pbuf+strlen(pbuf)), "\n          layer3=X.25 packet");
-                               break;
-                       default:
-                               sprintf((pbuf+strlen(pbuf)), "\n          layer3=0x%02x",(buf[i] & 0x7f));
-                               break;
-               }
-               i++;
-               len--;
+       switch (buf[i] & 0x7f)
+       {
+               case 0x62:
+                       sprintf((pbuf+strlen(pbuf)), "\n          layer3=Q.921/I.441");
+                       break;
+               case 0x66:
+                       sprintf((pbuf+strlen(pbuf)), "\n          layer3=X.25 packet");
+                       break;
+               default:
+                       sprintf((pbuf+strlen(pbuf)), "\n          layer3=0x%02x",(buf[i] & 0x7f));
+                       break;
+       }
+       i++;
+       len--;
 
 exit:  
        sprintf((pbuf+strlen(pbuf)), "]");      
diff -r 1a64a20d4461 -r c024e0f9fb4a usr.sbin/map-mbone/mapper.c
--- a/usr.sbin/map-mbone/mapper.c       Sun Feb 04 09:00:51 2018 +0000
+++ b/usr.sbin/map-mbone/mapper.c       Sun Feb 04 09:01:12 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mapper.c,v 1.26 2018/01/23 23:02:40 sevan Exp $        */
+/*     $NetBSD: mapper.c,v 1.27 2018/02/04 09:01:13 mrg Exp $  */
 
 /* Mapper for connections between MRouteD multicast routers.
  * Written by Pavel Curtis <Pavel%PARC.Xerox.Com@localhost>
@@ -495,7 +495,7 @@
                    for (nb_n = old_neighbors; nb_n; nb_n = nb_n->next)
                        if (nb_i->addr == nb_n->addr) {
                            if (nb_i->metric != nb_n->metric
-                               || nb_i->threshold != nb_i->threshold)
+                               || nb_i->threshold != nb_n->threshold)
                                logit(LOG_WARNING, 0,
                                    "inconsistent %s for neighbor %s of %s",
                                    "metric/threshold",
diff -r 1a64a20d4461 -r c024e0f9fb4a usr.sbin/sysinst/partman.c
--- a/usr.sbin/sysinst/partman.c        Sun Feb 04 09:00:51 2018 +0000
+++ b/usr.sbin/sysinst/partman.c        Sun Feb 04 09:01:12 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: partman.c,v 1.17 2018/01/29 16:24:23 martin Exp $ */
+/*     $NetBSD: partman.c,v 1.18 2018/02/04 09:01:13 mrg Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -1099,10 +1099,11 @@
                return 0;
        if (dev_ptr->pm == NULL)
                dev_ptr->enabled = 0;
-       else
+       else {
                pm_manage_getfreenode(&(dev_ptr->node), "cgd", &cgds_t_info);
                if (dev_ptr->node < 0)
                        dev_ptr->enabled = 0;
+       }
        return dev_ptr->enabled;
 }
 
diff -r 1a64a20d4461 -r c024e0f9fb4a usr.sbin/timed/timed/timed.c
--- a/usr.sbin/timed/timed/timed.c      Sun Feb 04 09:00:51 2018 +0000
+++ b/usr.sbin/timed/timed/timed.c      Sun Feb 04 09:01:12 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: timed.c,v 1.25 2015/06/16 23:04:14 christos Exp $      */
+/*     $NetBSD: timed.c,v 1.26 2018/02/04 09:01:13 mrg Exp $   */
 
 /*-
  * Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)timed.c    8.2 (Berkeley) 3/26/95";
 #else
-__RCSID("$NetBSD: timed.c,v 1.25 2015/06/16 23:04:14 christos Exp $");
+__RCSID("$NetBSD: timed.c,v 1.26 2018/02/04 09:01:13 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -405,9 +405,10 @@
                        justquit = 1;
                }
                for (ntp = nettab; ntp != NULL; ntp = ntp->next) {
-                       if (ntp->status == MASTER)
+                       if (ntp->status == MASTER) {
                                rmnetmachs(ntp);
                                ntp->status = NOMASTER;
+                       }
                }
                checkignorednets();
                pickslavenet(0);



Home | Main Index | Thread Index | Old Index