[libcamera-devel] [PATCH 2/2] libcamera: Remove space between empty curly brackets

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Nov 4 18:08:05 CET 2019


Remove spaces between empty curly brackets (replacing { } with {}) to
comply with the coding style. Fix one other coding style violation on
the lines touched by those fixes.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 src/libcamera/include/media_object.h          | 10 ++++++----
 src/libcamera/media_device.cpp                |  4 ++--
 src/libcamera/message.cpp                     |  2 +-
 test/libtest/test.h                           |  2 +-
 test/media_device/media_device_print_test.cpp |  8 ++++----
 5 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/libcamera/include/media_object.h b/src/libcamera/include/media_object.h
index 2a3ffc06c876..748eafdc880b 100644
--- a/src/libcamera/include/media_object.h
+++ b/src/libcamera/include/media_object.h
@@ -27,9 +27,11 @@ public:
 protected:
 	friend class MediaDevice;
 
-	MediaObject(MediaDevice *dev, unsigned int id) :
-		dev_(dev), id_(id) { }
-	virtual ~MediaObject() { }
+	MediaObject(MediaDevice *dev, unsigned int id)
+		: dev_(dev), id_(id)
+	{
+	}
+	virtual ~MediaObject() {}
 
 	MediaDevice *dev_;
 	unsigned int id_;
@@ -49,7 +51,7 @@ private:
 	MediaLink(const struct media_v2_link *link,
 		  MediaPad *source, MediaPad *sink);
 	MediaLink(const MediaLink &) = delete;
-	~MediaLink() { }
+	~MediaLink() {}
 
 	MediaPad *source_;
 	MediaPad *sink_;
diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp
index 0d6630fbd1f4..e1ae34f88455 100644
--- a/src/libcamera/media_device.cpp
+++ b/src/libcamera/media_device.cpp
@@ -199,7 +199,7 @@ void MediaDevice::unlock()
  */
 int MediaDevice::populate()
 {
-	struct media_v2_topology topology = { };
+	struct media_v2_topology topology = {};
 	struct media_v2_entity *ents = nullptr;
 	struct media_v2_interface *interfaces = nullptr;
 	struct media_v2_link *links = nullptr;
@@ -767,7 +767,7 @@ void MediaDevice::fixupEntityFlags(struct media_v2_entity *entity)
  */
 int MediaDevice::setupLink(const MediaLink *link, unsigned int flags)
 {
-	struct media_link_desc linkDesc = { };
+	struct media_link_desc linkDesc = {};
 	MediaPad *source = link->source();
 	MediaPad *sink = link->sink();
 
diff --git a/src/libcamera/message.cpp b/src/libcamera/message.cpp
index c547895362f3..c35bb33dfeda 100644
--- a/src/libcamera/message.cpp
+++ b/src/libcamera/message.cpp
@@ -93,7 +93,7 @@ Message::~Message()
  * class MyCustomMessage : public Message
  * {
  * public:
- *	MyCustomMessage() : Message(type()) { }
+ *	MyCustomMessage() : Message(type()) {}
  *
  *	static Message::Type type()
  *	{
diff --git a/test/libtest/test.h b/test/libtest/test.h
index ec08bf97c03d..26d4b94bc12d 100644
--- a/test/libtest/test.h
+++ b/test/libtest/test.h
@@ -26,7 +26,7 @@ public:
 protected:
 	virtual int init() { return 0; }
 	virtual int run() = 0;
-	virtual void cleanup() { }
+	virtual void cleanup() {}
 };
 
 #define TEST_REGISTER(klass)						\
diff --git a/test/media_device/media_device_print_test.cpp b/test/media_device/media_device_print_test.cpp
index 8dd8a151266d..5018906c75e7 100644
--- a/test/media_device/media_device_print_test.cpp
+++ b/test/media_device/media_device_print_test.cpp
@@ -26,13 +26,13 @@ using namespace std;
 class MediaDevicePrintTest : public Test
 {
 public:
-	MediaDevicePrintTest() { }
-	~MediaDevicePrintTest() { }
+	MediaDevicePrintTest() {}
+	~MediaDevicePrintTest() {}
 
 protected:
 	int init() { return 0; }
 	int run();
-	void cleanup() { }
+	void cleanup() {}
 
 private:
 	int testMediaDevice(string deviceNode);
@@ -137,7 +137,7 @@ int MediaDevicePrintTest::run()
 	 */
 	for (i = 0; i < MAX_MEDIA_DEV; i++) {
 		string mediadev = deviceNode + to_string(i);
-		struct stat pstat = { };
+		struct stat pstat = {};
 
 		if (stat(mediadev.c_str(), &pstat))
 			continue;
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list