[libcamera-devel] [PATCH] ipc: ipa_data_serializer: Use cend() in deserializers
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Tue Oct 18 11:40:24 CEST 2022
Hi Paul,
Thank you for the patch.
On Tue, Oct 18, 2022 at 06:34:49PM +0900, Paul Elder via libcamera-devel wrote:
> The overloaded deserializers functions that called the main deserializer
> function using iterators used cbegin() but end() instead of cend(). Make
> all of these use cend() instead.
>
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> include/libcamera/internal/ipa_data_serializer.h | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h
> index 30bdaebc..54895b87 100644
> --- a/include/libcamera/internal/ipa_data_serializer.h
> +++ b/include/libcamera/internal/ipa_data_serializer.h
> @@ -134,7 +134,7 @@ public:
>
> static std::vector<V> deserialize(std::vector<uint8_t> &data, ControlSerializer *cs = nullptr)
> {
> - return deserialize(data.cbegin(), data.end(), cs);
> + return deserialize(data.cbegin(), data.cend(), cs);
> }
>
> static std::vector<V> deserialize(std::vector<uint8_t>::const_iterator dataBegin,
> @@ -142,13 +142,13 @@ public:
> ControlSerializer *cs = nullptr)
> {
> std::vector<SharedFD> fds;
> - return deserialize(dataBegin, dataEnd, fds.cbegin(), fds.end(), cs);
> + return deserialize(dataBegin, dataEnd, fds.cbegin(), fds.cend(), cs);
> }
>
> static std::vector<V> deserialize(std::vector<uint8_t> &data, std::vector<SharedFD> &fds,
> ControlSerializer *cs = nullptr)
> {
> - return deserialize(data.cbegin(), data.end(), fds.cbegin(), fds.end(), cs);
> + return deserialize(data.cbegin(), data.cend(), fds.cbegin(), fds.cend(), cs);
> }
>
> static std::vector<V> deserialize(std::vector<uint8_t>::const_iterator dataBegin,
> @@ -240,7 +240,7 @@ public:
>
> static std::map<K, V> deserialize(std::vector<uint8_t> &data, ControlSerializer *cs = nullptr)
> {
> - return deserialize(data.cbegin(), data.end(), cs);
> + return deserialize(data.cbegin(), data.cend(), cs);
> }
>
> static std::map<K, V> deserialize(std::vector<uint8_t>::const_iterator dataBegin,
> @@ -248,13 +248,13 @@ public:
> ControlSerializer *cs = nullptr)
> {
> std::vector<SharedFD> fds;
> - return deserialize(dataBegin, dataEnd, fds.cbegin(), fds.end(), cs);
> + return deserialize(dataBegin, dataEnd, fds.cbegin(), fds.cend(), cs);
> }
>
> static std::map<K, V> deserialize(std::vector<uint8_t> &data, std::vector<SharedFD> &fds,
> ControlSerializer *cs = nullptr)
> {
> - return deserialize(data.cbegin(), data.end(), fds.cbegin(), fds.end(), cs);
> + return deserialize(data.cbegin(), data.cend(), fds.cbegin(), fds.cend(), cs);
> }
>
> static std::map<K, V> deserialize(std::vector<uint8_t>::const_iterator dataBegin,
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list