[libcamera-devel] [PATCH 2/4] android: camera_metadata: Constify argument to addEntry() and updateEntry()

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat May 15 20:38:24 CEST 2021


The addEntry() and updateEntry() overrides that take a reference to a
container don't need to modify the container. Make it const.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 src/android/camera_metadata.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h
index 56df6f1c9008..f95c34581fe4 100644
--- a/src/android/camera_metadata.h
+++ b/src/android/camera_metadata.h
@@ -42,7 +42,7 @@ public:
 
 	template<typename S,
 		 typename T = typename S::value_type>
-	bool addEntry(uint32_t tag, S &data)
+	bool addEntry(uint32_t tag, const S &data)
 	{
 		return addEntry(tag, data.data(), data.size(), sizeof(T));
 	}
@@ -67,7 +67,7 @@ public:
 
 	template<typename S,
 		 typename T = typename S::value_type>
-	bool updateEntry(uint32_t tag, S &data)
+	bool updateEntry(uint32_t tag, const S &data)
 	{
 		return updateEntry(tag, data.data(), data.size());
 	}
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list