Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/vi appease gcc -Wuninitialized.
details: https://anonhg.NetBSD.org/src/rev/63b7b379da17
branches: trunk
changeset: 581489:63b7b379da17
user: lukem <lukem%NetBSD.org@localhost>
date: Thu Jun 02 04:25:16 2005 +0000
description:
appease gcc -Wuninitialized.
Each is marked with XXXGCC, because in some cases it looks like gcc
isn't correctly detecting that
for ( ; xxx ; yyy)
foo = 0;
always sets foo ...
diffstat:
usr.bin/vi/common/cut.c | 5 +++--
usr.bin/vi/common/options.c | 5 +++--
usr.bin/vi/common/recover.c | 5 +++--
usr.bin/vi/ex/ex_cscope.c | 7 +++++--
usr.bin/vi/ex/ex_join.c | 6 ++++--
usr.bin/vi/ex/ex_read.c | 7 +++++--
usr.bin/vi/ex/ex_script.c | 6 ++++--
usr.bin/vi/ex/ex_tag.c | 10 ++++++++--
usr.bin/vi/ex/ex_write.c | 5 +++--
usr.bin/vi/vi/v_txt.c | 5 +++--
usr.bin/vi/vi/vs_line.c | 7 +++++--
usr.bin/vi/vi/vs_refresh.c | 6 ++++--
usr.bin/vi/vi/vs_relative.c | 8 ++++++--
usr.bin/vi/vi/vs_split.c | 6 ++++--
14 files changed, 60 insertions(+), 28 deletions(-)
diffs (truncated from 410 to 300 lines):
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/common/cut.c
--- a/usr.bin/vi/common/cut.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/common/cut.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cut.c,v 1.6 2002/04/09 01:47:31 thorpej Exp $ */
+/* $NetBSD: cut.c,v 1.7 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -16,7 +16,7 @@
#if 0
static const char sccsid[] = "@(#)cut.c 10.10 (Berkeley) 9/15/96";
#else
-__RCSID("$NetBSD: cut.c,v 1.6 2002/04/09 01:47:31 thorpej Exp $");
+__RCSID("$NetBSD: cut.c,v 1.7 2005/06/02 04:25:16 lukem Exp $");
#endif
#endif /* not lint */
@@ -104,6 +104,7 @@
*
* Otherwise, put it in the unnamed buffer.
*/
+ name = 0; /* XXXGCC -Wuninitialized */
append = copy_one = copy_def = 0;
if (namep != NULL) {
name = *namep;
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/common/options.c
--- a/usr.bin/vi/common/options.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/common/options.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: options.c,v 1.11 2004/11/05 19:50:12 dsl Exp $ */
+/* $NetBSD: options.c,v 1.12 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -16,7 +16,7 @@
#if 0
static const char sccsid[] = "@(#)options.c 10.51 (Berkeley) 10/14/96";
#else
-__RCSID("$NetBSD: options.c,v 1.11 2004/11/05 19:50:12 dsl Exp $");
+__RCSID("$NetBSD: options.c,v 1.12 2005/06/02 04:25:16 lukem Exp $");
#endif
#endif /* not lint */
@@ -322,6 +322,7 @@
a.len = b.len = 0;
argv[0] = &a;
argv[1] = &b;
+ optindx = 0; /* XXXGCC -Wuninitialized */
/* Set numeric and string default values. */
#define OI(indx, str) { \
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/common/recover.c
--- a/usr.bin/vi/common/recover.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/common/recover.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: recover.c,v 1.10 2005/06/02 04:03:03 lukem Exp $ */
+/* $NetBSD: recover.c,v 1.11 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -16,7 +16,7 @@
#if 0
static const char sccsid[] = "@(#)recover.c 10.21 (Berkeley) 9/15/96";
#else
-__RCSID("$NetBSD: recover.c,v 1.10 2005/06/02 04:03:03 lukem Exp $");
+__RCSID("$NetBSD: recover.c,v 1.11 2005/06/02 04:25:16 lukem Exp $");
#endif
#endif /* not lint */
@@ -620,6 +620,7 @@
return (1);
}
+ locked = 0; /* XXXGCC -Wuninitialized */
name = frp->name;
sv_fd = -1;
rec_mtime = 0;
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/ex/ex_cscope.c
--- a/usr.bin/vi/ex/ex_cscope.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/ex/ex_cscope.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_cscope.c,v 1.9 2005/02/12 12:53:23 aymeric Exp $ */
+/* $NetBSD: ex_cscope.c,v 1.10 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1994, 1996
@@ -16,7 +16,7 @@
#if 0
static const char sccsid[] = "@(#)ex_cscope.c 10.13 (Berkeley) 9/15/96";
#else
-__RCSID("$NetBSD: ex_cscope.c,v 1.9 2005/02/12 12:53:23 aymeric Exp $");
+__RCSID("$NetBSD: ex_cscope.c,v 1.10 2005/06/02 04:25:16 lukem Exp $");
#endif
#endif /* not lint */
@@ -698,6 +698,9 @@
}
*p = '\0';
+ slno = 0; /* XXXGCC -Wuninitialized */
+ name = NULL; /* XXXGCC -Wuninitialized */
+ nlen = 0; /* XXXGCC -Wuninitialized */
/*
* The cscope output is in the following format:
*
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/ex/ex_join.c
--- a/usr.bin/vi/ex/ex_join.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/ex/ex_join.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_join.c,v 1.10 2005/02/12 12:53:23 aymeric Exp $ */
+/* $NetBSD: ex_join.c,v 1.11 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -16,7 +16,7 @@
#if 0
static const char sccsid[] = "@(#)ex_join.c 10.10 (Berkeley) 9/15/96";
#else
-__RCSID("$NetBSD: ex_join.c,v 1.10 2005/02/12 12:53:23 aymeric Exp $");
+__RCSID("$NetBSD: ex_join.c,v 1.11 2005/06/02 04:25:16 lukem Exp $");
#endif
#endif /* not lint */
@@ -75,6 +75,8 @@
if (cmdp->addr1.lno == cmdp->addr2.lno)
++cmdp->addr2.lno;
+ echar = '\0'; /* XXXGCC -Wuninitialized */
+ tbp = NULL; /* XXXGCC -Wuninitialized */
clen = tlen = 0;
for (first = 1,
from = cmdp->addr1.lno, to = cmdp->addr2.lno; from <= to; ++from) {
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/ex/ex_read.c
--- a/usr.bin/vi/ex/ex_read.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/ex/ex_read.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_read.c,v 1.12 2005/02/12 12:53:23 aymeric Exp $ */
+/* $NetBSD: ex_read.c,v 1.13 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -16,7 +16,7 @@
#if 0
static const char sccsid[] = "@(#)ex_read.c 10.38 (Berkeley) 8/12/96";
#else
-__RCSID("$NetBSD: ex_read.c,v 1.12 2005/02/12 12:53:23 aymeric Exp $");
+__RCSID("$NetBSD: ex_read.c,v 1.13 2005/06/02 04:25:16 lukem Exp $");
#endif
#endif /* not lint */
@@ -65,6 +65,9 @@
char *p;
gp = sp->gp;
+ arg = NULL; /* XXXGCC -Wuninitialized */
+ arglen = 0; /* XXXGCC -Wuninitialized */
+ name = NULL; /* XXXGCC -Wuninitialized */
/*
* 0 args: read the current pathname.
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/ex/ex_script.c
--- a/usr.bin/vi/ex/ex_script.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/ex/ex_script.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_script.c,v 1.10 2005/02/12 12:53:23 aymeric Exp $ */
+/* $NetBSD: ex_script.c,v 1.11 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -19,7 +19,7 @@
#if 0
static const char sccsid[] = "@(#)ex_script.c 10.30 (Berkeley) 9/24/96";
#else
-__RCSID("$NetBSD: ex_script.c,v 1.10 2005/02/12 12:53:23 aymeric Exp $");
+__RCSID("$NetBSD: ex_script.c,v 1.11 2005/06/02 04:25:16 lukem Exp $");
#endif
#endif /* not lint */
@@ -316,6 +316,7 @@
int isempty, matchprompt, nw, rval;
char *bp, *p;
+ bp = NULL; /* XXXGCC -Wuninitialized */
/* If there's a prompt on the last line, append the command. */
if (db_last(sp, &last_lno))
return (1);
@@ -439,6 +440,7 @@
int nr, rval;
char *bp;
+ len = 0; /* XXXGCC -Wuninitialized */
/* Find out where the end of the file is. */
if (db_last(sp, &lno))
return (1);
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/ex/ex_tag.c
--- a/usr.bin/vi/ex/ex_tag.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/ex/ex_tag.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_tag.c,v 1.17 2005/06/02 03:51:14 lukem Exp $ */
+/* $NetBSD: ex_tag.c,v 1.18 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -19,7 +19,7 @@
#if 0
static const char sccsid[] = "@(#)ex_tag.c 10.36 (Berkeley) 9/15/96";
#else
-__RCSID("$NetBSD: ex_tag.c,v 1.17 2005/06/02 03:51:14 lukem Exp $");
+__RCSID("$NetBSD: ex_tag.c,v 1.18 2005/06/02 04:25:16 lukem Exp $");
#endif
#endif /* not lint */
@@ -455,6 +455,8 @@
return (1);
}
+ dtqp = NULL; /* XXXGCC -Wuninitialized */
+
/* Find the last TAG structure that we're going to DISCARD! */
switch (cmdp->argc) {
case 0: /* Pop one tag. */
@@ -1280,6 +1282,10 @@
p = front;
front = t;
+ nlen = 0; /* XXXGCC -Wuninitialized */
+ cname = NULL; /* XXXGCC -Wuninitialized */
+ name = NULL; /* XXXGCC -Wuninitialized */
+
/* Break the line into tokens. */
for (i = 0; i < 2 && (t = strsep(&p, "\t ")) != NULL; ++i)
switch (i) {
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/ex/ex_write.c
--- a/usr.bin/vi/ex/ex_write.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/ex/ex_write.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_write.c,v 1.10 2005/02/12 12:53:23 aymeric Exp $ */
+/* $NetBSD: ex_write.c,v 1.11 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -16,7 +16,7 @@
#if 0
static const char sccsid[] = "@(#)ex_write.c 10.30 (Berkeley) 7/12/96";
#else
-__RCSID("$NetBSD: ex_write.c,v 1.10 2005/02/12 12:53:23 aymeric Exp $");
+__RCSID("$NetBSD: ex_write.c,v 1.11 2005/06/02 04:25:16 lukem Exp $");
#endif
#endif /* not lint */
@@ -147,6 +147,7 @@
int flags;
char *name, *p;
+ p = NULL; /* XXXGCC -Wuninitialized */
NEEDFILE(sp, cmdp);
/* All write commands can have an associated '!'. */
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/vi/v_txt.c
--- a/usr.bin/vi/vi/v_txt.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/vi/v_txt.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: v_txt.c,v 1.12 2004/11/23 14:35:45 aymeric Exp $ */
+/* $NetBSD: v_txt.c,v 1.13 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -16,7 +16,7 @@
#if 0
static const char sccsid[] = "@(#)v_txt.c 10.87 (Berkeley) 10/13/96";
#else
-__RCSID("$NetBSD: v_txt.c,v 1.12 2004/11/23 14:35:45 aymeric Exp $");
+__RCSID("$NetBSD: v_txt.c,v 1.13 2005/06/02 04:25:16 lukem Exp $");
#endif
#endif /* not lint */
@@ -292,6 +292,7 @@
gp = sp->gp;
vip = VIP(sp);
+ evp = NULL; /* XXXGCC -Wuninitialized */
/*
* Set the input flag, so tabs get displayed correctly
diff -r 8a72c566682a -r 63b7b379da17 usr.bin/vi/vi/vs_line.c
--- a/usr.bin/vi/vi/vs_line.c Thu Jun 02 04:03:03 2005 +0000
+++ b/usr.bin/vi/vi/vs_line.c Thu Jun 02 04:25:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vs_line.c,v 1.7 2002/04/09 01:47:36 thorpej Exp $ */
+/* $NetBSD: vs_line.c,v 1.8 2005/06/02 04:25:16 lukem Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -16,7 +16,7 @@
#if 0
static const char sccsid[] = "@(#)vs_line.c 10.19 (Berkeley) 9/26/96";
#else
-__RCSID("$NetBSD: vs_line.c,v 1.7 2002/04/09 01:47:36 thorpej Exp $");
+__RCSID("$NetBSD: vs_line.c,v 1.8 2005/06/02 04:25:16 lukem Exp $");
Home |
Main Index |
Thread Index |
Old Index