[PATCH 0/2] libcamera: Add utils::to_underlying() helper

Naushir Patuck naush at raspberrypi.com
Tue Feb 27 10:38:53 CET 2024


Hi Laurent,

Thanks for the fix.  For both patches:

Reviewed-by: Naushir Patuck <naush at raspberrypi.com>


On Sun, 25 Feb 2024 at 16:43, Laurent Pinchart
<laurent.pinchart at ideasonboard.com> wrote:
>
> Hello,
>
> C++23 has a std::to_underlying() helper that casts an enumeration to its
> underlying type. libcamera open-codes this in multiple places. This
> series adds an identical helper to the utils:: namespace, and uses it to
> replace the open-coded implementations.
>
> Laurent Pinchart (2):
>   libcamera: utils: Add to_underlying() helper function
>   libcamera: Use utils::to_underlying()
>
>  include/libcamera/base/utils.h                 |  6 ++++++
>  src/ipa/rpi/controller/rpi/sdn.cpp             |  3 ++-
>  src/libcamera/base/utils.cpp                   | 10 ++++++++++
>  src/libcamera/pipeline/rpi/common/rpi_stream.h | 10 +++-------
>  src/libcamera/stream.cpp                       |  2 +-
>  5 files changed, 22 insertions(+), 9 deletions(-)
>
>
> base-commit: 059bbcdc34e7d887ee02fdd47613bd6e0eb70d16
> --
> Regards,
>
> Laurent Pinchart
>


More information about the libcamera-devel mailing list