v4l2: camera: Prevent shadowing within V4L2Camera::Buffer

Rename the internal member variables to use the post-fixed '_' member
variable naming style. This in turn ensures variable shadowing does not
occur in the member initializer list of the constructor.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Kieran Bingham 2020-10-21 16:11:48 +01:00
parent a3ed067996
commit 32d78a7bba
2 changed files with 5 additions and 5 deletions

View file

@ -26,12 +26,12 @@ class V4L2Camera
public: public:
struct Buffer { struct Buffer {
Buffer(unsigned int index, const FrameMetadata &data) Buffer(unsigned int index, const FrameMetadata &data)
: index(index), data(data) : index_(index), data_(data)
{ {
} }
unsigned int index; unsigned int index_;
FrameMetadata data; FrameMetadata data_;
}; };
V4L2Camera(std::shared_ptr<Camera> camera); V4L2Camera(std::shared_ptr<Camera> camera);

View file

@ -206,8 +206,8 @@ void V4L2CameraProxy::updateBuffers()
{ {
std::vector<V4L2Camera::Buffer> completedBuffers = vcam_->completedBuffers(); std::vector<V4L2Camera::Buffer> completedBuffers = vcam_->completedBuffers();
for (const V4L2Camera::Buffer &buffer : completedBuffers) { for (const V4L2Camera::Buffer &buffer : completedBuffers) {
const FrameMetadata &fmd = buffer.data; const FrameMetadata &fmd = buffer.data_;
struct v4l2_buffer &buf = buffers_[buffer.index]; struct v4l2_buffer &buf = buffers_[buffer.index_];
switch (fmd.status) { switch (fmd.status) {
case FrameMetadata::FrameSuccess: case FrameMetadata::FrameSuccess: