[hackers] [sbase] Fix some useless warnings || sin
commit fdf9ab9b2d93199faea6a9e4e6e38da5d7e7a0d3
Author: sin <sin_AT_2f30.org>
AuthorDate: Tue Dec 15 09:04:00 2015 +0000
Commit: sin <sin_AT_2f30.org>
CommitDate: Tue Dec 15 09:05:02 2015 +0000
Fix some useless warnings
Makes the code uglier but I cannot stand them.
diff --git a/ed.c b/ed.c
index f24c55a..3f878eb 100644
--- a/ed.c
+++ b/ed.c
_AT_@ -409,6 +409,7 @@ search(int way)
} while (i != curln);
error("invalid address");
+ return -1; /* not reached */
}
static void
_AT_@ -439,6 +440,7 @@ getnum(void)
invalid:
error("invalid address");
+ return -1; /* not reached */
}
static int
_AT_@ -513,6 +515,7 @@ address(int *line)
invalid:
error("invalid address");
+ return -1; /* not reached */
}
static void
_AT_@ -716,6 +719,7 @@ getfname(void)
*bp = '\0';
return fname;
}
+ return NULL; /* not reached */
}
static void
_AT_@ -753,7 +757,7 @@ move(int where)
{
int before, after, lto, lfrom;
- if (!line1 || where >= line1 && where <= line2)
+ if (!line1 || (where >= line1 && where <= line2))
error("incorrect address");
before = getindex(prevln(line1));
_AT_@ -813,7 +817,7 @@ copy(int where)
{
int i;
- if (!line1 || where >= line1 && where <= line2)
+ if (!line1 || (where >= line1 && where <= line2))
error("incorrect address");
curln = where;
_AT_@ -929,7 +933,7 @@ addpost(char **s, size_t *cap, size_t *siz)
{
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('\0', *s, cap, siz);
}
_AT_@ -940,7 +944,7 @@ addsub(char **s, size_t *cap, size_t *siz)
char *end, *q, *p, c;
int sub;
- for (p = rhs; c = *p; ++p) {
+ for (p = rhs; (c = *p); ++p) {
switch (c) {
case '&':
sub = 0;
Received on Tue Dec 15 2015 - 10:05:28 CET
This archive was generated by hypermail 2.3.0
: Tue Dec 15 2015 - 10:12:14 CET