[3/6] libcamera: vector: Rename data validation function
diff mbox series

Message ID 20260611011722.1767689-4-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Drop legacy mentions of YAML
Related show

Commit Message

Laurent Pinchart June 11, 2026, 1:17 a.m. UTC
The vectorValidateYaml() function predates the refactoring of YamlObject
and its rename to ValueNode. It now operates on a ValudeNode,
disconnected from the YAML parser. Rename it to
vectorValidateValueNode() accordingly.

While at it, fold consecutive __DOXYGEN__ conditional blocks into a
single one.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 include/libcamera/internal/vector.h | 6 ++----
 src/libcamera/vector.cpp            | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

Comments

Barnabás Pőcze June 15, 2026, 8:16 a.m. UTC | #1
2026. 06. 11. 3:17 keltezéssel, Laurent Pinchart írta:
> The vectorValidateYaml() function predates the refactoring of YamlObject
> and its rename to ValueNode. It now operates on a ValudeNode,
> disconnected from the YAML parser. Rename it to
> vectorValidateValueNode() accordingly.
> 
> While at it, fold consecutive __DOXYGEN__ conditional blocks into a
> single one.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>


>   include/libcamera/internal/vector.h | 6 ++----
>   src/libcamera/vector.cpp            | 2 +-
>   2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/include/libcamera/internal/vector.h b/include/libcamera/internal/vector.h
> index e3ea723d300c..093efafa8982 100644
> --- a/include/libcamera/internal/vector.h
> +++ b/include/libcamera/internal/vector.h
> @@ -343,10 +343,8 @@ bool operator!=(const Vector<T, Rows> &lhs, const Vector<T, Rows> &rhs)
>   }
>   
>   #ifndef __DOXYGEN__
> -bool vectorValidateYaml(const ValueNode &obj, unsigned int size);
> -#endif /* __DOXYGEN__ */
> +bool vectorValidateValueNode(const ValueNode &obj, unsigned int size);
>   
> -#ifndef __DOXYGEN__
>   template<typename T, unsigned int Rows>
>   std::ostream &operator<<(std::ostream &out, const Vector<T, Rows> &v)
>   {
> @@ -364,7 +362,7 @@ template<typename T, unsigned int Rows>
>   struct ValueNode::Accessor<Vector<T, Rows>> {
>   	std::optional<Vector<T, Rows>> get(const ValueNode &obj) const
>   	{
> -		if (!vectorValidateYaml(obj, Rows))
> +		if (!vectorValidateValueNode(obj, Rows))
>   			return std::nullopt;
>   
>   		Vector<T, Rows> vector;
> diff --git a/src/libcamera/vector.cpp b/src/libcamera/vector.cpp
> index 94fbf61e23ea..d850a581e32b 100644
> --- a/src/libcamera/vector.cpp
> +++ b/src/libcamera/vector.cpp
> @@ -351,7 +351,7 @@ LOG_DEFINE_CATEGORY(Vector)
>    */
>   
>   #ifndef __DOXYGEN__
> -bool vectorValidateYaml(const ValueNode &obj, unsigned int size)
> +bool vectorValidateValueNode(const ValueNode &obj, unsigned int size)
>   {
>   	if (!obj.isList())
>   		return false;

Patch
diff mbox series

diff --git a/include/libcamera/internal/vector.h b/include/libcamera/internal/vector.h
index e3ea723d300c..093efafa8982 100644
--- a/include/libcamera/internal/vector.h
+++ b/include/libcamera/internal/vector.h
@@ -343,10 +343,8 @@  bool operator!=(const Vector<T, Rows> &lhs, const Vector<T, Rows> &rhs)
 }
 
 #ifndef __DOXYGEN__
-bool vectorValidateYaml(const ValueNode &obj, unsigned int size);
-#endif /* __DOXYGEN__ */
+bool vectorValidateValueNode(const ValueNode &obj, unsigned int size);
 
-#ifndef __DOXYGEN__
 template<typename T, unsigned int Rows>
 std::ostream &operator<<(std::ostream &out, const Vector<T, Rows> &v)
 {
@@ -364,7 +362,7 @@  template<typename T, unsigned int Rows>
 struct ValueNode::Accessor<Vector<T, Rows>> {
 	std::optional<Vector<T, Rows>> get(const ValueNode &obj) const
 	{
-		if (!vectorValidateYaml(obj, Rows))
+		if (!vectorValidateValueNode(obj, Rows))
 			return std::nullopt;
 
 		Vector<T, Rows> vector;
diff --git a/src/libcamera/vector.cpp b/src/libcamera/vector.cpp
index 94fbf61e23ea..d850a581e32b 100644
--- a/src/libcamera/vector.cpp
+++ b/src/libcamera/vector.cpp
@@ -351,7 +351,7 @@  LOG_DEFINE_CATEGORY(Vector)
  */
 
 #ifndef __DOXYGEN__
-bool vectorValidateYaml(const ValueNode &obj, unsigned int size)
+bool vectorValidateValueNode(const ValueNode &obj, unsigned int size)
 {
 	if (!obj.isList())
 		return false;