Message ID | 20200724142120.95538-2-jacopo@jmondi.org |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Jacopo, On 24/07/2020 15:21, Jacopo Mondi wrote: > The CameraMetadata::isValid() method does not modify the object state > and can be called on const instances of the CameraMetadata class. > > Mark the method as const to allow that. > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > src/android/camera_metadata.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h > index 75a9d7066f31..348a018165ef 100644 > --- a/src/android/camera_metadata.h > +++ b/src/android/camera_metadata.h > @@ -17,7 +17,7 @@ public: > CameraMetadata(size_t entryCapacity, size_t dataCapacity); > ~CameraMetadata(); > > - bool isValid() { return valid_; } > + bool isValid() const { return valid_; } > bool addEntry(uint32_t tag, const void *data, size_t data_count); > > camera_metadata_t *get(); >
Hi Jacopo, Thank you for the patch. On Fri, Jul 24, 2020 at 04:21:15PM +0200, Jacopo Mondi wrote: > The CameraMetadata::isValid() method does not modify the object state > and can be called on const instances of the CameraMetadata class. > > Mark the method as const to allow that. > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/android/camera_metadata.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h > index 75a9d7066f31..348a018165ef 100644 > --- a/src/android/camera_metadata.h > +++ b/src/android/camera_metadata.h > @@ -17,7 +17,7 @@ public: > CameraMetadata(size_t entryCapacity, size_t dataCapacity); > ~CameraMetadata(); > > - bool isValid() { return valid_; } > + bool isValid() const { return valid_; } > bool addEntry(uint32_t tag, const void *data, size_t data_count); > > camera_metadata_t *get();
diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h index 75a9d7066f31..348a018165ef 100644 --- a/src/android/camera_metadata.h +++ b/src/android/camera_metadata.h @@ -17,7 +17,7 @@ public: CameraMetadata(size_t entryCapacity, size_t dataCapacity); ~CameraMetadata(); - bool isValid() { return valid_; } + bool isValid() const { return valid_; } bool addEntry(uint32_t tag, const void *data, size_t data_count); camera_metadata_t *get();
The CameraMetadata::isValid() method does not modify the object state and can be called on const instances of the CameraMetadata class. Mark the method as const to allow that. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> --- src/android/camera_metadata.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)