diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2015-07-18 18:31:33 +0300 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2015-07-20 00:36:47 +0300 |
commit | cbc9002fb0bacb69fb3c0eaa7b30ba320a12aced (patch) | |
tree | cb722a35c81d790d1e09b4d16dbfff122007db3b /src | |
parent | 39cb7e7f76380d2dcb3c88ed5c715a4a93f2a810 (diff) |
Pass STSStyle as const reference to fix warning C4239.
It is funny that MSVC even allow to pass r-value as non-const
reference.
Diffstat (limited to 'src')
-rw-r--r-- | src/Subtitles/RTS.cpp | 8 | ||||
-rw-r--r-- | src/Subtitles/RTS.h | 8 | ||||
-rw-r--r-- | src/Subtitles/STS.cpp | 4 | ||||
-rw-r--r-- | src/Subtitles/STS.h | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/Subtitles/RTS.cpp b/src/Subtitles/RTS.cpp index c4fda9699..8796bc80f 100644 --- a/src/Subtitles/RTS.cpp +++ b/src/Subtitles/RTS.cpp @@ -40,7 +40,7 @@ static long revcolor(long c) // CMyFont
-CMyFont::CMyFont(STSStyle& style)
+CMyFont::CMyFont(const STSStyle& style)
{
LOGFONT lf;
ZeroMemory(&lf, sizeof(lf));
@@ -66,7 +66,7 @@ CMyFont::CMyFont(STSStyle& style) // CWord
-CWord::CWord(STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley,
+CWord::CWord(const STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley,
RenderingCaches& renderingCaches)
: m_fDrawn(false)
, m_p(INT_MAX, INT_MAX)
@@ -422,7 +422,7 @@ void CWord::Transform_SSE2(const CPoint& org) // CText
-CText::CText(STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley,
+CText::CText(const STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley,
RenderingCaches& renderingCaches)
: CWord(style, str, ktype, kstart, kend, scalex, scaley, renderingCaches)
{
@@ -533,7 +533,7 @@ bool CText::CreatePath() // CPolygon
-CPolygon::CPolygon(STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley, int baseline,
+CPolygon::CPolygon(const STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley, int baseline,
RenderingCaches& renderingCaches)
: CWord(style, str, ktype, kstart, kend, scalex, scaley, renderingCaches)
, m_baseline(baseline)
diff --git a/src/Subtitles/RTS.h b/src/Subtitles/RTS.h index b2660d458..0e29b97d2 100644 --- a/src/Subtitles/RTS.h +++ b/src/Subtitles/RTS.h @@ -66,7 +66,7 @@ class CMyFont : public CFont public:
int m_ascent, m_descent;
- CMyFont(STSStyle& style);
+ CMyFont(const STSStyle& style);
};
struct CTextDims {
@@ -107,7 +107,7 @@ public: int m_width, m_ascent, m_descent;
// str[0] = 0 -> m_fLineBreak = true (in this case we only need and use the height of m_font from the whole class)
- CWord(STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley,
+ CWord(const STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley,
RenderingCaches& renderingCaches);
virtual ~CWord();
@@ -125,7 +125,7 @@ protected: virtual bool CreatePath();
public:
- CText(STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley,
+ CText(const STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley,
RenderingCaches& renderingCaches);
virtual CWord* Copy();
@@ -145,7 +145,7 @@ protected: virtual bool CreatePath();
public:
- CPolygon(STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley, int baseline,
+ CPolygon(const STSStyle& style, CStringW str, int ktype, int kstart, int kend, double scalex, double scaley, int baseline,
RenderingCaches& renderingCaches);
CPolygon(CPolygon&); // can't use a const reference because we need to use CAtlArray::Copy which expects a non-const reference
virtual ~CPolygon();
diff --git a/src/Subtitles/STS.cpp b/src/Subtitles/STS.cpp index 29a38650f..24300dc55 100644 --- a/src/Subtitles/STS.cpp +++ b/src/Subtitles/STS.cpp @@ -3040,7 +3040,7 @@ STSStyle& STSStyle::operator = (LOGFONT& lf) return *this;
}
-LOGFONTA& operator <<= (LOGFONTA& lfa, STSStyle& s)
+LOGFONTA& operator <<= (LOGFONTA& lfa, const STSStyle& s)
{
lfa.lfCharSet = (BYTE)s.charSet;
strncpy_s(lfa.lfFaceName, LF_FACESIZE, CStringA(s.fontName), _TRUNCATE);
@@ -3054,7 +3054,7 @@ LOGFONTA& operator <<= (LOGFONTA& lfa, STSStyle& s) return lfa;
}
-LOGFONTW& operator <<= (LOGFONTW& lfw, STSStyle& s)
+LOGFONTW& operator <<= (LOGFONTW& lfw, const STSStyle& s)
{
lfw.lfCharSet = (BYTE)s.charSet;
wcsncpy_s(lfw.lfFaceName, LF_FACESIZE, CStringW(s.fontName), _TRUNCATE);
diff --git a/src/Subtitles/STS.h b/src/Subtitles/STS.h index 5803f9d88..b927b7052 100644 --- a/src/Subtitles/STS.h +++ b/src/Subtitles/STS.h @@ -72,8 +72,8 @@ public: STSStyle& operator = (LOGFONT& lf);
- friend LOGFONTA& operator <<= (LOGFONTA& lfa, STSStyle& s);
- friend LOGFONTW& operator <<= (LOGFONTW& lfw, STSStyle& s);
+ friend LOGFONTA& operator <<= (LOGFONTA& lfa, const STSStyle& s);
+ friend LOGFONTW& operator <<= (LOGFONTW& lfw, const STSStyle& s);
friend CString& operator <<= (CString& style, const STSStyle& s);
friend STSStyle& operator <<= (STSStyle& s, const CString& style);
|