Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/mtree avoid non-constant initializer errors by chan...



details:   https://anonhg.NetBSD.org/src/rev/b215ce771258
branches:  trunk
changeset: 539900:b215ce771258
user:      grant <grant%NetBSD.org@localhost>
date:      Fri Nov 29 02:07:34 2002 +0000

description:
avoid non-constant initializer errors by changing hack to workaround
gcc warning to a slightly different hack.

diffstat:

 usr.sbin/mtree/create.c |  10 ++++++----
 usr.sbin/mtree/verify.c |  10 ++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)

diffs (62 lines):

diff -r 468f7cedd510 -r b215ce771258 usr.sbin/mtree/create.c
--- a/usr.sbin/mtree/create.c   Fri Nov 29 01:34:55 2002 +0000
+++ b/usr.sbin/mtree/create.c   Fri Nov 29 02:07:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: create.c,v 1.40 2002/08/08 13:24:15 soren Exp $        */
+/*     $NetBSD: create.c,v 1.41 2002/11/29 02:07:34 grant Exp $        */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)create.c   8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: create.c,v 1.40 2002/08/08 13:24:15 soren Exp $");
+__RCSID("$NetBSD: create.c,v 1.41 2002/11/29 02:07:34 grant Exp $");
 #endif
 #endif /* not lint */
 
@@ -96,8 +96,10 @@
        FTSENT *p;
        time_t clocktime;
        char host[MAXHOSTNAMELEN + 1];
-       char  dot[] = ".";              /* XXX: work around gcc warning */
-       char *argv[] = { dot, NULL };
+       char *argv[2];
+       char  dot[] = ".";
+       argv[0] = dot;
+       argv[1] = NULL;
 
        time(&clocktime);
        gethostname(host, sizeof(host));
diff -r 468f7cedd510 -r b215ce771258 usr.sbin/mtree/verify.c
--- a/usr.sbin/mtree/verify.c   Fri Nov 29 01:34:55 2002 +0000
+++ b/usr.sbin/mtree/verify.c   Fri Nov 29 02:07:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: verify.c,v 1.32 2002/10/08 00:34:08 lukem Exp $        */
+/*     $NetBSD: verify.c,v 1.33 2002/11/29 02:07:34 grant Exp $        */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)verify.c   8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: verify.c,v 1.32 2002/10/08 00:34:08 lukem Exp $");
+__RCSID("$NetBSD: verify.c,v 1.33 2002/11/29 02:07:34 grant Exp $");
 #endif
 #endif /* not lint */
 
@@ -81,8 +81,10 @@
        FTSENT *p;
        NODE *ep, *level;
        int specdepth, rval;
-       char  dot[] = ".";              /* XXX: work around gcc warning */
-       char *argv[] = { dot, NULL };
+       char *argv[2];
+       char  dot[] = ".";
+       argv[0] = dot;
+       argv[1] = NULL;
 
        if ((t = fts_open(argv, ftsoptions, NULL)) == NULL)
                mtree_err("fts_open: %s", strerror(errno));



Home | Main Index | Thread Index | Old Index