[libcamera-devel] [PATCH 0/3] Use std::array where applicable

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Jan 20 18:38:13 CET 2020


Hello,

This patch series extends the previously posted "[PATCH 05/19]
libcamera: Replace ARRAY_SIZE with std::array" with a
utils::make_array() helper function.

As pointed out during review, having to manually specify the std::array
size for const arrays is not only tedious, but is also error-prone as
the array can be declared as larger than the initializer list without
any warning from the compiler. To fix this, patch 1/3 introduces
utils::make_array(), borrowed from the experimental std::make_array()
function. Patch 2/3 uses the new helper where applicable, and patch 3/3
is a rebased version of the previously posted ARRAY_SIZE removal patch
based on utils::make_array().

Laurent Pinchart (3):
  libcamera: utils: Add a new make_array() function
  libcamera: Use utils::make_array()
  libcamera: Replace ARRAY_SIZE with std::array

 Documentation/Doxyfile.in                |  1 +
 src/libcamera/camera.cpp                 | 13 +++----
 src/libcamera/include/utils.h            | 44 ++++++++++++++++++++++--
 src/libcamera/ipa_module.cpp             | 11 +++---
 src/libcamera/log.cpp                    | 23 +++++++------
 src/libcamera/pipeline/rkisp1/rkisp1.cpp |  6 ++--
 src/libcamera/pipeline/vimc.cpp          |  6 ++--
 src/libcamera/stream.cpp                 |  6 ++--
 src/libcamera/utils.cpp                  | 19 +++++++---
 src/libcamera/v4l2_videodevice.cpp       |  7 ++--
 src/v4l2/v4l2_camera_proxy.cpp           | 30 ++++++++--------
 test/ipc/unixsocket.cpp                  |  8 ++---
 12 files changed, 114 insertions(+), 60 deletions(-)

-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list