Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all operator member functions const #461

Merged
merged 1 commit into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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