Skip to content

Commit

Permalink
Merge pull request #461 from atsampson/constoperators
Browse files Browse the repository at this point in the history
Make all operator member functions const
  • Loading branch information
Simon Inns authored Feb 11, 2020
2 parents e14594d + 4297b39 commit c46db4c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tools/ld-chroma-decoder/yiq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ YIQ::YIQ(qreal _y, qreal _i, qreal _q)
{
}

YIQ YIQ::operator*=(qreal x)
YIQ YIQ::operator*=(qreal x) const
{
YIQ o;

Expand All @@ -41,7 +41,7 @@ YIQ YIQ::operator*=(qreal x)
return o;
}

YIQ YIQ::operator+=(const YIQ &p)
YIQ YIQ::operator+=(const YIQ &p) const
{
YIQ o;

Expand Down
4 changes: 2 additions & 2 deletions tools/ld-chroma-decoder/yiq.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class YIQ
qreal y, i, q;

YIQ(qreal y = 0.0, qreal i = 0.0, qreal q = 0.0);
YIQ operator*=(qreal x);
YIQ operator+=(const YIQ &p);
YIQ operator*=(qreal x) const;
YIQ operator+=(const YIQ &p) const;

private:

Expand Down
2 changes: 1 addition & 1 deletion tools/ld-discmap/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void Frame::secondField(qint32 value)
}

// Overide less than operator for sorting
bool Frame::operator<(const Frame& other)
bool Frame::operator<(const Frame& other) const
{
return (m_vbiFrameNumber < other.m_vbiFrameNumber) ||
((m_vbiFrameNumber == other.m_vbiFrameNumber) && (other.m_isPullDown));
Expand Down
4 changes: 2 additions & 2 deletions tools/ld-discmap/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Frame
const qint32 &firstField = -1, const qint32 &secondField = -1);
~Frame() = default;
Frame(const Frame &) = default;
Frame &operator =(const Frame &) = default;
Frame &operator=(const Frame &) = default;

// Get
qint32 seqFrameNumber() const;
Expand Down Expand Up @@ -66,7 +66,7 @@ class Frame
void secondField(qint32 value);

// Operators
bool operator <(const Frame &);
bool operator<(const Frame &) const;

private:
qint32 m_seqFrameNumber;
Expand Down

0 comments on commit c46db4c

Please sign in to comment.