summaryrefslogtreecommitdiffstats
path: root/text-utils
diff options
context:
space:
mode:
authorSami Kerola2018-05-26 22:24:31 +0200
committerSami Kerola2018-09-02 19:28:08 +0200
commit0b735ea49ec1bf2921f5d1eec5c8bb68112a0a55 (patch)
tree4e5301106fa1d7689a177c5d6da4af27036a7797 /text-utils
parentmore: remove pointless functions (diff)
downloadkernel-qcow2-util-linux-0b735ea49ec1bf2921f5d1eec5c8bb68112a0a55.tar.gz
kernel-qcow2-util-linux-0b735ea49ec1bf2921f5d1eec5c8bb68112a0a55.tar.xz
kernel-qcow2-util-linux-0b735ea49ec1bf2921f5d1eec5c8bb68112a0a55.zip
more: remove 'register' keywords
One can only assume someone tried to make more(1) to run quicker. More up to date assumption is that compilers are fully capable optimizing binaries without these sort of hints. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'text-utils')
-rw-r--r--text-utils/more.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/text-utils/more.c b/text-utils/more.c
index 22b2b0b61..225ec2dbe 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -337,10 +337,10 @@ static int magic(FILE *f, char *fs)
/* Check whether the file named by fs is an ASCII file which the user may
* access. If it is, return the opened file. Otherwise return NULL. */
-static FILE *checkf(struct more_control *ctl, register char *fs, int *clearfirst)
+static FILE *checkf(struct more_control *ctl, char *fs, int *clearfirst)
{
struct stat stbuf;
- register FILE *f;
+ FILE *f;
int c;
if (stat(fs, &stbuf) == -1) {
@@ -390,7 +390,7 @@ static void prepare_line_buffer(struct more_control *ctl)
}
/* Get a logical line */
-static int get_line(struct more_control *ctl, register FILE *f, int *length)
+static int get_line(struct more_control *ctl, FILE *f, int *length)
{
int c;
char *p;
@@ -587,7 +587,7 @@ static int get_line(struct more_control *ctl, register FILE *f, int *length)
}
/* Erase the rest of the prompt, assuming we are starting at column col. */
-static void erasep(struct more_control *ctl, register int col)
+static void erasep(struct more_control *ctl, int col)
{
if (ctl->promptlen == 0)
@@ -626,10 +626,10 @@ static int wouldul(char *s, int n)
}
/* Print a buffer of n characters */
-static void prbuf(struct more_control *ctl, register char *s, register int n)
+static void prbuf(struct more_control *ctl, char *s, int n)
{
- register char c; /* next output character */
- register int state; /* next output char's UL state */
+ char c; /* next output character */
+ int state; /* next output char's UL state */
while (--n >= 0)
if (!ctl->ul_opt)
@@ -782,7 +782,7 @@ static int readch(struct more_control *ctl)
* which terminates the number. */
static int number(struct more_control *ctl, char *cmd)
{
- register int i;
+ int i;
char ch;
i = 0;
@@ -803,7 +803,7 @@ static int number(struct more_control *ctl, char *cmd)
/* Skip nskip files in the file list (from the command line). Nskip may
* be negative. */
-static void skipf(struct more_control *ctl, register int nskip)
+static void skipf(struct more_control *ctl, int nskip)
{
if (nskip == 0)
return;
@@ -866,7 +866,7 @@ static void erase_one_column(struct more_control *ctl)
fputs(BS, stderr);
}
-static void ttyin(struct more_control *ctl, char buf[], register int nmax, char pchar)
+static void ttyin(struct more_control *ctl, char buf[], int nmax, char pchar)
{
char *sp;
int c;
@@ -1261,9 +1261,9 @@ static int colon(struct more_control *ctl, char *filename, int cmd, int nlines)
}
/* Skip n lines in the file f */
-static void skiplns(struct more_control *ctl, register int n, register FILE *f)
+static void skiplns(struct more_control *ctl, int n, FILE *f)
{
- register int c;
+ int c;
while (n > 0) {
while ((c = more_getc(ctl, f)) != '\n')
@@ -1286,10 +1286,10 @@ static void doclear(struct more_control *ctl)
}
}
-static void rdline(struct more_control *ctl, register FILE *f)
+static void rdline(struct more_control *ctl, FILE *f)
{
- register int c;
- register char *p;
+ int c;
+ char *p;
prepare_line_buffer(ctl);
@@ -1304,13 +1304,13 @@ static void rdline(struct more_control *ctl, register FILE *f)
/* Search for nth occurrence of regular expression contained in buf in
* the file */
-static void search(struct more_control *ctl, char buf[], FILE *file, register int n)
+static void search(struct more_control *ctl, char buf[], FILE *file, int n)
{
long startline = ctl->file_pos;
- register long line1 = startline;
- register long line2 = startline;
- register long line3;
- register int lncount;
+ long line1 = startline;
+ long line2 = startline;
+ long line3;
+ int lncount;
int saveln, rc;
regex_t re;
@@ -1384,11 +1384,11 @@ notfound:
* argument followed by the command character. Return the number of
* lines to display in the next screenful. If there is nothing more to
* display in the current file, zero is returned. */
-static int command(struct more_control *ctl, char *filename, register FILE *f)
+static int command(struct more_control *ctl, char *filename, FILE *f)
{
- register int nlines;
- register int retval = 0;
- register int c;
+ int nlines;
+ int retval = 0;
+ int c;
char colonch;
int done;
char comchar, cmdbuf[INIT_BUF];
@@ -1424,7 +1424,7 @@ static int command(struct more_control *ctl, char *filename, register FILE *f)
case 'b':
case ctrl('B'):
{
- register int initline;
+ int initline;
if (ctl->no_intty) {
fputc(RINGBELL, stderr);
@@ -1689,10 +1689,10 @@ static int command(struct more_control *ctl, char *filename, register FILE *f)
}
/* Print out the contents of the file f, one screenful at a time. */
-static void screen(struct more_control *ctl, register FILE *f, register int num_lines)
+static void screen(struct more_control *ctl, FILE *f, int num_lines)
{
- register int c;
- register int nchars;
+ int c;
+ int nchars;
int length; /* length of current line */
static int prev_len = 1; /* length of previous line */
@@ -1777,7 +1777,7 @@ static void chgwinsz(int dummy __attribute__((__unused__)))
}
#endif /* SIGWINCH */
-static void copy_file(register FILE *f)
+static void copy_file(FILE *f)
{
char buf[BUFSIZ];
size_t sz;