mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
libcamera: camera: Fix unused variable compiler warning
When compiling with gcc 8.4.0, the compiler was reported to throw an
unused variable warning:
../src/libcamera/camera.cpp: In member function ‘libcamera::CameraConfiguration::Status libcamera::CameraConfiguration::validateColorSpaces(libcamera::CameraConfiguration::ColorSpaceFlags)’:
../src/libcamera/camera.cpp:497:19: error: unused variable ‘i’ [-Werror=unused-variable]
for (auto [i, cfg] : utils::enumerate(config_)) {
^
The build environment may have been incorrect as the problem couldn't be
reproduced with gcc 8.3.0 and 8.5.0. Nonetheless, the 'i' variable is
indeed unused. It turns out that the code can be simplified, as the
commit that removed usage of the variable kept the now unneeded
utils::enumerate() call.
Simplify the code and fix the warning in one go.
Fixes: 13986d6ce3
("libcamera: camera: Fix validateColorSpaces to choose "main" colour space")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
41d6e6e5c1
commit
4843f72b13
1 changed files with 1 additions and 1 deletions
|
@ -494,7 +494,7 @@ CameraConfiguration::Status CameraConfiguration::validateColorSpaces(ColorSpaceF
|
||||||
std::optional<ColorSpace> colorSpace;
|
std::optional<ColorSpace> colorSpace;
|
||||||
Size size;
|
Size size;
|
||||||
|
|
||||||
for (auto [i, cfg] : utils::enumerate(config_)) {
|
for (StreamConfiguration &cfg : config_) {
|
||||||
if (!cfg.colorSpace)
|
if (!cfg.colorSpace)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue