summaryrefslogtreecommitdiffstats
path: root/text-utils
diff options
context:
space:
mode:
authorSami Kerola2018-05-26 21:55:32 +0200
committerSami Kerola2018-09-02 19:28:08 +0200
commitf728d8baae70b6d7959e94fc5873f9a1d61b39ed (patch)
tree33926cfb9375e7e2fb2e2b54242902870894f51a /text-utils
parentmore: remove dead code and useless comments (diff)
downloadkernel-qcow2-util-linux-f728d8baae70b6d7959e94fc5873f9a1d61b39ed.tar.gz
kernel-qcow2-util-linux-f728d8baae70b6d7959e94fc5873f9a1d61b39ed.tar.xz
kernel-qcow2-util-linux-f728d8baae70b6d7959e94fc5873f9a1d61b39ed.zip
more: return is statement not a function
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'text-utils')
-rw-r--r--text-utils/more.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/text-utils/more.c b/text-utils/more.c
index 1aaa1b213..9a9529653 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -359,22 +359,22 @@ static FILE *checkf(struct more_control *ctl, register char *fs, int *clearfirst
if (ctl->clreol)
cleareol(ctl);
warn(_("stat of %s failed"), fs);
- return ((FILE *)NULL);
+ return NULL;
}
if ((stbuf.st_mode & S_IFMT) == S_IFDIR) {
printf(_("\n*** %s: directory ***\n\n"), fs);
- return ((FILE *)NULL);
+ return NULL;
}
ctl->Currline = 0;
ctl->file_pos = 0;
if ((f = fopen(fs, "r")) == NULL) {
fflush(stdout);
warn(_("cannot open %s"), fs);
- return ((FILE *)NULL);
+ return NULL;
}
if (magic(f, fs)) {
fclose(f);
- return ((FILE *)NULL);
+ return NULL;
}
fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
c = more_getc(ctl, f);
@@ -382,7 +382,7 @@ static FILE *checkf(struct more_control *ctl, register char *fs, int *clearfirst
more_ungetc(ctl, c, f);
if ((ctl->file_size = stbuf.st_size) == 0)
ctl->file_size = LONG_MAX;
- return (f);
+ return f;
}
static void prepare_line_buffer(struct more_control *ctl)
@@ -490,10 +490,10 @@ static int get_line(struct more_control *ctl, register FILE *f, int *length)
if (p > ctl->Line) {
*p = '\0';
*length = p - ctl->Line;
- return (column);
+ return column;
}
*length = p - ctl->Line;
- return (EOF);
+ return EOF;
}
if (c == '\n') {
ctl->Currline++;
@@ -536,7 +536,7 @@ static int get_line(struct more_control *ctl, register FILE *f, int *length)
ctl->Pause = 1;
} else if (c == EOF) {
*length = p - ctl->Line;
- return (column);
+ return column;
} else {
#ifdef HAVE_WIDECHAR
if (ctl->fold_opt && MB_CUR_MAX > 1) {
@@ -594,7 +594,7 @@ static int get_line(struct more_control *ctl, register FILE *f, int *length)
}
*length = p - ctl->Line;
*p = 0;
- return (column);
+ return column;
}
static void clreos(struct more_control *ctl)
@@ -796,7 +796,7 @@ static int readch(struct more_control *ctl)
else
c = ctl->otty.c_cc[VKILL];
}
- return (c);
+ return c;
}
/* Read a decimal number from the terminal. Set cmd to the non-digit
@@ -819,7 +819,7 @@ static int number(struct more_control *ctl, char *cmd)
break;
}
}
- return (i);
+ return i;
}
/* Skip nskip files in the file list (from the command line). Nskip may
@@ -1064,7 +1064,7 @@ static int expand(struct more_control *ctl, char **outbuf, char *inbuf)
}
*outstr++ = '\0';
*outbuf = temp;
- return (changed);
+ return changed;
}
static void set_tty(struct more_control *ctl)
@@ -1247,7 +1247,7 @@ static int colon(struct more_control *ctl, char *filename, int cmd, int nlines)
else
ctl->promptlen = printf(_("[Not a file] line %d"), ctl->Currline);
fflush(stdout);
- return (-1);
+ return -1;
case 'n':
if (nlines == 0) {
if (ctl->fnum >= ctl->nfiles - 1)
@@ -1257,27 +1257,27 @@ static int colon(struct more_control *ctl, char *filename, int cmd, int nlines)
putchar('\r');
erasep(ctl, 0);
skipf(ctl, nlines);
- return (0);
+ return 0;
case 'p':
if (ctl->no_intty) {
fputc(RINGBELL, stderr);
- return (-1);
+ return -1;
}
putchar('\r');
erasep(ctl, 0);
if (nlines == 0)
nlines++;
skipf(ctl, -nlines);
- return (0);
+ return 0;
case '!':
do_shell(ctl, filename);
- return (-1);
+ return -1;
case 'q':
case 'Q':
end_it(0);
default:
fputc(RINGBELL, stderr);
- return (-1);
+ return -1;
}
}
@@ -1455,7 +1455,7 @@ static int command(struct more_control *ctl, char *filename, register FILE *f)
if (ctl->no_intty) {
fputc(RINGBELL, stderr);
- return (-1);
+ return -1;
}
if (nlines == 0)
@@ -1712,7 +1712,7 @@ static int command(struct more_control *ctl, char *filename, register FILE *f)
endsw:
ctl->inwait = 0;
ctl->notell = 1;
- return (retval);
+ return retval;
}
/* Print out the contents of the file f, one screenful at a time. */