]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
more: align void in functions with prototypes, and remove void casts
authorSami Kerola <kerolasa@iki.fi>
Mon, 8 Oct 2012 07:08:18 +0000 (08:08 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 15 Oct 2012 14:53:59 +0000 (16:53 +0200)
If there is void in argument list at function prototype it is reasonable
to expect to see it also where the function is wrote.  This change also
removes unnecessary return value void casting.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/more.c

index d056393847d5033d6a711a68723828cf53096eb7..2ecb218f13c64e8e69a7f87ff610cdaef9a8c6f5 100644 (file)
@@ -582,7 +582,7 @@ FILE *checkf(register char *fs, int *clearfirst)
        int c;
 
        if (stat(fs, &stbuf) == -1) {
-               (void)fflush(stdout);
+               fflush(stdout);
                if (clreol)
                        cleareol();
                perror(fs);
@@ -593,7 +593,7 @@ FILE *checkf(register char *fs, int *clearfirst)
                return ((FILE *)NULL);
        }
        if ((f = Fopen(fs, "r")) == NULL) {
-               (void)fflush(stdout);
+               fflush(stdout);
                perror(fs);
                return ((FILE *)NULL);
        }
@@ -631,11 +631,11 @@ static int magic(FILE *f, char *fs)
                case 0x457f:    /* simple ELF detection */
                        printf(_("\n******** %s: Not a text file ********\n\n"),
                               fs);
-                       (void)fclose(f);
+                       fclose(f);
                        return 1;
                }
        }
-       (void)fseek(f, 0L, SEEK_SET);   /* rewind() not necessary */
+       fseek(f, 0L, SEEK_SET); /* rewind() not necessary */
        return 0;
 }
 
@@ -749,7 +749,7 @@ void chgwinsz(int dummy __attribute__((__unused__)))
                if (win.ws_col != 0)
                        Mcol = win.ws_col;
        }
-       (void)signal(SIGWINCH, chgwinsz);
+       signal(SIGWINCH, chgwinsz);
 }
 #endif                         /* SIGWINCH */
 
@@ -1056,7 +1056,7 @@ void erasep(register int col)
 }
 
 /* Erase the current line entirely */
-void kill_line()
+void kill_line(void)
 {
        erasep(0);
        if (!eraseln || dumb)
@@ -1064,12 +1064,12 @@ void kill_line()
 }
 
 /* force clear to end of line */
-void cleareol()
+void cleareol(void)
 {
        my_putstring(eraseln);
 }
 
-void clreos()
+void clreos(void)
 {
        my_putstring(EodClr);
 }
@@ -1133,7 +1133,7 @@ void prbuf(register char *s, register int n)
 }
 
 /*  Clear the screen */
-void doclear()
+void doclear(void)
 {
        if (Clear && !hard) {
                my_putstring(Clear);
@@ -1145,7 +1145,7 @@ void doclear()
 }
 
 /* Go to home position */
-void home()
+void home(void)
 {
        my_putstring(Home);
 }
@@ -1743,7 +1743,7 @@ void skipf(register int nskip)
 }
 
 /*----------------------------- Terminal I/O -------------------------------*/
-void initterm()
+void initterm(void)
 {
        int ret;
        char *padstr;
@@ -1874,7 +1874,7 @@ void initterm()
        }
 }
 
-int readch()
+int readch(void)
 {
        unsigned char c;
 
@@ -2101,7 +2101,7 @@ void more_error(char *mess)
        siglongjmp(restore, 1);
 }
 
-void set_tty()
+void set_tty(void)
 {
        otty.c_lflag &= ~(ICANON | ECHO);
        otty.c_cc[VMIN] = 1;    /* read at least 1 char */
@@ -2114,7 +2114,7 @@ static int ourputch(int c)
        return putc(c, stdout);
 }
 
-void reset_tty()
+void reset_tty(void)
 {
        if (no_tty)
                return;