All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy MacLeod <Randy.MacLeod@windriver.com>
To: <yocto@yoctoproject.org>, <anibal.limon@linaro.org>
Subject: [ptest-runner][PATCH 3/4] tests: fix clang warnings.
Date: Wed, 17 Jul 2019 14:35:29 -0400	[thread overview]
Message-ID: <20190717183530.24893-3-Randy.MacLeod@windriver.com> (raw)
In-Reply-To: <20190717183530.24893-1-Randy.MacLeod@windriver.com>

Make tests build using: clang -Weverything
There are a few warnings that remain that are not
variable casting or macro fixes.

Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
---
 tests/main.c  |  5 +----
 tests/utils.c | 19 +++++++++----------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/tests/main.c b/tests/main.c
index c3b4da5..e1a8b69 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -62,13 +62,10 @@ main(int argc, char *argv[])
 				opts_directory = strdup(optarg);
 			break;
 			case 'h':
-				print_usage(stdout, argv[0]);
-				exit(0);
-			break;
+				/* fall though !! */
 			default:
 				print_usage(stdout, argv[0]);
 				exit(1);
-			break;
 		}
 	}
 
diff --git a/tests/utils.c b/tests/utils.c
index 3ba64d6..571d488 100644
--- a/tests/utils.c
+++ b/tests/utils.c
@@ -33,7 +33,6 @@
 #include "utils.h"
 
 #define PRINT_PTEST_BUF_SIZE 8192
-#define PRINT_PTEST_MAX_LINE 512
 
 extern char *opts_directory;
 
@@ -247,15 +246,15 @@ END_TEST
 static int
 filecmp(FILE *fp1, FILE *fp2)
 {
-    char f1, f2;
-    while (1) {
-			  int end = 0;
-        if ((f1 = getc(fp1)) == EOF) end++;
-        if ((f2 = getc(fp2)) == EOF) end++;
-
-				if (end == 2) return 0;
-				if (end == 1) return 1;
-        if (f1 != f2) return 2;
+	int f1, f2;
+	while (1) {
+		int end = 0;
+		if ((f1 = getc(fp1)) == EOF) end++;
+		if ((f2 = getc(fp2)) == EOF) end++;
+
+		if (end == 2) return 0;
+		if (end == 1) return 1;
+		if (f1 != f2) return 2;
     }
 }
 
-- 
2.17.0



  parent reply	other threads:[~2019-07-17 18:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 18:35 [ptest-runner][PATCH 1/4] utils: ensure child can be session leader Randy MacLeod
2019-07-17 18:35 ` [ptest-runner][PATCH 2/4] main code: fix clang warnings Randy MacLeod
2019-07-17 18:35 ` Randy MacLeod [this message]
2019-07-17 18:35 ` [ptest-runner][PATCH 4/4] Fix additional warnings when using clang Randy MacLeod
2019-08-01 18:19   ` Anibal Limon
2019-08-01 18:34     ` Randy MacLeod
2019-07-21 19:22 ` [ptest-runner][PATCH 1/4] utils: ensure child can be session leader Anibal Limon

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=20190717183530.24893-3-Randy.MacLeod@windriver.com \
    --to=randy.macleod@windriver.com \
    --cc=anibal.limon@linaro.org \
    --cc=yocto@yoctoproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.