linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: linux-media@vger.kernel.org
Subject: [PATCH 6/7] utils: use bool literals
Date: Mon, 20 Apr 2020 11:46:48 -0700	[thread overview]
Message-ID: <20200420184649.4202-6-rosenp@gmail.com> (raw)
In-Reply-To: <20200420184649.4202-1-rosenp@gmail.com>

Found with clang-tidy's modernize-use-bool-literals

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 utils/cec-compliance/cec-compliance.cpp   | 2 +-
 utils/cec-compliance/cec-test.cpp         | 2 +-
 utils/cec-ctl/cec-ctl.cpp                 | 2 +-
 utils/cec-follower/cec-follower.cpp       | 2 +-
 utils/cec-follower/cec-processing.cpp     | 2 +-
 utils/rds-ctl/rds-ctl.cpp                 | 2 +-
 utils/v4l2-compliance/v4l2-compliance.cpp | 4 ++--
 utils/v4l2-ctl/v4l2-ctl-streaming.cpp     | 2 +-
 utils/v4l2-ctl/v4l2-ctl.cpp               | 6 +++---
 utils/v4l2-dbg/v4l2-dbg.cpp               | 2 +-
 10 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp
index b665303e..6d07bfc9 100644
--- a/utils/cec-compliance/cec-compliance.cpp
+++ b/utils/cec-compliance/cec-compliance.cpp
@@ -1166,7 +1166,7 @@ int main(int argc, char **argv)
 			short_options[idx++] = ':';
 		}
 	}
-	while (1) {
+	while (true) {
 		int option_index = 0;
 
 		short_options[idx] = 0;
diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index 4aa54afc..a82069ad 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -889,7 +889,7 @@ static int tuner_ctl_test(struct node *node, unsigned me, unsigned la, bool inte
 	if (ret)
 		return ret;
 
-	while (1) {
+	while (true) {
 		cec_msg_init(&msg, me, la);
 		cec_msg_tuner_step_increment(&msg);
 		fail_on_test(!transmit(node, &msg));
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index be37ae3c..46cfcd80 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -1863,7 +1863,7 @@ int main(int argc, char **argv)
 		if (long_options[i].has_arg == required_argument)
 			short_options[idx++] = ':';
 	}
-	while (1) {
+	while (true) {
 		int option_index = 0;
 		struct cec_msg msg;
 
diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp
index 12bb5f15..ab3113b6 100644
--- a/utils/cec-follower/cec-follower.cpp
+++ b/utils/cec-follower/cec-follower.cpp
@@ -331,7 +331,7 @@ int main(int argc, char **argv)
 			short_options[idx++] = ':';
 		}
 	}
-	while (1) {
+	while (true) {
 		int option_index = 0;
 
 		short_options[idx] = 0;
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index 34b54fa3..8e3a33a2 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -885,7 +885,7 @@ void testProcessing(struct node *node, bool wallclock)
 
 	poll_remote_devs(node, me);
 
-	while (1) {
+	while (true) {
 		int res;
 		struct timeval timeval = {};
 
diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
index 2d561481..fef2a3f1 100644
--- a/utils/rds-ctl/rds-ctl.cpp
+++ b/utils/rds-ctl/rds-ctl.cpp
@@ -757,7 +757,7 @@ static int parse_cl(int argc, char **argv)
 		if (long_options[i].has_arg == required_argument)
 			short_options[idx++] = ':';
 	}
-	while (1) {
+	while (true) {
 		int option_index = 0;
 
 		short_options[idx] = 0;
diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
index bb32bae6..39dd1aec 100644
--- a/utils/v4l2-compliance/v4l2-compliance.cpp
+++ b/utils/v4l2-compliance/v4l2-compliance.cpp
@@ -834,7 +834,7 @@ static int open_media_bus_info(const std::string &bus_info, std::string &media_d
 	while ((ep = readdir(dp))) {
 		const char *name = ep->d_name;
 
-		if ((!memcmp(name, "media", 5) != 0) && isdigit(name[5])) {
+		if ((!(memcmp(name, "media", 5) != 0)) && isdigit(name[5])) {
 			struct media_device_info mdi;
 			media_devname = std::string("/dev/") + name;
 
@@ -1519,7 +1519,7 @@ int main(int argc, char **argv)
 			short_options[idx++] = ':';
 		}
 	}
-	while (1) {
+	while (true) {
 		int option_index = 0;
 
 		short_options[idx] = 0;
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index de40c5ad..833263b6 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -2742,7 +2742,7 @@ static void streaming_set_cap2out(cv4l_fd &fd, cv4l_fd &out_fd)
 	if (use_poll)
 		fcntl(fd.g_fd(), F_SETFL, fd_flags | O_NONBLOCK);
 
-	while (1) {
+	while (true) {
 		struct timeval tv = { use_poll ? 2 : 0, 0 };
 		int r = 0;
 
diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
index 42889ef8..c0097203 100644
--- a/utils/v4l2-ctl/v4l2-ctl.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl.cpp
@@ -1145,7 +1145,7 @@ int main(int argc, char **argv)
 			short_options[idx++] = ':';
 		}
 	}
-	while (1) {
+	while (true) {
 		int option_index = 0;
 
 		short_options[idx] = 0;
@@ -1531,7 +1531,7 @@ int main(int argc, char **argv)
 			__u32 seq = 0;
 
 			fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
-			while (1) {
+			while (true) {
 				int res;
 
 				FD_ZERO(&fds);
@@ -1572,7 +1572,7 @@ int main(int argc, char **argv)
 
 			fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
 			epoll_ctl(epollfd, EPOLL_CTL_ADD, fd, &epoll_ev);
-			while (1) {
+			while (true) {
 				int res;
 
 				res = epoll_wait(epollfd, &epoll_ev, 1, -1);
diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
index 17ab0210..dcf8200a 100644
--- a/utils/v4l2-dbg/v4l2-dbg.cpp
+++ b/utils/v4l2-dbg/v4l2-dbg.cpp
@@ -442,7 +442,7 @@ int main(int argc, char **argv)
 			short_options[idx++] = ':';
 		}
 	}
-	while (1) {
+	while (true) {
 		int option_index = 0;
 
 		short_options[idx] = 0;
-- 
2.25.2


  parent reply	other threads:[~2020-04-20 18:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20 18:46 [PATCH 1/7] treewide: fix mismatching declarations Rosen Penev
2020-04-20 18:46 ` [PATCH 2/7] treewide: replace C casts with C++ Rosen Penev
2020-04-20 18:46 ` [PATCH 3/7] treewide: fix wrong *cmp function usage Rosen Penev
2020-04-21  7:31   ` Hans Verkuil
2020-04-20 18:46 ` [PATCH 4/7] treewide: apply performance fixes Rosen Penev
2020-04-20 18:46 ` [PATCH 5/7] media-info: fix NULL check Rosen Penev
2020-04-21  8:41   ` Hans Verkuil
2020-04-20 18:46 ` Rosen Penev [this message]
2020-04-21  8:44   ` [PATCH 6/7] utils: use bool literals Hans Verkuil
2020-04-20 18:46 ` [PATCH 7/7] utils: do not use empty void with C++ Rosen Penev
2020-04-21  7:23 ` [PATCH 1/7] treewide: fix mismatching declarations Hans Verkuil
2020-04-21  7:26   ` Hans Verkuil

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=20200420184649.4202-6-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=linux-media@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).