util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 12/14] more: align void in functions with prototypes, and remove void casts
Date: Mon,  8 Oct 2012 08:08:18 +0100	[thread overview]
Message-ID: <1349680100-18120-13-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1349680100-18120-1-git-send-email-kerolasa@iki.fi>

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 | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/text-utils/more.c b/text-utils/more.c
index d056393..2ecb218 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -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;
-- 
1.7.12.2


  parent reply	other threads:[~2012-10-08  7:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08  7:08 [PATCH 00/14] various: clean ups and fixes Sami Kerola
2012-10-08  7:08 ` [PATCH 01/14] ddate: remove from util-linux Sami Kerola
2012-10-08  9:06   ` Petr Uzel
2012-10-08  7:08 ` [PATCH 02/14] column: add --output-separator option Sami Kerola
2012-10-08  7:08 ` [PATCH 03/14] docs: fix column.1 groff syntax error Sami Kerola
2012-10-08  7:08 ` [PATCH 04/14] pg: refactor argument handing Sami Kerola
2012-10-08  7:08 ` [PATCH 05/14] pg: use libc error printing facilities Sami Kerola
2012-10-08  7:08 ` [PATCH 06/14] pg: add const qualifiers where suitable Sami Kerola
2012-10-08  7:08 ` [PATCH 07/14] pg: add noreturn function attributes Sami Kerola
2012-10-08  7:08 ` [PATCH 08/14] pg: use unistd.h STDOUT_FILENO Sami Kerola
2012-10-08  7:08 ` [PATCH 09/14] pg: do not turn off warnigns artificially Sami Kerola
2012-10-08  7:08 ` [PATCH 10/14] pg: fix coding style Sami Kerola
2012-10-08  7:08 ` [PATCH 11/14] more: " Sami Kerola
2012-10-08  7:08 ` Sami Kerola [this message]
2012-10-08  7:08 ` [PATCH 13/14] more: remove few memory leaks Sami Kerola
2012-10-08  7:08 ` [PATCH 14/14] swapon: remove loop declaration [smatch scan] Sami Kerola

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349680100-18120-13-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).