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:
@@ -75,7 +75,7 @@ public:
|
||||
const LogCategory &category() const { return category_; }
|
||||
const std::string &fileInfo() const { return fileInfo_; }
|
||||
const std::string &prefix() const { return prefix_; }
|
||||
const std::string msg() const { return msgStream_.str(); }
|
||||
std::string msg() const { return msgStream_.str(); }
|
||||
|
||||
private:
|
||||
LIBCAMERA_DISABLE_COPY_AND_MOVE(LogMessage)
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
int x;
|
||||
int y;
|
||||
|
||||
const std::string toString() const;
|
||||
std::string toString() const;
|
||||
|
||||
constexpr Point operator-() const
|
||||
{
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
unsigned int height;
|
||||
|
||||
bool isNull() const { return !width && !height; }
|
||||
const std::string toString() const;
|
||||
std::string toString() const;
|
||||
|
||||
Size &alignDownTo(unsigned int hAlignment, unsigned int vAlignment)
|
||||
{
|
||||
@@ -275,7 +275,7 @@ public:
|
||||
unsigned int height;
|
||||
|
||||
bool isNull() const { return !width && !height; }
|
||||
const std::string toString() const;
|
||||
std::string toString() const;
|
||||
|
||||
Point center() const;
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
~Matrix() = default;
|
||||
|
||||
const std::string toString() const
|
||||
std::string toString() const
|
||||
{
|
||||
std::stringstream out;
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ struct V4L2SubdeviceFormat {
|
||||
Size size;
|
||||
std::optional<ColorSpace> colorSpace;
|
||||
|
||||
const std::string toString() const;
|
||||
std::string toString() const;
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const V4L2SubdeviceFormat &f);
|
||||
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
std::array<Plane, 3> planes;
|
||||
unsigned int planesCount = 0;
|
||||
|
||||
const std::string toString() const;
|
||||
std::string toString() const;
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const V4L2DeviceFormat &f);
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user