diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-08-05 19:02:55 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-08-09 22:22:17 +0300 |
commit | 1a6c7477fda7c6cfbf3483c529aebf64d7ed6a8e (patch) | |
tree | 7bbeb5a67cb7ef2b3de97673280e12f645e948d1 /src/v4l2/v4l2_camera_proxy.h | |
parent | 1590e9b2b8c1b8b120a9b0dd6a53f4ef1298b2a0 (diff) |
libcamera: yaml_parser: Return nullopt on error from YamlObject::get()
The YamlParser::get<>() function returns an std::optional<> to indicate
when YAML parsing failed.
The current implementation returns a default constructed std::optional
in case of errors with
return {};
This has been reported as generating compiler warnings with a gcc 9.3.0
arm64 cross-compiler:
../src/libcamera/yaml_parser.cpp:184:11: error: ‘<anonymous>’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
184 | return {};
| ^
Replace this with an explicit
return std::nullopt;
which fixes the warnings and conveys the purpose more explicitly.
Reported-by: Christian Rauch <Rauch.Christian@gmx.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/v4l2/v4l2_camera_proxy.h')
0 files changed, 0 insertions, 0 deletions