Fix some useless warnings

Makes the code uglier but I cannot stand them.
This commit is contained in:
sin
2015-12-15 09:04:00 +00:00
parent 6b14c50e57
commit fdf9ab9b2d

12
ed.c
View File

@@ -409,6 +409,7 @@ search(int way)
} while (i != curln); } while (i != curln);
error("invalid address"); error("invalid address");
return -1; /* not reached */
} }
static void static void
@@ -439,6 +440,7 @@ getnum(void)
invalid: invalid:
error("invalid address"); error("invalid address");
return -1; /* not reached */
} }
static int static int
@@ -513,6 +515,7 @@ address(int *line)
invalid: invalid:
error("invalid address"); error("invalid address");
return -1; /* not reached */
} }
static void static void
@@ -716,6 +719,7 @@ getfname(void)
*bp = '\0'; *bp = '\0';
return fname; return fname;
} }
return NULL; /* not reached */
} }
static void static void
@@ -753,7 +757,7 @@ move(int where)
{ {
int before, after, lto, lfrom; int before, after, lto, lfrom;
if (!line1 || where >= line1 && where <= line2) if (!line1 || (where >= line1 && where <= line2))
error("incorrect address"); error("incorrect address");
before = getindex(prevln(line1)); before = getindex(prevln(line1));
@@ -813,7 +817,7 @@ copy(int where)
{ {
int i; int i;
if (!line1 || where >= line1 && where <= line2) if (!line1 || (where >= line1 && where <= line2))
error("incorrect address"); error("incorrect address");
curln = where; curln = where;
@@ -929,7 +933,7 @@ addpost(char **s, size_t *cap, size_t *siz)
{ {
char c, *p; char c, *p;
for (p = lastmatch + matchs[0].rm_eo; c = *p; ++p) for (p = lastmatch + matchs[0].rm_eo; (c = *p); ++p)
*s = addchar(c, *s, cap, siz); *s = addchar(c, *s, cap, siz);
*s = addchar('\0', *s, cap, siz); *s = addchar('\0', *s, cap, siz);
} }
@@ -940,7 +944,7 @@ addsub(char **s, size_t *cap, size_t *siz)
char *end, *q, *p, c; char *end, *q, *p, c;
int sub; int sub;
for (p = rhs; c = *p; ++p) { for (p = rhs; (c = *p); ++p) {
switch (c) { switch (c) {
case '&': case '&':
sub = 0; sub = 0;