linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remove pointless constructor
@ 2021-08-17  7:25 Rosen Penev
  0 siblings, 0 replies; 2+ messages in thread
From: Rosen Penev @ 2021-08-17  7:25 UTC (permalink / raw)
  To: linux-media

The members can be initialized directly, allowing to remove the
onstructor.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 utils/v4l2-compliance/v4l2-test-buffers.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index a005fde61..2f01ed8f3 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -2453,8 +2453,6 @@ int testRequests(struct node *node, bool test_streaming)
 class BlockingThread
 {
 public:
-	BlockingThread() : done(false), running(false) {}
-
 	virtual ~BlockingThread()
 	{
 		stop();
@@ -2497,7 +2495,7 @@ public:
 		running = false;
 	}
 
-	std::atomic<bool> done;
+	std::atomic<bool> done{};
 
 private:
 	static void *startRoutine(void *arg)
@@ -2516,7 +2514,7 @@ private:
 	virtual void run() = 0;
 
 	pthread_t thread;
-	std::atomic<bool> running;
+	std::atomic<bool> running{};
 };
 
 class DqbufThread : public BlockingThread
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] remove pointless constructor
@ 2021-06-23  7:07 Rosen Penev
  0 siblings, 0 replies; 2+ messages in thread
From: Rosen Penev @ 2021-06-23  7:07 UTC (permalink / raw)
  To: linux-media

The members can be initialized directly, allowing to remove the
onstructor.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 utils/v4l2-compliance/v4l2-test-buffers.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index a005fde61..2f01ed8f3 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -2453,8 +2453,6 @@ int testRequests(struct node *node, bool test_streaming)
 class BlockingThread
 {
 public:
-	BlockingThread() : done(false), running(false) {}
-
 	virtual ~BlockingThread()
 	{
 		stop();
@@ -2497,7 +2495,7 @@ public:
 		running = false;
 	}
 
-	std::atomic<bool> done;
+	std::atomic<bool> done{};
 
 private:
 	static void *startRoutine(void *arg)
@@ -2516,7 +2514,7 @@ private:
 	virtual void run() = 0;
 
 	pthread_t thread;
-	std::atomic<bool> running;
+	std::atomic<bool> running{};
 };
 
 class DqbufThread : public BlockingThread
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-17  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17  7:25 [PATCH] remove pointless constructor Rosen Penev
  -- strict thread matches above, loose matches on Subject: below --
2021-06-23  7:07 Rosen Penev

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).