Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: shut up, gcc



Some `... may be used uninitialized' warnings again (none of them was
really a problem). And then I forgot to remove a function in
computil.c when the stuff was moved to zutil.

Bye
 Sven

diff -ru ../z.old/Src/Zle/compresult.c Src/Zle/compresult.c
--- ../z.old/Src/Zle/compresult.c	Thu Dec 16 09:28:47 1999
+++ Src/Zle/compresult.c	Thu Dec 16 09:42:56 1999
@@ -135,8 +135,9 @@
 
     l = cut_cline(l);
 
-    pmm = smm = dm = 0;
+    pmm = smm = dm = pcs = scs = 0;
     pm = pmax = sm = smax = d = mid = cbr = -1;
+    brp = brs = NULL;
 
     /* Get the information about the brace beginning and end we have
      * to re-insert. */
diff -ru ../z.old/Src/Zle/computil.c Src/Zle/computil.c
--- ../z.old/Src/Zle/computil.c	Thu Dec 16 09:28:47 1999
+++ Src/Zle/computil.c	Thu Dec 16 09:42:57 1999
@@ -66,42 +66,6 @@
     }
 }
 
-/* Build and return the array with the description-aligned strings. */
-
-static char **
-cdisp_build(Cdisp disp, char *sep, char **args)
-{
-    int sl = strlen(sep), pre = disp->pre, suf;
-    VARARR(char, buf, disp->pre + disp->suf + sl + 1);
-    char **ret, **rp, *cp, *copy, *cpp, oldc;
-
-    ret = (char **) zalloc((arrlen(args) + 1) * sizeof(char *));
-
-    memcpy(buf + pre, sep, sl);
-    suf = pre + sl;
-
-    for (rp = ret; *args; args++) {
-	copy = dupstring(*args);
-	for (cp = cpp = copy; *cp && *cp != ':'; cp++) {
-	    if (*cp == '\\' && cp[1])
-		cp++;
-	    *cpp++ = *cp;
-	}
-	oldc = *cpp;
-	*cpp = '\0';
-	if (((cpp == cp && oldc == ':') || *cp == ':') && cp[1]) {
-	    memset(buf, ' ', pre);
-	    memcpy(buf, copy, (cpp - copy));
-	    strcpy(buf + suf, cp + 1);
-	    *rp++ = ztrdup(buf);
-	} else
-	    *rp++ = ztrdup(copy);
-    }
-    *rp = NULL;
-
-    return ret;
-}
-
 /* Help fuer `_describe'. */
 
 typedef struct cdset *Cdset;
@@ -1600,8 +1564,8 @@
     Cvdef ret;
     Cvval val, *valp;
     Caarg arg;
-    char **oargs = args, sep, *name, *descr, *p, *q, **xor, c;
-    int xnum, multi, vtype, hassep;
+    char **oargs = args, sep = '\0', *name, *descr, *p, *q, **xor, c;
+    int xnum, multi, vtype, hassep = 0;
 
     if (args[0][0] == '-' && args[0][1] == 's' && !args[0][2]) {
 	if (args[1][0] && args[1][1]) {
diff -ru ../z.old/Src/Zle/zle_main.c Src/Zle/zle_main.c
--- ../z.old/Src/Zle/zle_main.c	Thu Dec 16 09:28:48 1999
+++ Src/Zle/zle_main.c	Thu Dec 16 09:42:57 1999
@@ -736,7 +736,7 @@
     int create = 0;
     int type = PM_SCALAR, obreaks = breaks, haso = 0;
     char *p1 = NULL, *p2 = NULL;
-    FILE *oshout;
+    FILE *oshout = NULL;
 
     if (zleactive) {
 	zwarnnam(name, "ZLE cannot be used recursively (yet)", NULL, 0);
diff -ru ../z.old/Src/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- ../z.old/Src/Zle/zle_tricky.c	Thu Dec 16 09:28:49 1999
+++ Src/Zle/zle_tricky.c	Thu Dec 16 09:42:57 1999
@@ -1333,9 +1333,9 @@
 	    /* Try and deal with foo{xxx etc. */
 	    char *curs = s + (isset(COMPLETEINWORD) ? offs : strlen(s));
 	    char *predup = dupstring(s), *dp = predup;
-	    char *bbeg = NULL, *bend = NULL, *dbeg;
+	    char *bbeg = NULL, *bend = NULL, *dbeg = NULL;
 	    char *lastp = NULL, *firsts = NULL;
-	    int cant = 0, begi, boffs = offs, hascom = 0;
+	    int cant = 0, begi = 0, boffs = offs, hascom = 0;
 
 	    for (i = 0, p = s; *p; p++, dp++, i++) {
 		/* careful, ${... is not a brace expansion...
@@ -1898,7 +1898,7 @@
 	totl += len;
     }
     if ((ncols = ((columns + 2) / longest))) {
-	int tlines, tline, tcols, maxlen, nth, width;
+	int tlines = 0, tline, tcols = 0, maxlen, nth, width;
 
 	nlines = (num + ncols - 1) / ncols;
 
diff -ru ../z.old/Src/pattern.c Src/pattern.c
--- ../z.old/Src/pattern.c	Thu Dec 16 09:28:44 1999
+++ Src/pattern.c	Thu Dec 16 09:42:58 1999
@@ -1294,7 +1294,7 @@
 mod_export int
 pattryrefs(Patprog prog, char *string, int *nump, int *begp, int *endp)
 {
-    int i, maxnpos;
+    int i, maxnpos = 0;
     char **sp, **ep;
     char *progstr = (char *)prog + prog->startoff;
 

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author