summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-15 16:58:55 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-16 18:23:43 +0200
commitf388aa7041d90cbc957e33ff90a5122a3c5237e6 (patch)
treebcbd090297cb24da3cba6adbc135ebdb08e03c25 /src
parent3e6090a17aa06a654588c395748f81d3c821d033 (diff)
libcamera: device_enumerator: Don't mark the search() function as const
While the DeviceEnumerator::search() function doesn't modify the instance directly, it returns a non-const pointer to a MediaEntity that is owned by the DeviceEnumerator instance. This breaks the const semantics. Don't mark the function as const. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/device_enumerator.cpp2
-rw-r--r--src/libcamera/include/device_enumerator.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
index 1653e4f4..18d7e868 100644
--- a/src/libcamera/device_enumerator.cpp
+++ b/src/libcamera/device_enumerator.cpp
@@ -245,7 +245,7 @@ int DeviceEnumerator::addDevice(const std::string &devnode)
*
* \return pointer to the matching MediaDevice, or nullptr if no match is found
*/
-MediaDevice *DeviceEnumerator::search(const DeviceMatch &dm) const
+MediaDevice *DeviceEnumerator::search(const DeviceMatch &dm)
{
for (MediaDevice *dev : devices_) {
if (dev->busy())
diff --git a/src/libcamera/include/device_enumerator.h b/src/libcamera/include/device_enumerator.h
index 29737da7..b68c8158 100644
--- a/src/libcamera/include/device_enumerator.h
+++ b/src/libcamera/include/device_enumerator.h
@@ -41,7 +41,7 @@ public:
virtual int init() = 0;
virtual int enumerate() = 0;
- MediaDevice *search(const DeviceMatch &dm) const;
+ MediaDevice *search(const DeviceMatch &dm);
protected:
int addDevice(const std::string &devnode);