typedef const value_type* const_iterator; \
typedef value_type& reference; \
typedef const value_type& const_reference; \
- typedef int difference_type; \
+ typedef ptrdiff_t difference_type; \
typedef size_t size_type; \
\
void assign(const_iterator first, const_iterator last); \
inline wxSize operator*(const wxSize& s, long i)
{
- return wxSize(s.x * i, s.y * i);
+ return wxSize(int(s.x * i), int(s.y * i));
}
inline wxSize operator*(long i, const wxSize& s)
{
- return wxSize(s.x * i, s.y * i);
+ return wxSize(int(s.x * i), int(s.y * i));
}
inline wxSize operator/(const wxSize& s, unsigned long i)
{
- return wxSize(s.x / i, s.y / i);
+ return wxSize(int(s.x / i), int(s.y / i));
}
inline wxSize operator*(const wxSize& s, unsigned long i)
{
- return wxSize(s.x * i, s.y * i);
+ return wxSize(int(s.x * i), int(s.y * i));
}
inline wxSize operator*(unsigned long i, const wxSize& s)
{
- return wxSize(s.x * i, s.y * i);
+ return wxSize(int(s.x * i), int(s.y * i));
}
inline wxSize operator*(const wxSize& s, double i)
inline wxPoint operator*(const wxPoint& s, long i)
{
- return wxPoint(s.x * i, s.y * i);
+ return wxPoint(int(s.x * i), int(s.y * i));
}
inline wxPoint operator*(long i, const wxPoint& s)
{
- return wxPoint(s.x * i, s.y * i);
+ return wxPoint(int(s.x * i), int(s.y * i));
}
inline wxPoint operator/(const wxPoint& s, unsigned long i)
inline wxPoint operator*(const wxPoint& s, unsigned long i)
{
- return wxPoint(s.x * i, s.y * i);
+ return wxPoint(int(s.x * i), int(s.y * i));
}
inline wxPoint operator*(unsigned long i, const wxPoint& s)
{
- return wxPoint(s.x * i, s.y * i);
+ return wxPoint(int(s.x * i), int(s.y * i));
}
inline wxPoint operator*(const wxPoint& s, double i)
void Add(wxColour col, float pos) { Add(wxGraphicsGradientStop(col, pos)); }
// Get the number of stops.
- unsigned GetCount() const { return m_stops.size(); }
+ size_t GetCount() const { return m_stops.size(); }
// Return the stop at the given index (which must be valid).
wxGraphicsGradientStop Item(unsigned n) const { return m_stops.at(n); }
#ifndef wxNEEDS_WX_HASH_MAP
// integer types
-class WXDLLIMPEXP_BASE wxIntegerHash
+struct WXDLLIMPEXP_BASE wxIntegerHash
{
+private:
WX_HASH_MAP_NAMESPACE::hash<long> longHash;
WX_HASH_MAP_NAMESPACE::hash<unsigned long> ulongHash;
WX_HASH_MAP_NAMESPACE::hash<int> intHash;
#else // wxNEEDS_WX_HASH_MAP
// integer types
-class WXDLLIMPEXP_BASE wxIntegerHash
+struct WXDLLIMPEXP_BASE wxIntegerHash
{
-public:
wxIntegerHash() { }
unsigned long operator()( long x ) const { return (unsigned long)x; }
unsigned long operator()( unsigned long x ) const { return x; }
#endif // !wxNEEDS_WX_HASH_MAP/wxNEEDS_WX_HASH_MAP
-class WXDLLIMPEXP_BASE wxIntegerEqual
+struct WXDLLIMPEXP_BASE wxIntegerEqual
{
-public:
wxIntegerEqual() { }
bool operator()( long a, long b ) const { return a == b; }
bool operator()( unsigned long a, unsigned long b ) const { return a == b; }
};
// pointers
-class WXDLLIMPEXP_BASE wxPointerHash
+struct WXDLLIMPEXP_BASE wxPointerHash
{
-public:
wxPointerHash() { }
#ifdef wxNEEDS_WX_HASH_MAP
wxPointerHash& operator=(const wxPointerHash&) { return *this; }
};
-class WXDLLIMPEXP_BASE wxPointerEqual
+struct WXDLLIMPEXP_BASE wxPointerEqual
{
-public:
wxPointerEqual() { }
bool operator()( const void* a, const void* b ) const { return a == b; }
};
// wxString, char*, wchar_t*
-class WXDLLIMPEXP_BASE wxStringHash
+struct WXDLLIMPEXP_BASE wxStringHash
{
-public:
wxStringHash() {}
unsigned long operator()( const wxString& x ) const
{ return stringHash( x.wx_str() ); }
wxStringHash& operator=(const wxStringHash&) { return *this; }
};
-class WXDLLIMPEXP_BASE wxStringEqual
+struct WXDLLIMPEXP_BASE wxStringEqual
{
-public:
wxStringEqual() {}
bool operator()( const wxString& a, const wxString& b ) const
{ return a == b; }
wxHtmlContainerCell *m_Parent;
// dimensions of fragment (m_Descent is used to position text & images)
- long m_Width, m_Height, m_Descent;
+ int m_Width, m_Height, m_Descent;
// position where the fragment is drawn:
- long m_PosX, m_PosY;
+ int m_PosX, m_PosY;
// superscript/subscript/normal:
wxHtmlScriptMode m_ScriptMode;
#if WXWIN_COMPATIBILITY_2_8
-inline int wxHtmlTag::GetBeginPos() const { return m_Begin - m_sourceStart; }
-inline int wxHtmlTag::GetEndPos1() const { return m_End1 - m_sourceStart; }
-inline int wxHtmlTag::GetEndPos2() const { return m_End2 - m_sourceStart; }
+inline int wxHtmlTag::GetBeginPos() const { return int(m_Begin - m_sourceStart); }
+inline int wxHtmlTag::GetEndPos1() const { return int(m_End1 - m_sourceStart); }
+inline int wxHtmlTag::GetEndPos2() const { return int(m_End2 - m_sourceStart); }
#endif // WXWIN_COMPATIBILITY_2_8
// actual hypertext link or empty string
bool m_UseLink;
// true if m_Link is not empty
- long m_CharHeight, m_CharWidth;
+ int m_CharHeight, m_CharWidth;
// average height of normal-sized text
int m_Align;
// actual alignment
} \
int IndexOf() const \
{ \
- return *this ? std::distance( m_list->begin(), m_iter ) \
+ return *this ? (int)std::distance( m_list->begin(), m_iter ) \
: wxNOT_FOUND; \
} \
}; \
inline wxLongLong operator-(unsigned long l, const wxULongLong& ull)
{
wxULongLong ret = wxULongLong(l) - ull;
- return wxLongLong((long)ret.GetHi(),ret.GetLo());
+ return wxLongLong((wxInt32)ret.GetHi(),ret.GetLo());
}
#if wxUSE_LONGLONG_NATIVE && wxUSE_STREAMS
long GetWidth() const { return GetW(); }
long GetH() const;
long GetHeight() const { return GetH(); }
- wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
+ wxRect GetRect() const { return wxRect((int)GetX(), (int)GetY(), (int)GetWidth(), (int)GetHeight()); }
private:
void SetRects(long numRects, wxRect *rects);
"Can't calculate number of cols if number of rows is not specified"
);
- return (m_children.GetCount() + m_rows - 1) / m_rows;
+ return int(m_children.GetCount() + m_rows - 1) / m_rows;
}
int CalcRows() const
"Can't calculate number of cols if number of rows is not specified"
);
- return (m_children.GetCount() + m_cols - 1) / m_cols;
+ return int(m_children.GetCount() + m_cols - 1) / m_cols;
}
private:
class WXDLLIMPEXP_CORE wxStatusBarPane
{
public:
- wxStatusBarPane(int style = wxSB_NORMAL, size_t width = 0)
+ wxStatusBarPane(int style = wxSB_NORMAL, int width = 0)
: m_nStyle(style), m_nWidth(width)
{ m_bEllipsized = false; }
// set the number of fields and call SetStatusWidths(widths) if widths are
// given
virtual void SetFieldsCount(int number = 1, const int *widths = NULL);
- int GetFieldsCount() const { return m_panes.GetCount(); }
+ int GetFieldsCount() const { return (int)m_panes.GetCount(); }
// field text
// ----------
}
virtual void Replace(long from, long to, const wxString& text)
{
- SetTargetStart(from);
- SetTargetEnd(to);
+ SetTargetStart((int)from);
+ SetTargetEnd((int)to);
ReplaceTarget(text);
}
virtual void SetInsertionPoint(long pos)
{
- SetCurrentPos(pos == -1 ? GetLastPosition() : pos);
+ SetCurrentPos(int(pos == -1 ? GetLastPosition() : pos));
}
virtual long GetInsertionPoint() const { return GetCurrentPos(); }
virtual long GetLastPosition() const { return GetTextLength(); }
}
else
{
- SetSelectionStart(from);
- SetSelectionEnd(to);
+ SetSelectionStart((int)from);
+ SetSelectionEnd((int)to);
}
}
long f, t;
GetSelection(&f, &t);
if ( from )
- *from = f;
+ *from = (int)f;
if ( to )
- *to = t;
+ *to = (int)t;
}
#endif
virtual long XYToPosition(long x, long y) const
{
- long pos = PositionFromLine(y);
+ long pos = PositionFromLine((int)y);
pos += x;
return pos;
}
virtual bool PositionToXY(long pos, long *x, long *y) const
{
- long l = LineFromPosition(pos);
+ int l = LineFromPosition((int)pos);
if ( l == -1 )
return false;
return true;
}
- virtual void ShowPosition(long pos) { GotoPos(pos); }
+ virtual void ShowPosition(long pos) { GotoPos((int)pos); }
// FIXME-VC6: can't use wxWindow here because of "error C2603: illegal
// access declaration: 'wxWindow' is not a direct base of
public: \
WX_DEFINE_ITERATOR_CATEGORY(WX_STR_ITERATOR_TAG) \
typedef wxUniChar value_type; \
- typedef int difference_type; \
+ typedef ptrdiff_t difference_type; \
typedef reference_type reference; \
typedef pointer_type pointer; \
\
wxUniChar(unsigned char c) { m_value = From8bit((char)c); }
#define wxUNICHAR_DEFINE_CTOR(type) \
- wxUniChar(type c) { m_value = c; }
+ wxUniChar(type c) { m_value = (value_type)c; }
wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_CTOR)
#undef wxUNICHAR_DEFINE_CTOR
wxUniChar& operator=(unsigned char c) { m_value = From8bit((char)c); return *this; }
#define wxUNICHAR_DEFINE_OPERATOR_EQUAL(type) \
- wxUniChar& operator=(type c) { m_value = c; return *this; }
+ wxUniChar& operator=(type c) { m_value = (value_type)c; return *this; }
wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_OPERATOR_EQUAL)
#undef wxUNICHAR_DEFINE_OPERATOR_EQUAL
wxWindowIDRef(long id)
{
- Init(id);
+ Init(wxWindowID(id));
}
wxWindowIDRef(const wxWindowIDRef& id)
wxWindowIDRef& operator=(long id)
{
- Assign(id);
+ Assign(wxWindowID(id));
return *this;
}
/**
Returns the number of stops.
*/
- unsigned GetCount() const;
+ size_t GetCount() const;
/**
Set the start colour to @a col
/**
Constructs the pane with the given @a style and @a width.
*/
- wxStatusBarPane(int style = wxSB_NORMAL, size_t width = 0);
+ wxStatusBarPane(int style = wxSB_NORMAL, int width = 0);
/**
Returns the pane width; it maybe negative, indicating a variable-width field.
class wxAnyNullValue
{
-private:
+protected:
+ // this field is unused, but can't be private to avoid Clang's
+ // "Private field 'm_dummy' is not used" warning
void* m_dummy;
};
buf = new wxChar[sz + 1];
}
- bool ok wxDUMMY_INITIALIZE(false);
+ bool ok = false;
// for the compilers which have Unicode version of _getcwd(), call it
// directly, for the others call the ANSI version and do the translation
namespace
{
+#ifndef __WXOSX__
// Small helper function: get the value of the given environment variable and
// return true only if the variable was found and has non-empty value.
inline bool wxGetNonEmptyEnvVar(const wxString& name, wxString* value)
{
return wxGetEnv(name, value) && !value->empty();
}
+#endif
} // anonymous namespace
#if defined(__UNIX__)
// first get the string identifying the language from the environment
wxString langFull;
-#ifdef __WXMAC__
+#ifdef __WXOSX__
wxCFRef<CFLocaleRef> userLocaleRef(CFLocaleCopyCurrent());
// because the locale identifier (kCFLocaleIdentifier) is formatted a little bit differently, eg
delete[] dataFormats;
delete itemObject;
if (dataStringAvailable)
+ {
if (itemStringAvailable)
{
if (itemCounter > 0)
}
else
dataStringAvailable = false;
+ }
}
else
{
NSArray* sortDescriptors;
NSSortDescriptor* sortDescriptor;
- sortDescriptor = [[NSSortDescriptor alloc] initWithKey:[NSString stringWithFormat:@"%d",[outlineView columnWithIdentifier:[tableColumn identifier]]]
+ sortDescriptor = [[NSSortDescriptor alloc] initWithKey:[NSString stringWithFormat:@"%ld",(long)[outlineView columnWithIdentifier:[tableColumn identifier]]]
ascending:YES];
sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
[tableColumn setSortDescriptorPrototype:sortDescriptor];
}
virtual void Replace(long from, long to, const wxString& text)
{
- SetTargetStart(from);
- SetTargetEnd(to);
+ SetTargetStart((int)from);
+ SetTargetEnd((int)to);
ReplaceTarget(text);
}
virtual void SetInsertionPoint(long pos)
{
- SetCurrentPos(pos == -1 ? GetLastPosition() : pos);
+ SetCurrentPos(int(pos == -1 ? GetLastPosition() : pos));
}
virtual long GetInsertionPoint() const { return GetCurrentPos(); }
virtual long GetLastPosition() const { return GetTextLength(); }
}
else
{
- SetSelectionStart(from);
- SetSelectionEnd(to);
+ SetSelectionStart((int)from);
+ SetSelectionEnd((int)to);
}
}
long f, t;
GetSelection(&f, &t);
if ( from )
- *from = f;
+ *from = (int)f;
if ( to )
- *to = t;
+ *to = (int)t;
}
#endif
virtual long XYToPosition(long x, long y) const
{
- long pos = PositionFromLine(y);
+ long pos = PositionFromLine((int)y);
pos += x;
return pos;
}
virtual bool PositionToXY(long pos, long *x, long *y) const
{
- long l = LineFromPosition(pos);
+ int l = LineFromPosition((int)pos);
if ( l == -1 )
return false;
return true;
}
- virtual void ShowPosition(long pos) { GotoPos(pos); }
+ virtual void ShowPosition(long pos) { GotoPos((int)pos); }
// FIXME-VC6: can't use wxWindow here because of "error C2603: illegal
// access declaration: 'wxWindow' is not a direct base of