[libcamera-devel] [PATCH v3 1/8] libcamera: utils: Define BIT() macro
Niklas Söderlund
niklas.soderlund at ragnatech.se
Fri Apr 5 13:06:56 CEST 2019
Hi Jacopo,
Thanks for your patch.
On 2019-04-03 17:07:28 +0200, Jacopo Mondi wrote:
> Define BIT(b_) macro which expands to a left bit shift.
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> src/libcamera/include/utils.h | 1 +
> src/libcamera/utils.cpp | 5 +++++
> 2 files changed, 6 insertions(+)
>
> diff --git a/src/libcamera/include/utils.h b/src/libcamera/include/utils.h
> index 79038a96feab..1a6cf7f7b9dc 100644
> --- a/src/libcamera/include/utils.h
> +++ b/src/libcamera/include/utils.h
> @@ -10,6 +10,7 @@
> #include <memory>
>
> #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
> +#define BIT(b_) (1 << (b_))
>
> namespace libcamera {
>
> diff --git a/src/libcamera/utils.cpp b/src/libcamera/utils.cpp
> index cd0fd7614cc7..1a5a2a03b1ca 100644
> --- a/src/libcamera/utils.cpp
> +++ b/src/libcamera/utils.cpp
> @@ -24,6 +24,11 @@ namespace utils {
> * \brief Determine the number of elements in the static array.
> */
>
> +/**
> + * \def BIT(b)
> + * \brief Bitwise left shift by \a b bits
> + */
> +
> /**
> * \brief Strip the directory prefix from the path
> * \param[in] path The path to process
> --
> 2.21.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list