linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 08/15] options: avoid spaces between function name and arguments list
Date: Sun,  5 Jul 2020 15:02:13 +0200	[thread overview]
Message-ID: <20200705130220.26230-9-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20200705130220.26230-1-luc.vanoostenryck@gmail.com>

It's a stylistic detail but a lot of the strcmp() calls used for
the processing of the options are written 'strcmp (...)'. Two
other functions calls are also in the case.

Reformat them to the usual style for function calls: without
the space between the function name and the arguments.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 lib.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/lib.c b/lib.c
index 5f4e6b2d76c8..b3bacb180cac 100644
--- a/lib.c
+++ b/lib.c
@@ -570,7 +570,7 @@ OPT_NUMERIC(uint, unsigned int, strtoul)
 
 static char **handle_switch_a(char *arg, char **next)
 {
-	if (!strcmp (arg, "ansi"))
+	if (!strcmp(arg, "ansi"))
 		standard = STANDARD_C89;
 
 	return next;
@@ -759,7 +759,7 @@ static char **handle_switch_f(char *arg, char **next)
 
 static char **handle_switch_G(char *arg, char **next)
 {
-	if (!strcmp (arg, "G") && *next)
+	if (!strcmp(arg, "G") && *next)
 		return next + 1; // "-G 0"
 	else
 		return next;     // "-G0" or (bogus) terminal "-G"
@@ -775,7 +775,7 @@ static char **handle_base_dir(char *arg, char **next)
 
 static char **handle_switch_g(char *arg, char **next)
 {
-	if (!strcmp (arg, "gcc-base-dir"))
+	if (!strcmp(arg, "gcc-base-dir"))
 		return handle_base_dir(arg, next);
 
 	return next;
@@ -907,7 +907,7 @@ static char **handle_nostdinc(char *arg, char **next)
 
 static char **handle_switch_n(char *arg, char **next)
 {
-	if (!strcmp (arg, "nostdinc"))
+	if (!strcmp(arg, "nostdinc"))
 		return handle_nostdinc(arg, next);
 
 	return next;
@@ -925,7 +925,7 @@ static char **handle_switch_O(char *arg, char **next)
 
 static char **handle_switch_o(char *arg, char **next)
 {
-	if (!strcmp (arg, "o")) {       // "-o foo"
+	if (!strcmp(arg, "o")) {	// "-o foo"
 		if (!*++next)
 			die("argument to '-o' is missing");
 		outfile = *next;
@@ -949,23 +949,23 @@ static char **handle_switch_p(char *arg, char **next)
 static char **handle_switch_s(const char *arg, char **next)
 {
 	if ((arg = match_option(arg, "std="))) {
-		if (!strcmp (arg, "c89") ||
-		    !strcmp (arg, "iso9899:1990"))
+		if (!strcmp(arg, "c89") ||
+		    !strcmp(arg, "iso9899:1990"))
 			standard = STANDARD_C89;
 
-		else if (!strcmp (arg, "iso9899:199409"))
+		else if (!strcmp(arg, "iso9899:199409"))
 			standard = STANDARD_C94;
 
-		else if (!strcmp (arg, "c99") ||
-			 !strcmp (arg, "c9x") ||
-			 !strcmp (arg, "iso9899:1999") ||
-			 !strcmp (arg, "iso9899:199x"))
+		else if (!strcmp(arg, "c99") ||
+			 !strcmp(arg, "c9x") ||
+			 !strcmp(arg, "iso9899:1999") ||
+			 !strcmp(arg, "iso9899:199x"))
 			standard = STANDARD_C99;
 
-		else if (!strcmp (arg, "gnu89"))
+		else if (!strcmp(arg, "gnu89"))
 			standard = STANDARD_GNU89;
 
-		else if (!strcmp (arg, "gnu99") || !strcmp (arg, "gnu9x"))
+		else if (!strcmp(arg, "gnu99") || !strcmp(arg, "gnu9x"))
 			standard = STANDARD_GNU99;
 
 		else if (!strcmp(arg, "c11") ||
@@ -986,7 +986,7 @@ static char **handle_switch_s(const char *arg, char **next)
 			standard = STANDARD_GNU17;
 
 		else
-			die ("Unsupported C dialect");
+			die("Unsupported C dialect");
 	}
 
 	return next;
@@ -995,7 +995,7 @@ static char **handle_switch_s(const char *arg, char **next)
 static char **handle_switch_U(char *arg, char **next)
 {
 	const char *name = arg + 1;
-	add_pre_buffer ("#undef %s\n", name);
+	add_pre_buffer("#undef %s\n", name);
 	return next;
 }
 
@@ -1516,7 +1516,7 @@ static struct symbol_list *sparse_file(const char *filename)
 	int fd;
 	struct token *token;
 
-	if (strcmp (filename, "-") == 0) {
+	if (strcmp(filename, "-") == 0) {
 		fd = 0;
 	} else {
 		fd = open(filename, O_RDONLY);
-- 
2.27.0

  parent reply	other threads:[~2020-07-05 13:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-05 13:02 [PATCH 00/15] tidy-up options / reorganize lib.c Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 01/15] options: let handle_onoff_switch() use null terminated arrays Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 02/15] options: move -Wsparse-all's processing out of handle_onoff_switch() Luc Van Oostenryck
2020-07-05 13:02   ` Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 03/15] options: move on top the definition of warning type enums Luc Van Oostenryck
2020-07-05 13:02   ` Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 04/15] options: make Wsparse_error less special Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 05/15] options: handle_onoff_switch() can handle any flags, not only warnings Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 06/15] options: move helpers up Luc Van Oostenryck
2020-07-05 13:02   ` Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 07/15] options: alphasort the handle_switch_[a-zA_Z]() Luc Van Oostenryck
2020-07-05 13:02   ` Luc Van Oostenryck
2020-07-05 13:02 ` Luc Van Oostenryck [this message]
2020-07-05 13:02 ` [PATCH 09/15] options: move declaration of tabstop out of "token.h" Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 10/15] options: add a small helper: handle_switch_finalize() Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 11/15] options: move option parsing in a separate file Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 12/15] options: keep the options sorted Luc Van Oostenryck
2020-07-05 13:02   ` Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 13/15] cleanup: move predefines in a separate file Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 14/15] cleanup: move parsing helpers to parse.c Luc Van Oostenryck
2020-07-05 17:27   ` Linus Torvalds
2020-07-05 20:45     ` Luc Van Oostenryck
2020-07-05 13:02 ` [PATCH 15/15] cleanup: move hexval() to utils.c Luc Van Oostenryck

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=20200705130220.26230-9-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@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).