treewide: Remove top-level const from return types

Top-level `const` qualifiers are not useful, so avoid them. This is done
either by simply removing the top-level `const`, or making the function
return a reference to const where that is appropriate.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze
2025-08-11 12:21:32 +02:00
parent 3b72e7d306
commit 14882b8314
12 changed files with 20 additions and 20 deletions
+2 -2
View File
@@ -97,9 +97,9 @@ public:
bool isImmutable() const { return flags_ & DRM_MODE_PROP_IMMUTABLE; }
const std::vector<uint64_t> values() const { return values_; }
const std::vector<uint64_t> &values() const { return values_; }
const std::map<uint32_t, std::string> &enums() const { return enums_; }
const std::vector<uint32_t> blobs() const { return blobs_; }
const std::vector<uint32_t> &blobs() const { return blobs_; }
private:
Type type_;
+1 -1
View File
@@ -36,7 +36,7 @@ public:
}
size_t bins() const { return cumulative_.size() - 1; }
const Span<const uint64_t> data() const { return cumulative_; }
Span<const uint64_t> data() const { return cumulative_; }
uint64_t total() const { return cumulative_[cumulative_.size() - 1]; }
uint64_t cumulativeFrequency(double bin) const;
double quantile(double q, uint32_t first = 0, uint32_t last = UINT_MAX) const;
+3 -3
View File
@@ -53,7 +53,7 @@ namespace libcamera {
* \brief Assemble and return a string describing the point
* \return A string describing the point
*/
const std::string Point::toString() const
std::string Point::toString() const
{
std::stringstream ss;
ss << *this;
@@ -133,7 +133,7 @@ std::ostream &operator<<(std::ostream &out, const Point &p)
* \brief Assemble and return a string describing the size
* \return A string describing the size
*/
const std::string Size::toString() const
std::string Size::toString() const
{
std::stringstream ss;
ss << *this;
@@ -676,7 +676,7 @@ std::ostream &operator<<(std::ostream &out, const SizeRange &sr)
* \brief Assemble and return a string describing the rectangle
* \return A string describing the Rectangle
*/
const std::string Rectangle::toString() const
std::string Rectangle::toString() const
{
std::stringstream ss;
ss << *this;
+1 -1
View File
@@ -105,7 +105,7 @@ public:
Status validate() override;
const StreamConfiguration &cio2Format() const { return cio2Configuration_; }
const ImgUDevice::PipeConfig imguConfig() const { return pipeConfig_; }
const ImgUDevice::PipeConfig &imguConfig() const { return pipeConfig_; }
/* Cache the combinedTransform_ that will be applied to the sensor */
Transform combinedTransform_;
+4 -4
View File
@@ -101,8 +101,8 @@ public:
int loadIPA();
/* Deflect these functionalities to either TPG or CameraSensor. */
const std::vector<Size> sizes(unsigned int mbusCode) const;
const Size resolution() const;
std::vector<Size> sizes(unsigned int mbusCode) const;
Size resolution() const;
int pixfmtToMbusCode(const PixelFormat &pixFmt) const;
const PixelFormat &bestRawFormat() const;
@@ -195,7 +195,7 @@ void MaliC55CameraData::setSensorControls(const ControlList &sensorControls)
delayedCtrls_->push(sensorControls);
}
const std::vector<Size> MaliC55CameraData::sizes(unsigned int mbusCode) const
std::vector<Size> MaliC55CameraData::sizes(unsigned int mbusCode) const
{
if (sensor_)
return sensor_->sizes(mbusCode);
@@ -218,7 +218,7 @@ const std::vector<Size> MaliC55CameraData::sizes(unsigned int mbusCode) const
return sizes;
}
const Size MaliC55CameraData::resolution() const
Size MaliC55CameraData::resolution() const
{
if (sensor_)
return sensor_->resolution();
+1 -1
View File
@@ -923,7 +923,7 @@ const MediaBusFormatInfo &MediaBusFormatInfo::info(uint32_t code)
* \brief Assemble and return a string describing the format
* \return A string describing the V4L2SubdeviceFormat
*/
const std::string V4L2SubdeviceFormat::toString() const
std::string V4L2SubdeviceFormat::toString() const
{
std::stringstream ss;
ss << *this;
+1 -1
View File
@@ -429,7 +429,7 @@ bool V4L2BufferCache::Entry::operator==(const FrameBuffer &buffer) const
* \brief Assemble and return a string describing the format
* \return A string describing the V4L2DeviceFormat
*/
const std::string V4L2DeviceFormat::toString() const
std::string V4L2DeviceFormat::toString() const
{
std::stringstream ss;
ss << *this;