Merge branch 'gcc7-conv-warn'
See https://github.com/wxWidgets/wxWidgets/pull/754
This commit is contained in:
@@ -292,8 +292,8 @@ public:
|
|||||||
wxSize& operator*=(long i) { x *= i; y *= i; return *this; }
|
wxSize& operator*=(long i) { x *= i; y *= i; return *this; }
|
||||||
wxSize& operator/=(unsigned long i) { x /= i; y /= i; return *this; }
|
wxSize& operator/=(unsigned long i) { x /= i; y /= i; return *this; }
|
||||||
wxSize& operator*=(unsigned long i) { x *= i; y *= i; return *this; }
|
wxSize& operator*=(unsigned long i) { x *= i; y *= i; return *this; }
|
||||||
wxSize& operator/=(double i) { x = int(x/i); y = int(y/i); return *this; }
|
wxSize& operator/=(double i) { x = wxRound(x/i); y = wxRound(y/i); return *this; }
|
||||||
wxSize& operator*=(double i) { x = int(x*i); y = int(y*i); return *this; }
|
wxSize& operator*=(double i) { x = wxRound(x*i); y = wxRound(y*i); return *this; }
|
||||||
|
|
||||||
void IncTo(const wxSize& sz)
|
void IncTo(const wxSize& sz)
|
||||||
{ if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; }
|
{ if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; }
|
||||||
@@ -318,8 +318,8 @@ public:
|
|||||||
void DecBy(int d) { DecBy(d, d); }
|
void DecBy(int d) { DecBy(d, d); }
|
||||||
|
|
||||||
|
|
||||||
wxSize& Scale(float xscale, float yscale)
|
wxSize& Scale(double xscale, double yscale)
|
||||||
{ x = (int)(x*xscale); y = (int)(y*yscale); return *this; }
|
{ x = wxRound(x*xscale); y = wxRound(y*yscale); return *this; }
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
void Set(int xx, int yy) { x = xx; y = yy; }
|
void Set(int xx, int yy) { x = xx; y = yy; }
|
||||||
@@ -428,12 +428,12 @@ inline wxSize operator*(unsigned long i, const wxSize& s)
|
|||||||
|
|
||||||
inline wxSize operator*(const wxSize& s, double i)
|
inline wxSize operator*(const wxSize& s, double i)
|
||||||
{
|
{
|
||||||
return wxSize(int(s.x * i), int(s.y * i));
|
return wxSize(wxRound(s.x * i), wxRound(s.y * i));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline wxSize operator*(double i, const wxSize& s)
|
inline wxSize operator*(double i, const wxSize& s)
|
||||||
{
|
{
|
||||||
return wxSize(int(s.x * i), int(s.y * i));
|
return wxSize(wxRound(s.x * i), wxRound(s.y * i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -547,12 +547,12 @@ inline wxRealPoint operator*(unsigned long i, const wxRealPoint& s)
|
|||||||
|
|
||||||
inline wxRealPoint operator*(const wxRealPoint& s, double i)
|
inline wxRealPoint operator*(const wxRealPoint& s, double i)
|
||||||
{
|
{
|
||||||
return wxRealPoint(int(s.x * i), int(s.y * i));
|
return wxRealPoint(s.x * i, s.y * i);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline wxRealPoint operator*(double i, const wxRealPoint& s)
|
inline wxRealPoint operator*(double i, const wxRealPoint& s)
|
||||||
{
|
{
|
||||||
return wxRealPoint(int(s.x * i), int(s.y * i));
|
return wxRealPoint(s.x * i, s.y * i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -567,7 +567,7 @@ public:
|
|||||||
|
|
||||||
wxPoint() : x(0), y(0) { }
|
wxPoint() : x(0), y(0) { }
|
||||||
wxPoint(int xx, int yy) : x(xx), y(yy) { }
|
wxPoint(int xx, int yy) : x(xx), y(yy) { }
|
||||||
wxPoint(const wxRealPoint& pt) : x(int(pt.x)), y(int(pt.y)) { }
|
wxPoint(const wxRealPoint& pt) : x(wxRound(pt.x)), y(wxRound(pt.y)) { }
|
||||||
|
|
||||||
// no copy ctor or assignment operator - the defaults are ok
|
// no copy ctor or assignment operator - the defaults are ok
|
||||||
|
|
||||||
|
@@ -93,14 +93,14 @@ public:
|
|||||||
static wxUint16 HighSurrogate(wxUint32 value)
|
static wxUint16 HighSurrogate(wxUint32 value)
|
||||||
{
|
{
|
||||||
wxASSERT_MSG(IsSupplementary(value), "wxUniChar::HighSurrogate() must be called on a supplementary character");
|
wxASSERT_MSG(IsSupplementary(value), "wxUniChar::HighSurrogate() must be called on a supplementary character");
|
||||||
return 0xD800 | ((value - 0x10000) >> 10);
|
return static_cast<wxUint16>(0xD800 | ((value - 0x10000) >> 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the low surrogate code unit for the supplementary character
|
// Returns the low surrogate code unit for the supplementary character
|
||||||
static wxUint16 LowSurrogate(wxUint32 value)
|
static wxUint16 LowSurrogate(wxUint32 value)
|
||||||
{
|
{
|
||||||
wxASSERT_MSG(IsSupplementary(value), "wxUniChar::LowSurrogate() must be called on a supplementary character");
|
wxASSERT_MSG(IsSupplementary(value), "wxUniChar::LowSurrogate() must be called on a supplementary character");
|
||||||
return 0xDC00 | ((value - 0x10000) & 0x03FF);
|
return static_cast<wxUint16>(0xDC00 | ((value - 0x10000) & 0x03FF));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the character is a BMP character:
|
// Returns true if the character is a BMP character:
|
||||||
|
@@ -1014,7 +1014,7 @@ public:
|
|||||||
@return A reference to this object (so that you can concatenate other
|
@return A reference to this object (so that you can concatenate other
|
||||||
operations in the same line).
|
operations in the same line).
|
||||||
*/
|
*/
|
||||||
wxSize& Scale(float xscale, float yscale);
|
wxSize& Scale(double xscale, double yscale);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the width and height members.
|
Sets the width and height members.
|
||||||
|
Reference in New Issue
Block a user