changeset 4958:0a379dea13c9 v7.3.1224

updated for version 7.3.1224 Problem: Clang gives warnings on xxd. Solution: Change how to use part of a string. (Dominique Pelle) Also avoid warning for return not reached.
author Bram Moolenaar <bram@vim.org>
date Fri, 21 Jun 2013 18:31:23 +0200
parents 9608d9953dc2
children fcd8be759157
files src/regexp_nfa.c src/version.c src/xxd/xxd.c
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -2611,7 +2611,7 @@ nfa_max_width(startstate, depth)
     if (depth > 4)
 	return -1;
 
-    for (;;)
+    while (state != NULL)
     {
 	switch (state->c)
 	{
@@ -2810,7 +2810,7 @@ nfa_max_width(startstate, depth)
 	state = state->out;
     }
 
-    /* unrecognized */
+    /* unrecognized, "cannot happen" */
     return -1;
 }
 
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1224,
+/**/
     1223,
 /**/
     1222,
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -722,7 +722,7 @@ main(argc, argv)
       while ((length < 0 || p < length) && (c = getc(fp)) != EOF)
 	{
 	  if (fprintf(fpo, (hexx == hexxa) ? "%s0x%02x" : "%s0X%02X",
-		(p % cols) ? ", " : ",\n  "+2*!p,  c) < 0)
+		(p % cols) ? ", " : &",\n  "[2*!p],  c) < 0)
 	    die(3);
 	  p++;
 	}
@@ -731,7 +731,7 @@ main(argc, argv)
 
       if (p && fputs("\n", fpo) == EOF)
 	die(3);
-      if (fputs("};\n" + 3 * (fp == stdin), fpo) == EOF)
+      if (fputs(&"};\n"[3 * (fp == stdin)], fpo) == EOF)
 	die(3);
 
       if (fp != stdin)