globally renamed uint to size_t. This has _not_ been checked under Windows,

although I changed msw files also, so please wait until this evening if you
want to be sure that it compiles. This change should fix 64 bit compilation
problems, but it would be nice to test it...


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1998-08-18 15:36:12 +00:00
parent 77ff2d2639
commit c86f1403c3
41 changed files with 244 additions and 262 deletions

View File

@ -123,8 +123,8 @@ public:
virtual bool GetNextEntry (wxString& str, long& lIndex) const = 0; virtual bool GetNextEntry (wxString& str, long& lIndex) const = 0;
// get number of entries/subgroups in the current group, with or without // get number of entries/subgroups in the current group, with or without
// it's subgroups // it's subgroups
virtual uint GetNumberOfEntries(bool bRecursive = FALSE) const = 0; virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const = 0;
virtual uint GetNumberOfGroups(bool bRecursive = FALSE) const = 0; virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const = 0;
// tests of existence // tests of existence
// returns TRUE if the group by this name exists // returns TRUE if the group by this name exists

View File

@ -169,22 +169,9 @@ typedef int wxWindowID;
class WXDLLEXPORT wxObject; class WXDLLEXPORT wxObject;
class WXDLLEXPORT wxEvent; class WXDLLEXPORT wxEvent;
// Vadim's types - check whether we need them all /** symbolic constant used by all Find()-like functions returning positive
/// the type for various indexes (string, arrays, ...)
typedef unsigned int uint;
/// extended boolean type: { yes, no, may be }
typedef signed int EBool;
/// with TRUE and FALSE is a possible value for a "3-state" boolean var
#define UNKNOWN (-1)
/** symbolic constant used by all Find()-like functions returning positive
integer on success as failure indicator */ integer on success as failure indicator */
#define NOT_FOUND (-1) #define NOT_FOUND (-1)
/** useful for Windows programmers: makes somewhat more clear all these
zeroes being passed to Windows APIs */
#define RESERVED (NULL)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Error codes // Error codes
@ -244,14 +231,6 @@ enum ErrCode
#endif // OS #endif // OS
#if defined(__UNIX__)
#define FILE_PATH_SEPARATOR ('/')
#elif defined(__WXMSW__)
#define FILE_PATH_SEPARATOR ('\\')
#else
#define FILE_PATH_SEPARATOR ('/')
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// compiler specific settings // compiler specific settings
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -90,13 +90,13 @@ public:
/// empties the list and releases memory /// empties the list and releases memory
void Clear(); void Clear();
/// preallocates memory for given number of items /// preallocates memory for given number of items
void Alloc(uint uiSize); void Alloc(size_t uiSize);
//@} //@}
/** @name simple accessors */ /** @name simple accessors */
//@{ //@{
/// number of elements in the array /// number of elements in the array
uint Count() const { return m_uiCount; } size_t Count() const { return m_uiCount; }
/// is it empty? /// is it empty?
bool IsEmpty() const { return m_uiCount == 0; } bool IsEmpty() const { return m_uiCount == 0; }
//@} //@}
@ -109,10 +109,10 @@ protected:
/** @name items access */ /** @name items access */
//@{ //@{
/// get item at position uiIndex (range checking is done in debug version) /// get item at position uiIndex (range checking is done in debug version)
long& Item(uint uiIndex) const long& Item(size_t uiIndex) const
{ wxASSERT( uiIndex < m_uiCount ); return m_pItems[uiIndex]; } { wxASSERT( uiIndex < m_uiCount ); return m_pItems[uiIndex]; }
/// same as Item() /// same as Item()
long& operator[](uint uiIndex) const { return Item(uiIndex); } long& operator[](size_t uiIndex) const { return Item(uiIndex); }
//@} //@}
/** @name item management */ /** @name item management */
@ -131,11 +131,11 @@ protected:
/// add item assuming the array is sorted with fnCompare function /// add item assuming the array is sorted with fnCompare function
void Add(long lItem, CMPFUNC fnCompare); void Add(long lItem, CMPFUNC fnCompare);
/// add new element at given position (it becomes Item[uiIndex]) /// add new element at given position (it becomes Item[uiIndex])
void Insert(long lItem, uint uiIndex); void Insert(long lItem, size_t uiIndex);
/// remove first item matching this value /// remove first item matching this value
void Remove(long lItem); void Remove(long lItem);
/// remove item by index /// remove item by index
void Remove(uint uiIndex); void Remove(size_t uiIndex);
//@} //@}
/// sort array elements using given compare function /// sort array elements using given compare function
@ -144,7 +144,7 @@ protected:
private: private:
void Grow(); // makes array bigger if needed void Grow(); // makes array bigger if needed
uint m_uiSize, // current size of the array size_t m_uiSize, // current size of the array
m_uiCount; // current number of elements m_uiCount; // current number of elements
long *m_pItems; // pointer to data long *m_pItems; // pointer to data
@ -172,9 +172,9 @@ public: \
{ ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); \ { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); \
return *this; } \ return *this; } \
\ \
T& operator[](uint uiIndex) const \ T& operator[](size_t uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \ { return (T&)(wxBaseArray::Item(uiIndex)); } \
T& Item(uint uiIndex) const \ T& Item(size_t uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \ { return (T&)(wxBaseArray::Item(uiIndex)); } \
T& Last() const \ T& Last() const \
{ return (T&)(wxBaseArray::Item(Count() - 1)); } \ { return (T&)(wxBaseArray::Item(Count() - 1)); } \
@ -184,15 +184,15 @@ public: \
\ \
void Add(T Item) \ void Add(T Item) \
{ wxBaseArray::Add((long)Item); } \ { wxBaseArray::Add((long)Item); } \
void Insert(T Item, uint uiIndex) \ void Insert(T Item, size_t uiIndex) \
{ wxBaseArray::Insert((long)Item, uiIndex) ; } \ { wxBaseArray::Insert((long)Item, uiIndex) ; } \
\ \
void Remove(uint uiIndex) { wxBaseArray::Remove(uiIndex); } \ void Remove(size_t uiIndex) { wxBaseArray::Remove(uiIndex); } \
void Remove(T Item) \ void Remove(T Item) \
{ int iIndex = Index(Item); \ { int iIndex = Index(Item); \
wxCHECK2_MSG( iIndex != NOT_FOUND, return, \ wxCHECK2_MSG( iIndex != NOT_FOUND, return, \
"removing inexisting element in wxArray::Remove" ); \ "removing inexisting element in wxArray::Remove" ); \
wxBaseArray::Remove((uint)iIndex); } \ wxBaseArray::Remove((size_t)iIndex); } \
\ \
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \ void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
} }
@ -227,9 +227,9 @@ public: \
m_fnCompare = src.m_fnCompare; \ m_fnCompare = src.m_fnCompare; \
return *this; } \ return *this; } \
\ \
T& operator[](uint uiIndex) const \ T& operator[](size_t uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \ { return (T&)(wxBaseArray::Item(uiIndex)); } \
T& Item(uint uiIndex) const \ T& Item(size_t uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \ { return (T&)(wxBaseArray::Item(uiIndex)); } \
T& Last() const \ T& Last() const \
{ return (T&)(wxBaseArray::Item(Count() - 1)); } \ { return (T&)(wxBaseArray::Item(Count() - 1)); } \
@ -240,12 +240,12 @@ public: \
void Add(T Item) \ void Add(T Item) \
{ wxBaseArray::Add((long)Item, (CMPFUNC)m_fnCompare); } \ { wxBaseArray::Add((long)Item, (CMPFUNC)m_fnCompare); } \
\ \
void Remove(uint uiIndex) { wxBaseArray::Remove(uiIndex); } \ void Remove(size_t uiIndex) { wxBaseArray::Remove(uiIndex); } \
void Remove(T Item) \ void Remove(T Item) \
{ int iIndex = Index(Item); \ { int iIndex = Index(Item); \
wxCHECK2_MSG( iIndex != NOT_FOUND, return, \ wxCHECK2_MSG( iIndex != NOT_FOUND, return, \
"removing inexisting element in wxArray::Remove" ); \ "removing inexisting element in wxArray::Remove" ); \
wxBaseArray::Remove((uint)iIndex); } \ wxBaseArray::Remove((size_t)iIndex); } \
\ \
private: \ private: \
SCMPFUNC##T m_fnCompare; \ SCMPFUNC##T m_fnCompare; \
@ -265,9 +265,9 @@ public: \
\ \
~name(); \ ~name(); \
\ \
T& operator[](uint uiIndex) const \ T& operator[](size_t uiIndex) const \
{ return *(T*)wxBaseArray::Item(uiIndex); } \ { return *(T*)wxBaseArray::Item(uiIndex); } \
T& Item(uint uiIndex) const \ T& Item(size_t uiIndex) const \
{ return *(T*)wxBaseArray::Item(uiIndex); } \ { return *(T*)wxBaseArray::Item(uiIndex); } \
T& Last() const \ T& Last() const \
{ return *(T*)(wxBaseArray::Item(Count() - 1)); } \ { return *(T*)(wxBaseArray::Item(Count() - 1)); } \
@ -278,16 +278,16 @@ public: \
void Add(const T* pItem) \ void Add(const T* pItem) \
{ wxBaseArray::Add((long)pItem); } \ { wxBaseArray::Add((long)pItem); } \
\ \
void Insert(const T& Item, uint uiIndex); \ void Insert(const T& Item, size_t uiIndex); \
void Insert(const T* pItem, uint uiIndex) \ void Insert(const T* pItem, size_t uiIndex) \
{ wxBaseArray::Insert((long)pItem, uiIndex); } \ { wxBaseArray::Insert((long)pItem, uiIndex); } \
\ \
void Empty(); \ void Empty(); \
\ \
T* Detach(uint uiIndex) \ T* Detach(size_t uiIndex) \
{ T* p = (T*)wxBaseArray::Item(uiIndex); \ { T* p = (T*)wxBaseArray::Item(uiIndex); \
wxBaseArray::Remove(uiIndex); return p; } \ wxBaseArray::Remove(uiIndex); return p; } \
void Remove(uint uiIndex); \ void Remove(size_t uiIndex); \
\ \
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \ void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
\ \

View File

@ -95,7 +95,7 @@ public:
// returns number of bytes read or ofsInvalid on error // returns number of bytes read or ofsInvalid on error
off_t Read(void *pBuf, off_t nCount); off_t Read(void *pBuf, off_t nCount);
// returns true on success // returns true on success
uint Write(const void *pBuf, uint nCount); size_t Write(const void *pBuf, size_t nCount);
// returns true on success // returns true on success
bool Write(const wxString& s) { return Write(s.c_str(), s.Len()) != 0; } bool Write(const wxString& s) { return Write(s.c_str(), s.Len()) != 0; }
// flush data not yet written // flush data not yet written
@ -156,7 +156,7 @@ public:
bool IsOpened() const { return m_file.IsOpened(); } bool IsOpened() const { return m_file.IsOpened(); }
// I/O (both functions return true on success, false on failure) // I/O (both functions return true on success, false on failure)
bool Write(const void *p, uint n) { return m_file.Write(p, n) != 0; } bool Write(const void *p, size_t n) { return m_file.Write(p, n) != 0; }
bool Write(const wxString& str) { return m_file.Write(str); } bool Write(const wxString& str) { return m_file.Write(str); }
// different ways to close the file // different ways to close the file

View File

@ -135,8 +135,8 @@ public:
virtual bool GetFirstEntry(wxString& str, long& lIndex) const; virtual bool GetFirstEntry(wxString& str, long& lIndex) const;
virtual bool GetNextEntry (wxString& str, long& lIndex) const; virtual bool GetNextEntry (wxString& str, long& lIndex) const;
virtual uint GetNumberOfEntries(bool bRecursive = FALSE) const; virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const;
virtual uint GetNumberOfGroups(bool bRecursive = FALSE) const; virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const;
virtual bool HasGroup(const wxString& strName) const; virtual bool HasGroup(const wxString& strName) const;
virtual bool HasEntry(const wxString& strName) const; virtual bool HasEntry(const wxString& strName) const;

View File

@ -80,7 +80,7 @@ public:
// StdFormat enumerations or a user-defined format) // StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0; virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data // get the (total) size of data
virtual uint GetDataSize() const = 0; virtual size_t GetDataSize() const = 0;
// copy raw data to provided pointer // copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0; virtual void GetDataHere(void *pBuf) const = 0;
@ -103,7 +103,7 @@ public:
{ return wxDF_TEXT; } { return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; } { return format == wxDF_TEXT; }
virtual uint GetDataSize() const virtual size_t GetDataSize() const
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course { return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); } { memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
@ -130,7 +130,7 @@ public:
{ return wxDF_FILENAME; } { return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; } { return format == wxDF_FILENAME; }
virtual uint GetDataSize() const virtual size_t GetDataSize() const
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course { return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); } { memcpy(pBuf, m_files.c_str(), GetDataSize()); }

View File

@ -153,7 +153,7 @@ private:
wxImageList* m_imageList; wxImageList* m_imageList;
wxList m_pages; wxList m_pages;
uint m_idHandler; // the change page handler id size_t m_idHandler; // the change page handler id
DECLARE_DYNAMIC_CLASS(wxNotebook) DECLARE_DYNAMIC_CLASS(wxNotebook)
}; };

View File

@ -183,8 +183,8 @@ private:
return m_childlist.Number(); return m_childlist.Number();
} }
guint expand_handler; guit expand_handler;
guint collapse_handler; guit collapse_handler;
DECLARE_DYNAMIC_CLASS(wxTreeItem) DECLARE_DYNAMIC_CLASS(wxTreeItem)
}; };

View File

@ -80,7 +80,7 @@ public:
// StdFormat enumerations or a user-defined format) // StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0; virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data // get the (total) size of data
virtual uint GetDataSize() const = 0; virtual size_t GetDataSize() const = 0;
// copy raw data to provided pointer // copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0; virtual void GetDataHere(void *pBuf) const = 0;
@ -103,7 +103,7 @@ public:
{ return wxDF_TEXT; } { return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; } { return format == wxDF_TEXT; }
virtual uint GetDataSize() const virtual size_t GetDataSize() const
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course { return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); } { memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
@ -130,7 +130,7 @@ public:
{ return wxDF_FILENAME; } { return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; } { return format == wxDF_FILENAME; }
virtual uint GetDataSize() const virtual size_t GetDataSize() const
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course { return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); } { memcpy(pBuf, m_files.c_str(), GetDataSize()); }

View File

@ -153,7 +153,7 @@ private:
wxImageList* m_imageList; wxImageList* m_imageList;
wxList m_pages; wxList m_pages;
uint m_idHandler; // the change page handler id size_t m_idHandler; // the change page handler id
DECLARE_DYNAMIC_CLASS(wxNotebook) DECLARE_DYNAMIC_CLASS(wxNotebook)
}; };

View File

@ -183,8 +183,8 @@ private:
return m_childlist.Number(); return m_childlist.Number();
} }
guint expand_handler; guit expand_handler;
guint collapse_handler; guit collapse_handler;
DECLARE_DYNAMIC_CLASS(wxTreeItem) DECLARE_DYNAMIC_CLASS(wxTreeItem)
}; };

View File

@ -28,8 +28,8 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// # adjust if necessary // # adjust if necessary
typedef unsigned char uint8; typedef unsigned char size_t8;
typedef unsigned long uint32; typedef unsigned long size_t32;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// macros // macros

View File

@ -17,7 +17,7 @@
#endif #endif
typedef wxColour wxColor; typedef wxColour wxColor;
typedef unsigned int uint; typedef unsigned int size_t;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxOwnerDrawn - a mix-in base class, derive from it to implement owner-drawn // wxOwnerDrawn - a mix-in base class, derive from it to implement owner-drawn
@ -69,8 +69,8 @@ public:
// //
// NB: default is too small for bitmaps, but ok for checkmarks. // NB: default is too small for bitmaps, but ok for checkmarks.
inline void SetMarginWidth(int nWidth) inline void SetMarginWidth(int nWidth)
{ ms_nLastMarginWidth = m_nMarginWidth = (uint) nWidth; { ms_nLastMarginWidth = m_nMarginWidth = (size_t) nWidth;
if ( ((uint) nWidth) != ms_nDefaultMarginWidth ) m_bOwnerDrawn = TRUE; } if ( ((size_t) nWidth) != ms_nDefaultMarginWidth ) m_bOwnerDrawn = TRUE; }
inline int GetMarginWidth() const { return (int) m_nMarginWidth; } inline int GetMarginWidth() const { return (int) m_nMarginWidth; }
inline static int GetDefaultMarginWidth() { return (int) ms_nDefaultMarginWidth; } inline static int GetDefaultMarginWidth() { return (int) ms_nDefaultMarginWidth; }
@ -109,15 +109,15 @@ public:
}; };
// virtual functions to implement drawing (return TRUE if processed) // virtual functions to implement drawing (return TRUE if processed)
virtual bool OnMeasureItem(uint *pwidth, uint *pheight); virtual bool OnMeasureItem(size_t *pwidth, size_t *pheight);
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat); virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
protected: protected:
wxString m_strName; // label for a manu item wxString m_strName; // label for a manu item
private: private:
static uint ms_nDefaultMarginWidth; // menu check mark width static size_t ms_nDefaultMarginWidth; // menu check mark width
static uint ms_nLastMarginWidth; // handy for aligning all items static size_t ms_nLastMarginWidth; // handy for aligning all items
bool m_bCheckable, // used only for menu or check listbox items bool m_bCheckable, // used only for menu or check listbox items
m_bOwnerDrawn; // true if something is non standard m_bOwnerDrawn; // true if something is non standard
@ -128,7 +128,7 @@ private:
wxBitmap m_bmpChecked, // bitmap to put near the item wxBitmap m_bmpChecked, // bitmap to put near the item
m_bmpUnchecked; // (checked is used also for 'uncheckable' items) m_bmpUnchecked; // (checked is used also for 'uncheckable' items)
uint m_nHeight, // font height size_t m_nHeight, // font height
m_nMarginWidth; // space occupied by bitmap to the left of the item m_nMarginWidth; // space occupied by bitmap to the left of the item
}; };

View File

@ -80,7 +80,7 @@ public:
// StdFormat enumerations or a user-defined format) // StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0; virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data // get the (total) size of data
virtual uint GetDataSize() const = 0; virtual size_t GetDataSize() const = 0;
// copy raw data to provided pointer // copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0; virtual void GetDataHere(void *pBuf) const = 0;
@ -103,7 +103,7 @@ public:
{ return wxDF_TEXT; } { return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; } { return format == wxDF_TEXT; }
virtual uint GetDataSize() const virtual size_t GetDataSize() const
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course { return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); } { memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
@ -130,7 +130,7 @@ public:
{ return wxDF_FILENAME; } { return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; } { return format == wxDF_FILENAME; }
virtual uint GetDataSize() const virtual size_t GetDataSize() const
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course { return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); } { memcpy(pBuf, m_files.c_str(), GetDataSize()); }

View File

@ -125,7 +125,7 @@ inline const wxString& wxGetEmptyString() { return *(wxString *)&g_szNul; }
struct WXDLLEXPORT wxStringData struct WXDLLEXPORT wxStringData
{ {
int nRefs; // reference count int nRefs; // reference count
uint nDataLength, // actual string length size_t nDataLength, // actual string length
nAllocLength; // allocated memory size nAllocLength; // allocated memory size
// mimics declaration 'char data[nAllocLength]' // mimics declaration 'char data[nAllocLength]'
@ -254,7 +254,7 @@ public:
/** @name generic attributes & operations */ /** @name generic attributes & operations */
//@{ //@{
/// as standard strlen() /// as standard strlen()
uint Len() const { return GetStringData()->nDataLength; } size_t Len() const { return GetStringData()->nDataLength; }
/// string contains any characters? /// string contains any characters?
bool IsEmpty() const { return Len() == 0; } bool IsEmpty() const { return Len() == 0; }
/// reinitialize string (and free data!) /// reinitialize string (and free data!)
@ -452,7 +452,7 @@ public:
@param bReplaceAll: global replace (default) or only the first occurence @param bReplaceAll: global replace (default) or only the first occurence
@return the number of replacements made @return the number of replacements made
*/ */
uint Replace(const char *szOld, const char *szNew, bool bReplaceAll = TRUE); size_t Replace(const char *szOld, const char *szNew, bool bReplaceAll = TRUE);
//@} //@}
/// check if the string contents matches a mask containing '*' and '?' /// check if the string contents matches a mask containing '*' and '?'
@ -471,7 +471,7 @@ public:
//@{ //@{
/// ensure that string has space for at least nLen characters /// ensure that string has space for at least nLen characters
// only works if the data of this string is not shared // only works if the data of this string is not shared
void Alloc(uint nLen); void Alloc(size_t nLen);
/// minimize the string's memory /// minimize the string's memory
// only works if the data of this string is not shared // only works if the data of this string is not shared
void Shrink(); void Shrink();
@ -480,7 +480,7 @@ public:
Unget() *must* be called a.s.a.p. to put string back in a reasonable Unget() *must* be called a.s.a.p. to put string back in a reasonable
state! state!
*/ */
char *GetWriteBuf(uint nLen); char *GetWriteBuf(size_t nLen);
/// call this immediately after GetWriteBuf() has been used /// call this immediately after GetWriteBuf() has been used
void UngetWriteBuf(); void UngetWriteBuf();
//@} //@}
@ -818,7 +818,7 @@ public:
/** @name simple accessors */ /** @name simple accessors */
//@{ //@{
/// number of elements in the array /// number of elements in the array
uint Count() const { return m_nCount; } size_t Count() const { return m_nCount; }
/// is it empty? /// is it empty?
bool IsEmpty() const { return m_nCount == 0; } bool IsEmpty() const { return m_nCount == 0; }
//@} //@}
@ -847,7 +847,7 @@ public:
/// add new element at the end /// add new element at the end
void Add (const wxString& str); void Add (const wxString& str);
/// add new element at given position /// add new element at given position
void Insert(const wxString& str, uint uiIndex); void Insert(const wxString& str, size_t uiIndex);
/// remove first item matching this value /// remove first item matching this value
void Remove(const char *sz); void Remove(const char *sz);
/// remove item by index /// remove item by index
@ -861,7 +861,7 @@ private:
void Grow(); // makes array bigger if needed void Grow(); // makes array bigger if needed
void Free(); // free the string stored void Free(); // free the string stored
size_t m_nSize, // current size of the array size_t m_nSize, // current size of the array
m_nCount; // current number of elements m_nCount; // current number of elements
char **m_pItems; // pointer to data char **m_pItems; // pointer to data

View File

@ -19,7 +19,7 @@
#include "wx/listbox.h" #include "wx/listbox.h"
typedef unsigned int uint; typedef unsigned int size_t;
class wxCheckListBox : public wxListBox class wxCheckListBox : public wxListBox
{ {
@ -37,8 +37,8 @@ public:
const wxString& name = wxListBoxNameStr); const wxString& name = wxListBoxNameStr);
// items may be checked // items may be checked
bool IsChecked(uint uiIndex) const; bool IsChecked(size_t uiIndex) const;
void Check(uint uiIndex, bool bCheck = TRUE); void Check(size_t uiIndex, bool bCheck = TRUE);
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@ -79,7 +79,7 @@ public:
// StdFormat enumerations or a user-defined format) // StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0; virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data // get the (total) size of data
virtual uint GetDataSize() const = 0; virtual size_t GetDataSize() const = 0;
// copy raw data to provided pointer // copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0; virtual void GetDataHere(void *pBuf) const = 0;
@ -102,7 +102,7 @@ public:
{ return wxDF_TEXT; } { return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; } { return format == wxDF_TEXT; }
virtual uint GetDataSize() const virtual size_t GetDataSize() const
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course { return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); } { memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
@ -129,7 +129,7 @@ public:
{ return wxDF_FILENAME; } { return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; } { return format == wxDF_FILENAME; }
virtual uint GetDataSize() const virtual size_t GetDataSize() const
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course { return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); } { memcpy(pBuf, m_files.c_str(), GetDataSize()); }

View File

@ -63,10 +63,10 @@ public:
// get the number of lines in the file // get the number of lines in the file
size_t GetLineCount() const { return m_aLines.Count(); } size_t GetLineCount() const { return m_aLines.Count(); }
// the returned line may be modified (but don't add CR/LF at the end!) // the returned line may be modified (but don't add CR/LF at the end!)
wxString& GetLine(uint n) const { return m_aLines[n]; } wxString& GetLine(size_t n) const { return m_aLines[n]; }
wxString& operator[](uint n) const { return m_aLines[n]; } wxString& operator[](size_t n) const { return m_aLines[n]; }
// get the type of the line (see also GetEOL) // get the type of the line (see also GetEOL)
Type GetLineType(uint n) const { return m_aTypes[n]; } Type GetLineType(size_t n) const { return m_aTypes[n]; }
// guess the type of file (m_file is supposed to be opened) // guess the type of file (m_file is supposed to be opened)
Type GuessType() const; Type GuessType() const;
// get the name of the file // get the name of the file
@ -77,10 +77,10 @@ public:
void AddLine(const wxString& str, Type type = typeDefault) void AddLine(const wxString& str, Type type = typeDefault)
{ m_aLines.Add(str); m_aTypes.Add(type); } { m_aLines.Add(str); m_aTypes.Add(type); }
// insert a line before the line number n // insert a line before the line number n
void InsertLine(const wxString& str, uint n, Type type = typeDefault) void InsertLine(const wxString& str, size_t n, Type type = typeDefault)
{ m_aLines.Insert(str, n); m_aTypes.Insert(type, n); } { m_aLines.Insert(str, n); m_aTypes.Insert(type, n); }
// delete one line // delete one line
void RemoveLine(uint n) { m_aLines.Remove(n); m_aTypes.Remove(n); } void RemoveLine(size_t n) { m_aLines.Remove(n); m_aTypes.Remove(n); }
// change the file on disk (default argument means "don't change type") // change the file on disk (default argument means "don't change type")
// possibly in another format // possibly in another format

View File

@ -164,8 +164,8 @@ wxString wxExpandEnvVars(const wxString& str)
#endif #endif
}; };
uint m; size_t m;
for ( uint n = 0; n < str.Len(); n++ ) { for ( size_t n = 0; n < str.Len(); n++ ) {
switch ( str[n] ) { switch ( str[n] ) {
#ifdef __WXMSW__ #ifdef __WXMSW__
case '%': case '%':

View File

@ -101,7 +101,7 @@ void wxBaseArray::Grow()
else else
{ {
// add 50% but not too much // add 50% but not too much
uint uiIncrement = m_uiSize < WX_ARRAY_DEFAULT_INITIAL_SIZE size_t uiIncrement = m_uiSize < WX_ARRAY_DEFAULT_INITIAL_SIZE
? WX_ARRAY_DEFAULT_INITIAL_SIZE : m_uiSize >> 1; ? WX_ARRAY_DEFAULT_INITIAL_SIZE : m_uiSize >> 1;
if ( uiIncrement > ARRAY_MAXSIZE_INCREMENT ) if ( uiIncrement > ARRAY_MAXSIZE_INCREMENT )
uiIncrement = ARRAY_MAXSIZE_INCREMENT; uiIncrement = ARRAY_MAXSIZE_INCREMENT;
@ -132,7 +132,7 @@ void wxBaseArray::Clear()
} }
// pre-allocates memory (frees the previous data!) // pre-allocates memory (frees the previous data!)
void wxBaseArray::Alloc(uint uiSize) void wxBaseArray::Alloc(size_t uiSize)
{ {
wxASSERT( uiSize > 0 ); wxASSERT( uiSize > 0 );
@ -151,7 +151,7 @@ int wxBaseArray::Index(long lItem, bool bFromEnd) const
{ {
if ( bFromEnd ) { if ( bFromEnd ) {
if ( m_uiCount > 0 ) { if ( m_uiCount > 0 ) {
uint ui = m_uiCount; size_t ui = m_uiCount;
do { do {
if ( m_pItems[--ui] == lItem ) if ( m_pItems[--ui] == lItem )
return ui; return ui;
@ -160,7 +160,7 @@ int wxBaseArray::Index(long lItem, bool bFromEnd) const
} }
} }
else { else {
for( uint ui = 0; ui < m_uiCount; ui++ ) { for( size_t ui = 0; ui < m_uiCount; ui++ ) {
if( m_pItems[ui] == lItem ) if( m_pItems[ui] == lItem )
return ui; return ui;
} }
@ -172,7 +172,7 @@ int wxBaseArray::Index(long lItem, bool bFromEnd) const
// search for an item in a sorted array (binary search) // search for an item in a sorted array (binary search)
int wxBaseArray::Index(long lItem, CMPFUNC fnCompare) const int wxBaseArray::Index(long lItem, CMPFUNC fnCompare) const
{ {
uint i, size_t i,
lo = 0, lo = 0,
hi = m_uiCount; hi = m_uiCount;
int res; int res;
@ -201,7 +201,7 @@ void wxBaseArray::Add(long lItem)
// add item assuming the array is sorted with fnCompare function // add item assuming the array is sorted with fnCompare function
void wxBaseArray::Add(long lItem, CMPFUNC fnCompare) void wxBaseArray::Add(long lItem, CMPFUNC fnCompare)
{ {
uint i, size_t i,
lo = 0, lo = 0,
hi = m_uiCount; hi = m_uiCount;
int res; int res;
@ -226,7 +226,7 @@ void wxBaseArray::Add(long lItem, CMPFUNC fnCompare)
} }
// add item at the given position // add item at the given position
void wxBaseArray::Insert(long lItem, uint uiIndex) void wxBaseArray::Insert(long lItem, size_t uiIndex)
{ {
wxCHECK_RET( uiIndex <= m_uiCount, _("bad index in wxArray::Insert") ); wxCHECK_RET( uiIndex <= m_uiCount, _("bad index in wxArray::Insert") );
@ -239,7 +239,7 @@ void wxBaseArray::Insert(long lItem, uint uiIndex)
} }
// removes item from array (by index) // removes item from array (by index)
void wxBaseArray::Remove(uint uiIndex) void wxBaseArray::Remove(size_t uiIndex)
{ {
wxCHECK_RET( uiIndex <= m_uiCount, _("bad index in wxArray::Remove") ); wxCHECK_RET( uiIndex <= m_uiCount, _("bad index in wxArray::Remove") );
@ -256,7 +256,7 @@ void wxBaseArray::Remove(long lItem)
wxCHECK_RET( iIndex != NOT_FOUND, wxCHECK_RET( iIndex != NOT_FOUND,
_("removing inexistent item in wxArray::Remove") ); _("removing inexistent item in wxArray::Remove") );
Remove((uint)iIndex); Remove((size_t)iIndex);
} }
// sort array elements using passed comparaison function // sort array elements using passed comparaison function

View File

@ -166,7 +166,7 @@ wxClassLibrary::wxClassLibrary(void)
wxClassLibrary::~wxClassLibrary(void) wxClassLibrary::~wxClassLibrary(void)
{ {
uint i; size_t i;
for (i=0;i<m_list.Count();i++) for (i=0;i<m_list.Count();i++)
delete (m_list[i]); delete (m_list[i]);
@ -184,7 +184,7 @@ void wxClassLibrary::RegisterClass(wxClassInfo *class_info,
void wxClassLibrary::UnregisterClass(wxClassInfo *class_info) void wxClassLibrary::UnregisterClass(wxClassInfo *class_info)
{ {
uint i = 0; size_t i = 0;
while (i < m_list.Count()) { while (i < m_list.Count()) {
if (m_list[i]->class_info == class_info) { if (m_list[i]->class_info == class_info) {
@ -200,7 +200,7 @@ bool wxClassLibrary::CreateObjects(const wxString& path,
wxArrayClassInfo& objs) wxArrayClassInfo& objs)
{ {
wxClassLibInfo *info; wxClassLibInfo *info;
uint i = 0; size_t i = 0;
while (i < m_list.Count()) { while (i < m_list.Count()) {
info = m_list[i]; info = m_list[i];
@ -215,7 +215,7 @@ bool wxClassLibrary::FetchInfos(const wxString& path,
wxArrayClassLibInfo& infos) wxArrayClassLibInfo& infos)
{ {
wxClassLibInfo *info; wxClassLibInfo *info;
uint i = 0; size_t i = 0;
while (i < m_list.Count()) { while (i < m_list.Count()) {
info = m_list[i]; info = m_list[i];
@ -232,7 +232,7 @@ bool wxClassLibrary::FetchInfos(const wxString& path,
wxObject *wxClassLibrary::CreateObject(const wxString& path) wxObject *wxClassLibrary::CreateObject(const wxString& path)
{ {
wxClassLibInfo *info; wxClassLibInfo *info;
uint i = 0; size_t i = 0;
while (i < m_list.Count()) { while (i < m_list.Count()) {
info = m_list[i]; info = m_list[i];

View File

@ -252,11 +252,11 @@ off_t wxFile::Read(void *pBuf, off_t nCount)
return wxInvalidOffset; return wxInvalidOffset;
} }
else else
return (uint)iRc; return (size_t)iRc;
} }
// write // write
uint wxFile::Write(const void *pBuf, uint nCount) size_t wxFile::Write(const void *pBuf, size_t nCount)
{ {
wxCHECK( (pBuf != NULL) && IsOpened(), 0 ); wxCHECK( (pBuf != NULL) && IsOpened(), 0 );

View File

@ -267,8 +267,8 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal)
const char *pEnd; const char *pEnd;
wxString strLine; wxString strLine;
uint nLineCount = file.GetLineCount(); size_t nLineCount = file.GetLineCount();
for ( uint n = 0; n < nLineCount; n++ ) { for ( size_t n = 0; n < nLineCount; n++ ) {
strLine = file[n]; strLine = file[n];
// add the line to linked list // add the line to linked list
@ -419,7 +419,7 @@ void wxFileConfig::SetPath(const wxString& strPath)
} }
// change current group // change current group
uint n; size_t n;
m_pCurrentGroup = m_pRootGroup; m_pCurrentGroup = m_pRootGroup;
for ( n = 0; n < aParts.Count(); n++ ) { for ( n = 0; n < aParts.Count(); n++ ) {
ConfigGroup *pNextGroup = m_pCurrentGroup->FindSubgroup(aParts[n]); ConfigGroup *pNextGroup = m_pCurrentGroup->FindSubgroup(aParts[n]);
@ -447,7 +447,7 @@ bool wxFileConfig::GetFirstGroup(wxString& str, long& lIndex) const
bool wxFileConfig::GetNextGroup (wxString& str, long& lIndex) const bool wxFileConfig::GetNextGroup (wxString& str, long& lIndex) const
{ {
if ( uint(lIndex) < m_pCurrentGroup->Groups().Count() ) { if ( size_t(lIndex) < m_pCurrentGroup->Groups().Count() ) {
str = m_pCurrentGroup->Groups()[lIndex++]->Name(); str = m_pCurrentGroup->Groups()[lIndex++]->Name();
return TRUE; return TRUE;
} }
@ -463,7 +463,7 @@ bool wxFileConfig::GetFirstEntry(wxString& str, long& lIndex) const
bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const
{ {
if ( uint(lIndex) < m_pCurrentGroup->Entries().Count() ) { if ( size_t(lIndex) < m_pCurrentGroup->Entries().Count() ) {
str = m_pCurrentGroup->Entries()[lIndex++]->Name(); str = m_pCurrentGroup->Entries()[lIndex++]->Name();
return TRUE; return TRUE;
} }
@ -471,13 +471,13 @@ bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const
return FALSE; return FALSE;
} }
uint wxFileConfig::GetNumberOfEntries(bool bRecursive) const size_t wxFileConfig::GetNumberOfEntries(bool bRecursive) const
{ {
uint n = m_pCurrentGroup->Entries().Count(); size_t n = m_pCurrentGroup->Entries().Count();
if ( bRecursive ) { if ( bRecursive ) {
ConfigGroup *pOldCurrentGroup = m_pCurrentGroup; ConfigGroup *pOldCurrentGroup = m_pCurrentGroup;
uint nSubgroups = m_pCurrentGroup->Groups().Count(); size_t nSubgroups = m_pCurrentGroup->Groups().Count();
for ( uint nGroup = 0; nGroup < nSubgroups; nGroup++ ) { for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) {
CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup]; CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup];
n += GetNumberOfEntries(TRUE); n += GetNumberOfEntries(TRUE);
CONST_CAST m_pCurrentGroup = pOldCurrentGroup; CONST_CAST m_pCurrentGroup = pOldCurrentGroup;
@ -487,13 +487,13 @@ uint wxFileConfig::GetNumberOfEntries(bool bRecursive) const
return n; return n;
} }
uint wxFileConfig::GetNumberOfGroups(bool bRecursive) const size_t wxFileConfig::GetNumberOfGroups(bool bRecursive) const
{ {
uint n = m_pCurrentGroup->Groups().Count(); size_t n = m_pCurrentGroup->Groups().Count();
if ( bRecursive ) { if ( bRecursive ) {
ConfigGroup *pOldCurrentGroup = m_pCurrentGroup; ConfigGroup *pOldCurrentGroup = m_pCurrentGroup;
uint nSubgroups = m_pCurrentGroup->Groups().Count(); size_t nSubgroups = m_pCurrentGroup->Groups().Count();
for ( uint nGroup = 0; nGroup < nSubgroups; nGroup++ ) { for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) {
CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup]; CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup];
n += GetNumberOfGroups(TRUE); n += GetNumberOfGroups(TRUE);
CONST_CAST m_pCurrentGroup = pOldCurrentGroup; CONST_CAST m_pCurrentGroup = pOldCurrentGroup;
@ -790,7 +790,7 @@ wxFileConfig::ConfigGroup::ConfigGroup(wxFileConfig::ConfigGroup *pParent,
wxFileConfig::ConfigGroup::~ConfigGroup() wxFileConfig::ConfigGroup::~ConfigGroup()
{ {
// entries // entries
uint n, nCount = m_aEntries.Count(); size_t n, nCount = m_aEntries.Count();
for ( n = 0; n < nCount; n++ ) for ( n = 0; n < nCount; n++ )
delete m_aEntries[n]; delete m_aEntries[n];
@ -921,7 +921,7 @@ wxString wxFileConfig::ConfigGroup::GetFullName() const
wxFileConfig::ConfigEntry * wxFileConfig::ConfigEntry *
wxFileConfig::ConfigGroup::FindEntry(const char *szName) const wxFileConfig::ConfigGroup::FindEntry(const char *szName) const
{ {
uint i, size_t i,
lo = 0, lo = 0,
hi = m_aEntries.Count(); hi = m_aEntries.Count();
int res; int res;
@ -951,7 +951,7 @@ wxFileConfig::ConfigGroup::FindEntry(const char *szName) const
wxFileConfig::ConfigGroup * wxFileConfig::ConfigGroup *
wxFileConfig::ConfigGroup::FindSubgroup(const char *szName) const wxFileConfig::ConfigGroup::FindSubgroup(const char *szName) const
{ {
uint i, size_t i,
lo = 0, lo = 0,
hi = m_aSubgroups.Count(); hi = m_aSubgroups.Count();
int res; int res;
@ -1030,8 +1030,8 @@ bool wxFileConfig::ConfigGroup::DeleteSubgroup(ConfigGroup *pGroup)
wxCHECK( pGroup != NULL, FALSE ); // deleting non existing group? wxCHECK( pGroup != NULL, FALSE ); // deleting non existing group?
// delete all entries // delete all entries
uint nCount = pGroup->m_aEntries.Count(); size_t nCount = pGroup->m_aEntries.Count();
for ( uint nEntry = 0; nEntry < nCount; nEntry++ ) { for ( size_t nEntry = 0; nEntry < nCount; nEntry++ ) {
LineList *pLine = pGroup->m_aEntries[nEntry]->GetLine(); LineList *pLine = pGroup->m_aEntries[nEntry]->GetLine();
if ( pLine != NULL ) if ( pLine != NULL )
m_pConfig->LineListRemove(pLine); m_pConfig->LineListRemove(pLine);
@ -1039,7 +1039,7 @@ bool wxFileConfig::ConfigGroup::DeleteSubgroup(ConfigGroup *pGroup)
// and subgroups of this sungroup // and subgroups of this sungroup
nCount = pGroup->m_aSubgroups.Count(); nCount = pGroup->m_aSubgroups.Count();
for ( uint nGroup = 0; nGroup < nCount; nGroup++ ) { for ( size_t nGroup = 0; nGroup < nCount; nGroup++ ) {
pGroup->DeleteSubgroup(pGroup->m_aSubgroups[nGroup]); pGroup->DeleteSubgroup(pGroup->m_aSubgroups[nGroup]);
} }
@ -1053,7 +1053,7 @@ bool wxFileConfig::ConfigGroup::DeleteSubgroup(ConfigGroup *pGroup)
// go back until we find a subgroup or reach the group's line // go back until we find a subgroup or reach the group's line
ConfigGroup *pNewLast = NULL; ConfigGroup *pNewLast = NULL;
uint n, nSubgroups = m_aSubgroups.Count(); size_t n, nSubgroups = m_aSubgroups.Count();
LineList *pl; LineList *pl;
for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) { for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) {
// is it our subgroup? // is it our subgroup?
@ -1104,7 +1104,7 @@ bool wxFileConfig::ConfigGroup::DeleteEntry(const char *szName)
// go back until we find another entry or reach the group's line // go back until we find another entry or reach the group's line
ConfigEntry *pNewLast = NULL; ConfigEntry *pNewLast = NULL;
uint n, nEntries = m_aEntries.Count(); size_t n, nEntries = m_aEntries.Count();
LineList *pl; LineList *pl;
for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) { for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) {
// is it our subgroup? // is it our subgroup?
@ -1273,7 +1273,7 @@ wxString FilterIn(const wxString& str)
bool bQuoted = !str.IsEmpty() && str[0] == '"'; bool bQuoted = !str.IsEmpty() && str[0] == '"';
for ( uint n = bQuoted ? 1 : 0; n < str.Len(); n++ ) { for ( size_t n = bQuoted ? 1 : 0; n < str.Len(); n++ ) {
if ( str[n] == '\\' ) { if ( str[n] == '\\' ) {
switch ( str[++n] ) { switch ( str[++n] ) {
case 'n': case 'n':
@ -1327,7 +1327,7 @@ wxString FilterOut(const wxString& str)
strResult += '"'; strResult += '"';
char c; char c;
for ( uint n = 0; n < str.Len(); n++ ) { for ( size_t n = 0; n < str.Len(); n++ ) {
switch ( str[n] ) { switch ( str[n] ) {
case '\n': case '\n':
c = 'n'; c = 'n';

View File

@ -1349,16 +1349,16 @@ void WXDLLEXPORT wxSplitPath(const char *pszFileName,
const char *pSepDos = strrchr(pszFileName, FILE_SEP_PATH_DOS); const char *pSepDos = strrchr(pszFileName, FILE_SEP_PATH_DOS);
// take the last of the two // take the last of the two
uint nPosUnix = pSepUnix ? pSepUnix - pszFileName : 0; size_t nPosUnix = pSepUnix ? pSepUnix - pszFileName : 0;
uint nPosDos = pSepDos ? pSepDos - pszFileName : 0; size_t nPosDos = pSepDos ? pSepDos - pszFileName : 0;
if ( nPosDos > nPosUnix ) if ( nPosDos > nPosUnix )
nPosUnix = nPosDos; nPosUnix = nPosDos;
// uint nLen = Strlen(pszFileName); // size_t nLen = Strlen(pszFileName);
if ( pstrPath ) if ( pstrPath )
*pstrPath = wxString(pszFileName, nPosUnix); *pstrPath = wxString(pszFileName, nPosUnix);
if ( pDot ) { if ( pDot ) {
uint nPosDot = pDot - pszFileName; size_t nPosDot = pDot - pszFileName;
if ( pstrName ) if ( pstrName )
*pstrName = wxString(pszFileName + nPosUnix + 1, nPosDot - nPosUnix); *pstrName = wxString(pszFileName + nPosUnix + 1, nPosDot - nPosUnix);
if ( pstrExt ) if ( pstrExt )

View File

@ -46,8 +46,8 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// magic number identifying the .mo format file // magic number identifying the .mo format file
const uint32 MSGCATALOG_MAGIC = 0x950412de; const size_t32 MSGCATALOG_MAGIC = 0x950412de;
const uint32 MSGCATALOG_MAGIC_SW = 0xde120495; const size_t32 MSGCATALOG_MAGIC_SW = 0xde120495;
// extension of ".mo" files // extension of ".mo" files
#define MSGCATALOG_EXTENSION ".mo" #define MSGCATALOG_EXTENSION ".mo"
@ -104,40 +104,40 @@ private:
// an entry in the string table // an entry in the string table
struct wxMsgTableEntry struct wxMsgTableEntry
{ {
uint32 nLen; // length of the string size_t32 nLen; // length of the string
uint32 ofsString; // pointer to the string size_t32 ofsString; // pointer to the string
}; };
// header of a .mo file // header of a .mo file
struct wxMsgCatalogHeader struct wxMsgCatalogHeader
{ {
uint32 magic, // offset +00: magic id size_t32 magic, // offset +00: magic id
revision, // +04: revision revision, // +04: revision
numStrings; // +08: number of strings in the file numStrings; // +08: number of strings in the file
uint32 ofsOrigTable, // +0C: start of original string table size_t32 ofsOrigTable, // +0C: start of original string table
ofsTransTable; // +10: start of translated string table ofsTransTable; // +10: start of translated string table
uint32 nHashSize, // +14: hash table size size_t32 nHashSize, // +14: hash table size
ofsHashTable; // +18: offset of hash table start ofsHashTable; // +18: offset of hash table start
}; };
// all data is stored here, NULL if no data loaded // all data is stored here, NULL if no data loaded
uint8 *m_pData; size_t8 *m_pData;
// data description // data description
uint32 m_numStrings, // number of strings in this domain size_t32 m_numStrings, // number of strings in this domain
m_nHashSize; // number of entries in hash table m_nHashSize; // number of entries in hash table
uint32 *m_pHashTable; // pointer to hash table size_t32 *m_pHashTable; // pointer to hash table
wxMsgTableEntry *m_pOrigTable, // pointer to original strings wxMsgTableEntry *m_pOrigTable, // pointer to original strings
*m_pTransTable; // translated *m_pTransTable; // translated
const char *StringAtOfs(wxMsgTableEntry *pTable, uint32 index) const const char *StringAtOfs(wxMsgTableEntry *pTable, size_t32 index) const
{ return (const char *)(m_pData + Swap(pTable[index].ofsString)); } { return (const char *)(m_pData + Swap(pTable[index].ofsString)); }
// utility functions // utility functions
// calculate the hash value of given string // calculate the hash value of given string
static inline uint32 GetHash(const char *sz); static inline size_t32 GetHash(const char *sz);
// big<->little endian // big<->little endian
inline uint32 Swap(uint32 ui) const; inline size_t32 Swap(size_t32 ui) const;
// internal state // internal state
bool HasHashTable() const // true if hash table is present bool HasHashTable() const // true if hash table is present
@ -158,16 +158,16 @@ private:
// calculate hash value using the so called hashpjw function by P.J. Weinberger // calculate hash value using the so called hashpjw function by P.J. Weinberger
// [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools] // [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools]
uint32 wxMsgCatalog::GetHash(const char *sz) size_t32 wxMsgCatalog::GetHash(const char *sz)
{ {
#define HASHWORDBITS 32 // the length of uint32 #define HASHWORDBITS 32 // the length of size_t32
uint32 hval = 0; size_t32 hval = 0;
uint32 g; size_t32 g;
while ( *sz != '\0' ) { while ( *sz != '\0' ) {
hval <<= 4; hval <<= 4;
hval += (uint32)*sz++; hval += (size_t32)*sz++;
g = hval & ((uint32)0xf << (HASHWORDBITS - 4)); g = hval & ((size_t32)0xf << (HASHWORDBITS - 4));
if ( g != 0 ) { if ( g != 0 ) {
hval ^= g >> (HASHWORDBITS - 8); hval ^= g >> (HASHWORDBITS - 8);
hval ^= g; hval ^= g;
@ -178,7 +178,7 @@ uint32 wxMsgCatalog::GetHash(const char *sz)
} }
// swap the 2 halves of 32 bit integer if needed // swap the 2 halves of 32 bit integer if needed
uint32 wxMsgCatalog::Swap(uint32 ui) const size_t32 wxMsgCatalog::Swap(size_t32 ui) const
{ {
return m_bSwapped ? (ui << 24) | ((ui & 0xff00) << 8) | return m_bSwapped ? (ui << 24) | ((ui & 0xff00) << 8) |
((ui >> 8) & 0xff00) | (ui >> 24) ((ui >> 8) & 0xff00) | (ui >> 24)
@ -266,7 +266,7 @@ bool wxMsgCatalog::Load(const char *szDirPrefix, const char *szName)
return FALSE; return FALSE;
// read the whole file in memory // read the whole file in memory
m_pData = new uint8[nSize]; m_pData = new size_t8[nSize];
if ( fileMsg.Read(m_pData, nSize) != nSize ) { if ( fileMsg.Read(m_pData, nSize) != nSize ) {
wxDELETEA(m_pData); wxDELETEA(m_pData);
return FALSE; return FALSE;
@ -302,7 +302,7 @@ bool wxMsgCatalog::Load(const char *szDirPrefix, const char *szName)
Swap(pHeader->ofsTransTable)); Swap(pHeader->ofsTransTable));
m_nHashSize = Swap(pHeader->nHashSize); m_nHashSize = Swap(pHeader->nHashSize);
m_pHashTable = (uint32 *)(m_pData + Swap(pHeader->ofsHashTable)); m_pHashTable = (size_t32 *)(m_pData + Swap(pHeader->ofsHashTable));
m_pszName = new char[strlen(szName) + 1]; m_pszName = new char[strlen(szName) + 1];
strcpy(m_pszName, szName); strcpy(m_pszName, szName);
@ -318,13 +318,13 @@ const char *wxMsgCatalog::GetString(const char *szOrig) const
return NULL; return NULL;
if ( HasHashTable() ) { // use hash table for lookup if possible if ( HasHashTable() ) { // use hash table for lookup if possible
uint32 nHashVal = GetHash(szOrig); size_t32 nHashVal = GetHash(szOrig);
uint32 nIndex = nHashVal % m_nHashSize; size_t32 nIndex = nHashVal % m_nHashSize;
uint32 nIncr = 1 + (nHashVal % (m_nHashSize - 2)); size_t32 nIncr = 1 + (nHashVal % (m_nHashSize - 2));
while ( TRUE ) { while ( TRUE ) {
uint32 nStr = Swap(m_pHashTable[nIndex]); size_t32 nStr = Swap(m_pHashTable[nIndex]);
if ( nStr == 0 ) if ( nStr == 0 )
return NULL; return NULL;
@ -338,7 +338,7 @@ const char *wxMsgCatalog::GetString(const char *szOrig) const
} }
} }
else { // no hash table: use default binary search else { // no hash table: use default binary search
uint32 bottom = 0, size_t32 bottom = 0,
top = m_numStrings, top = m_numStrings,
current; current;
while ( bottom < top ) { while ( bottom < top ) {

View File

@ -428,13 +428,13 @@ void wxLogGui::Flush()
// concatenate all strings (but not too many to not overfill the msg box) // concatenate all strings (but not too many to not overfill the msg box)
wxString str; wxString str;
uint nLines = 0, size_t nLines = 0,
nMsgCount = m_aMessages.Count(); nMsgCount = m_aMessages.Count();
// start from the most recent message // start from the most recent message
for ( uint n = nMsgCount; n > 0; n-- ) { for ( size_t n = nMsgCount; n > 0; n-- ) {
// for Windows strings longer than this value are wrapped (NT 4.0) // for Windows strings longer than this value are wrapped (NT 4.0)
const uint nMsgLineWidth = 156; const size_t nMsgLineWidth = 156;
nLines += (m_aMessages[n - 1].Len() + nMsgLineWidth - 1) / nMsgLineWidth; nLines += (m_aMessages[n - 1].Len() + nMsgLineWidth - 1) / nMsgLineWidth;

View File

@ -135,10 +135,10 @@ NAMESPACE istream& operator>>(NAMESPACE istream& is, wxString& WXUNUSED(str))
~Averager() ~Averager()
{ printf("wxString: average %s = %f\n", m_sz, ((float)m_nTotal)/m_nCount); } { printf("wxString: average %s = %f\n", m_sz, ((float)m_nTotal)/m_nCount); }
void Add(uint n) { m_nTotal += n; m_nCount++; } void Add(size_t n) { m_nTotal += n; m_nCount++; }
private: private:
uint m_nCount, m_nTotal; size_t m_nCount, m_nTotal;
const char *m_sz; const char *m_sz;
} g_averageLength("allocation size"), } g_averageLength("allocation size"),
g_averageSummandLength("summand length"), g_averageSummandLength("summand length"),
@ -255,7 +255,7 @@ void wxString::CopyBeforeWrite()
if ( pData->IsShared() ) { if ( pData->IsShared() ) {
pData->Unlock(); // memory not freed because shared pData->Unlock(); // memory not freed because shared
uint nLen = pData->nDataLength; size_t nLen = pData->nDataLength;
AllocBuffer(nLen); AllocBuffer(nLen);
memcpy(m_pchData, pData->data(), nLen*sizeof(char)); memcpy(m_pchData, pData->data(), nLen*sizeof(char));
} }
@ -280,7 +280,7 @@ void wxString::AllocBeforeWrite(size_t nLen)
} }
// allocate enough memory for nLen characters // allocate enough memory for nLen characters
void wxString::Alloc(uint nLen) void wxString::Alloc(size_t nLen)
{ {
wxStringData *pData = GetStringData(); wxStringData *pData = GetStringData();
if ( pData->nAllocLength <= nLen ) { if ( pData->nAllocLength <= nLen ) {
@ -297,7 +297,7 @@ void wxString::Alloc(uint nLen)
} }
else if ( pData->IsShared() ) { else if ( pData->IsShared() ) {
pData->Unlock(); // memory not freed because shared pData->Unlock(); // memory not freed because shared
uint nOldLen = pData->nDataLength; size_t nOldLen = pData->nDataLength;
AllocBuffer(nLen); AllocBuffer(nLen);
memcpy(m_pchData, pData->data(), nOldLen*sizeof(char)); memcpy(m_pchData, pData->data(), nOldLen*sizeof(char));
} }
@ -338,7 +338,7 @@ void wxString::Shrink()
} }
// get the pointer to writable buffer of (at least) nLen bytes // get the pointer to writable buffer of (at least) nLen bytes
char *wxString::GetWriteBuf(uint nLen) char *wxString::GetWriteBuf(size_t nLen)
{ {
AllocBeforeWrite(nLen); AllocBeforeWrite(nLen);
@ -441,8 +441,8 @@ void wxString::ConcatSelf(int nSrcLen, const char *pszSrcData)
// so we don't waste our time checking for it // so we don't waste our time checking for it
// if ( nSrcLen > 0 ) // if ( nSrcLen > 0 )
wxStringData *pData = GetStringData(); wxStringData *pData = GetStringData();
uint nLen = pData->nDataLength; size_t nLen = pData->nDataLength;
uint nNewLen = nLen + nSrcLen; size_t nNewLen = nLen + nSrcLen;
// alloc new buffer if current is too small // alloc new buffer if current is too small
if ( pData->IsShared() ) { if ( pData->IsShared() ) {
@ -648,11 +648,11 @@ wxString wxString::After(char ch) const
} }
// replace first (or all) occurences of some substring with another one // replace first (or all) occurences of some substring with another one
uint wxString::Replace(const char *szOld, const char *szNew, bool bReplaceAll) size_t wxString::Replace(const char *szOld, const char *szNew, bool bReplaceAll)
{ {
uint uiCount = 0; // count of replacements made size_t uiCount = 0; // count of replacements made
uint uiOldLen = Strlen(szOld); size_t uiOldLen = Strlen(szOld);
wxString strTemp; wxString strTemp;
const char *pCurrent = m_pchData; const char *pCurrent = m_pchData;
@ -886,7 +886,7 @@ bool wxString::Matches(const char *pszMask) const
return TRUE; return TRUE;
// are there any other metacharacters in the mask? // are there any other metacharacters in the mask?
uint uiLenMask; size_t uiLenMask;
const char *pEndMask = strpbrk(pszMask, "*?"); const char *pEndMask = strpbrk(pszMask, "*?");
if ( pEndMask != NULL ) { if ( pEndMask != NULL ) {
@ -1099,7 +1099,7 @@ wxArrayString& wxArrayString::operator=(const wxArrayString& src)
// we can't just copy the pointers here because otherwise we would share // we can't just copy the pointers here because otherwise we would share
// the strings with another array // the strings with another array
for ( uint n = 0; n < src.m_nCount; n++ ) for ( size_t n = 0; n < src.m_nCount; n++ )
Add(src[n]); Add(src[n]);
if ( m_nCount != 0 ) if ( m_nCount != 0 )
@ -1197,7 +1197,7 @@ int wxArrayString::Index(const char *sz, bool bCase, bool bFromEnd) const
{ {
if ( bFromEnd ) { if ( bFromEnd ) {
if ( m_nCount > 0 ) { if ( m_nCount > 0 ) {
uint ui = m_nCount; size_t ui = m_nCount;
do { do {
if ( STRING(m_pItems[--ui])->IsSameAs(sz, bCase) ) if ( STRING(m_pItems[--ui])->IsSameAs(sz, bCase) )
return ui; return ui;
@ -1206,7 +1206,7 @@ int wxArrayString::Index(const char *sz, bool bCase, bool bFromEnd) const
} }
} }
else { else {
for( uint ui = 0; ui < m_nCount; ui++ ) { for( size_t ui = 0; ui < m_nCount; ui++ ) {
if( STRING(m_pItems[ui])->IsSameAs(sz, bCase) ) if( STRING(m_pItems[ui])->IsSameAs(sz, bCase) )
return ui; return ui;
} }
@ -1266,7 +1266,7 @@ void wxArrayString::Remove(const char *sz)
wxCHECK_RET( iIndex != NOT_FOUND, wxCHECK_RET( iIndex != NOT_FOUND,
_("removing inexistent element in wxArrayString::Remove") ); _("removing inexistent element in wxArrayString::Remove") );
Remove((size_t)iIndex); Remove(iIndex);
} }
// sort array elements using passed comparaison function // sort array elements using passed comparaison function

View File

@ -101,13 +101,13 @@ wxTextFile::Type wxTextFile::GuessType() const
wxASSERT( m_file.IsOpened() && m_file.Tell() == 0 ); wxASSERT( m_file.IsOpened() && m_file.Tell() == 0 );
// scan the file lines // scan the file lines
uint nUnix = 0, // number of '\n's alone size_t nUnix = 0, // number of '\n's alone
nDos = 0, // number of '\r\n' nDos = 0, // number of '\r\n'
nMac = 0; // number of '\r's nMac = 0; // number of '\r's
// we take MAX_LINES_SCAN in the beginning, middle and the end of file // we take MAX_LINES_SCAN in the beginning, middle and the end of file
#define MAX_LINES_SCAN (10) #define MAX_LINES_SCAN (10)
uint nCount = m_aLines.Count() / 3, size_t nCount = m_aLines.Count() / 3,
nScan = nCount > 3*MAX_LINES_SCAN ? MAX_LINES_SCAN : nCount / 3; nScan = nCount > 3*MAX_LINES_SCAN ? MAX_LINES_SCAN : nCount / 3;
#define AnalyseLine(n) \ #define AnalyseLine(n) \
@ -118,7 +118,7 @@ wxTextFile::Type wxTextFile::GuessType() const
default: wxFAIL_MSG(_("unknown line terminator")); \ default: wxFAIL_MSG(_("unknown line terminator")); \
} }
uint n; size_t n;
for ( n = 0; n < nScan; n++ ) // the beginning for ( n = 0; n < nScan; n++ ) // the beginning
AnalyseLine(n); AnalyseLine(n);
for ( n = (nCount - nScan)/2; n < (nCount + nScan)/2; n++ ) for ( n = (nCount - nScan)/2; n < (nCount + nScan)/2; n++ )
@ -228,8 +228,8 @@ bool wxTextFile::Write(Type typeNew)
return FALSE; return FALSE;
} }
uint nCount = m_aLines.Count(); size_t nCount = m_aLines.Count();
for ( uint n = 0; n < nCount; n++ ) { for ( size_t n = 0; n < nCount; n++ ) {
fileTmp.Write(m_aLines[n] + fileTmp.Write(m_aLines[n] +
GetEOL(typeNew == Type_None ? m_aTypes[n] : typeNew)); GetEOL(typeNew == Type_None ? m_aTypes[n] : typeNew));
} }

View File

@ -33,7 +33,6 @@ LIB_CPP_SRC=\
common/memory.cpp \ common/memory.cpp \
common/module.cpp \ common/module.cpp \
common/object.cpp \ common/object.cpp \
common/odbc.cpp \
common/postscrp.cpp \ common/postscrp.cpp \
common/prntbase.cpp \ common/prntbase.cpp \
common/resource.cpp \ common/resource.cpp \
@ -162,20 +161,20 @@ LIB_C_SRC=\
gdk_imlib/misc.c \ gdk_imlib/misc.c \
gdk_imlib/rend.c \ gdk_imlib/rend.c \
gdk_imlib/save.c \ gdk_imlib/save.c \
gdk_imlib/utils.c \ gdk_imlib/utils.c
\ # \
iodbc/dlf.c \ # iodbc/dlf.c \
iodbc/dlproc.c \ # iodbc/dlproc.c \
iodbc/herr.c \ # iodbc/herr.c \
iodbc/henv.c \ # iodbc/henv.c \
iodbc/hdbc.c \ # iodbc/hdbc.c \
iodbc/hstmt.c \ # iodbc/hstmt.c \
iodbc/connect.c \ # iodbc/connect.c \
iodbc/prepare.c \ # iodbc/prepare.c \
iodbc/result.c \ # iodbc/result.c \
iodbc/execute.c \ # iodbc/execute.c \
iodbc/fetch.c \ # iodbc/fetch.c \
iodbc/info.c \ # iodbc/info.c \
iodbc/catalog.c \ # iodbc/catalog.c \
iodbc/misc.c \ # iodbc/misc.c \
iodbc/itrace.c # iodbc/itrace.c

View File

@ -57,7 +57,7 @@ void wxDropTarget::RegisterWidget( GtkWidget *widget )
wxString formats; wxString formats;
int valid = 0; int valid = 0;
for ( uint i = 0; i < GetFormatCount(); i++ ) for ( size_t i = 0; i < GetFormatCount(); i++ )
{ {
wxDataFormat df = GetFormat( i ); wxDataFormat df = GetFormat( i );
switch (df) switch (df)
@ -150,7 +150,7 @@ void gtk_drag_callback( GtkWidget *widget, GdkEvent *event, wxDropSource *source
wxDataObject *data = source->m_data; wxDataObject *data = source->m_data;
uint size = data->GetDataSize(); size_t size = data->GetDataSize();
char *ptr = new char[size]; char *ptr = new char[size];
data->GetDataHere( ptr ); data->GetDataHere( ptr );

View File

@ -57,7 +57,7 @@ void wxDropTarget::RegisterWidget( GtkWidget *widget )
wxString formats; wxString formats;
int valid = 0; int valid = 0;
for ( uint i = 0; i < GetFormatCount(); i++ ) for ( size_t i = 0; i < GetFormatCount(); i++ )
{ {
wxDataFormat df = GetFormat( i ); wxDataFormat df = GetFormat( i );
switch (df) switch (df)
@ -150,7 +150,7 @@ void gtk_drag_callback( GtkWidget *widget, GdkEvent *event, wxDropSource *source
wxDataObject *data = source->m_data; wxDataObject *data = source->m_data;
uint size = data->GetDataSize(); size_t size = data->GetDataSize();
char *ptr = new char[size]; char *ptr = new char[size];
data->GetDataHere( ptr ); data->GetDataHere( ptr );

View File

@ -47,7 +47,7 @@ class wxCheckListBoxItem : public wxOwnerDrawn
{ {
public: public:
// ctor // ctor
wxCheckListBoxItem(wxCheckListBox *pParent, uint nIndex); wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex);
// drawing functions // drawing functions
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat); virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
@ -60,10 +60,10 @@ public:
private: private:
bool m_bChecked; bool m_bChecked;
wxCheckListBox *m_pParent; wxCheckListBox *m_pParent;
uint m_nIndex; size_t m_nIndex;
}; };
wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, uint nIndex) wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex)
: wxOwnerDrawn("", TRUE) // checkable : wxOwnerDrawn("", TRUE) // checkable
{ {
m_bChecked = FALSE; m_bChecked = FALSE;
@ -95,7 +95,7 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
if ( wxOwnerDrawn::OnDrawItem(dc, rc, act, stat) ) { if ( wxOwnerDrawn::OnDrawItem(dc, rc, act, stat) ) {
// ## using native API for performance and precision // ## using native API for performance and precision
uint nCheckWidth = GetDefaultMarginWidth(), size_t nCheckWidth = GetDefaultMarginWidth(),
nCheckHeight = m_pParent->GetItemHeight(); nCheckHeight = m_pParent->GetItemHeight();
int x = rc.GetX(), int x = rc.GetX(),
@ -188,8 +188,8 @@ void wxCheckListBoxItem::Toggle()
{ {
m_bChecked = !m_bChecked; m_bChecked = !m_bChecked;
uint nHeight = m_pParent->GetItemHeight(); size_t nHeight = m_pParent->GetItemHeight();
uint y = m_nIndex * nHeight; size_t y = m_nIndex * nHeight;
RECT rcUpdate = { 0, y, GetDefaultMarginWidth(), y + nHeight}; RECT rcUpdate = { 0, y, GetDefaultMarginWidth(), y + nHeight};
InvalidateRect((HWND)m_pParent->GetHWND(), &rcUpdate, FALSE); InvalidateRect((HWND)m_pParent->GetHWND(), &rcUpdate, FALSE);
@ -236,7 +236,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
// -------------------- // --------------------
// create a check list box item // create a check list box item
wxOwnerDrawn *wxCheckListBox::CreateItem(uint nIndex) wxOwnerDrawn *wxCheckListBox::CreateItem(size_t nIndex)
{ {
wxCheckListBoxItem *pItem = new wxCheckListBoxItem(this, nIndex); wxCheckListBoxItem *pItem = new wxCheckListBoxItem(this, nIndex);
if ( m_windowFont.Ok() ) if ( m_windowFont.Ok() )
@ -270,12 +270,12 @@ bool wxCheckListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item)
// check items // check items
// ----------- // -----------
bool wxCheckListBox::IsChecked(uint uiIndex) const bool wxCheckListBox::IsChecked(size_t uiIndex) const
{ {
return GetItem(uiIndex)->IsChecked(); return GetItem(uiIndex)->IsChecked();
} }
void wxCheckListBox::Check(uint uiIndex, bool bCheck) void wxCheckListBox::Check(size_t uiIndex, bool bCheck)
{ {
GetItem(uiIndex)->Check(bCheck); GetItem(uiIndex)->Check(bCheck);
} }
@ -296,8 +296,8 @@ void wxCheckListBox::OnLeftClick(wxMouseEvent& event)
// clicking on the item selects it, clicking on the checkmark toggles // clicking on the item selects it, clicking on the checkmark toggles
if ( event.GetX() <= wxOwnerDrawn::GetDefaultMarginWidth() ) { if ( event.GetX() <= wxOwnerDrawn::GetDefaultMarginWidth() ) {
// # better use LB_ITEMFROMPOINT perhaps? // # better use LB_ITEMFROMPOINT perhaps?
uint nItem = ((uint)event.GetY()) / m_nItemHeight; size_t nItem = ((size_t)event.GetY()) / m_nItemHeight;
if ( nItem < (uint)m_noItems ) if ( nItem < (size_t)m_noItems )
GetItem(nItem)->Toggle(); GetItem(nItem)->Toggle();
//else: it's not an error, just click outside of client zone //else: it's not an error, just click outside of client zone
} }

View File

@ -100,7 +100,7 @@ static PAINTSTRUCT g_paintStruct;
// for example, if calling a base class OnPaint. // for example, if calling a base class OnPaint.
WXHDC wxPaintDC::ms_PaintHDC = 0; WXHDC wxPaintDC::ms_PaintHDC = 0;
uint wxPaintDC::ms_PaintCount = 0; // count of ms_PaintHDC usage size_t wxPaintDC::ms_PaintCount = 0; // count of ms_PaintHDC usage
wxPaintDC::wxPaintDC(wxWindow *canvas) wxPaintDC::wxPaintDC(wxWindow *canvas)
{ {

View File

@ -97,7 +97,7 @@ void wxIniConfig::SetPath(const wxString& strPath)
wxSplitPath(aParts, strFullPath); wxSplitPath(aParts, strFullPath);
} }
uint nPartsCount = aParts.Count(); size_t nPartsCount = aParts.Count();
m_strPath.Empty(); m_strPath.Empty();
if ( nPartsCount == 0 ) { if ( nPartsCount == 0 ) {
// go to the root // go to the root
@ -106,7 +106,7 @@ void wxIniConfig::SetPath(const wxString& strPath)
else { else {
// translate // translate
m_strGroup = aParts[0u]; m_strGroup = aParts[0u];
for ( uint nPart = 1; nPart < nPartsCount; nPart++ ) { for ( size_t nPart = 1; nPart < nPartsCount; nPart++ ) {
if ( nPart > 1 ) if ( nPart > 1 )
m_strPath << PATH_SEP_REPLACE; m_strPath << PATH_SEP_REPLACE;
m_strPath << aParts[nPart]; m_strPath << aParts[nPart];
@ -206,18 +206,18 @@ bool wxIniConfig::GetNextEntry (wxString& str, long& lIndex) const
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// not implemented // not implemented
uint wxIniConfig::GetNumberOfEntries(bool bRecursive) const size_t wxIniConfig::GetNumberOfEntries(bool bRecursive) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG("not implemented");
return (uint)-1; return (size_t)-1;
} }
uint wxIniConfig::GetNumberOfGroups(bool bRecursive) const size_t wxIniConfig::GetNumberOfGroups(bool bRecursive) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG("not implemented");
return (uint)-1; return (size_t)-1;
} }
bool wxIniConfig::HasGroup(const wxString& strName) const bool wxIniConfig::HasGroup(const wxString& strName) const
@ -408,7 +408,7 @@ bool wxIniConfig::DeleteAll()
// then delete our own ini file // then delete our own ini file
char szBuf[MAX_PATH]; char szBuf[MAX_PATH];
uint nRc = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf)); size_t nRc = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf));
if ( nRc == 0 ) if ( nRc == 0 )
wxLogLastError("GetWindowsDirectory"); wxLogLastError("GetWindowsDirectory");
else if ( nRc > WXSIZEOF(szBuf) ) else if ( nRc > WXSIZEOF(szBuf) )

View File

@ -67,7 +67,7 @@ wxListBoxItem::wxListBoxItem(const wxString& str) : wxOwnerDrawn(str, FALSE)
SetMarginWidth(0); SetMarginWidth(0);
} }
wxOwnerDrawn *wxListBox::CreateItem(uint n) wxOwnerDrawn *wxListBox::CreateItem(size_t n)
{ {
return new wxListBoxItem(); return new wxListBoxItem();
} }
@ -224,14 +224,14 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
// Subclass again to catch messages // Subclass again to catch messages
SubclassWin((WXHWND)wx_list); SubclassWin((WXHWND)wx_list);
uint ui; size_t ui;
for (ui = 0; ui < (uint)n; ui++) { for (ui = 0; ui < (size_t)n; ui++) {
SendMessage(wx_list, LB_ADDSTRING, 0, (LPARAM)(const char *)choices[ui]); SendMessage(wx_list, LB_ADDSTRING, 0, (LPARAM)(const char *)choices[ui]);
} }
#if USE_OWNER_DRAWN #if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) { if ( m_windowStyle & wxLB_OWNERDRAW ) {
for (ui = 0; ui < (uint)n; ui++) { for (ui = 0; ui < (size_t)n; ui++) {
// create new item which will process WM_{DRAW|MEASURE}ITEM messages // create new item which will process WM_{DRAW|MEASURE}ITEM messages
wxOwnerDrawn *pNewItem = CreateItem(ui); wxOwnerDrawn *pNewItem = CreateItem(ui);
pNewItem->SetName(choices[ui]); pNewItem->SetName(choices[ui]);
@ -256,7 +256,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
wxListBox::~wxListBox(void) wxListBox::~wxListBox(void)
{ {
#if USE_OWNER_DRAWN #if USE_OWNER_DRAWN
uint uiCount = m_aItems.Count(); size_t uiCount = m_aItems.Count();
while ( uiCount-- != 0 ) { while ( uiCount-- != 0 ) {
delete m_aItems[uiCount]; delete m_aItems[uiCount];
} }
@ -340,14 +340,14 @@ void wxListBox::Set(int n, const wxString *choices, char** clientData)
#if USE_OWNER_DRAWN #if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) { if ( m_windowStyle & wxLB_OWNERDRAW ) {
// first delete old items // first delete old items
uint ui = m_aItems.Count(); size_t ui = m_aItems.Count();
while ( ui-- != 0 ) { while ( ui-- != 0 ) {
delete m_aItems[ui]; delete m_aItems[ui];
} }
m_aItems.Empty(); m_aItems.Empty();
// then create new ones // then create new ones
for (ui = 0; ui < (uint)n; ui++) { for (ui = 0; ui < (size_t)n; ui++) {
wxOwnerDrawn *pNewItem = CreateItem(ui); wxOwnerDrawn *pNewItem = CreateItem(ui);
pNewItem->SetName(choices[ui]); pNewItem->SetName(choices[ui]);
m_aItems.Add(pNewItem); m_aItems.Add(pNewItem);
@ -595,9 +595,9 @@ wxListBox::InsertItems(int nItems, const wxString items[], int pos)
#if USE_OWNER_DRAWN #if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) { if ( m_windowStyle & wxLB_OWNERDRAW ) {
for ( i = 0; i < nItems; i++ ) { for ( i = 0; i < nItems; i++ ) {
wxOwnerDrawn *pNewItem = CreateItem((uint)(pos + i)); wxOwnerDrawn *pNewItem = CreateItem((size_t)(pos + i));
pNewItem->SetName(items[i]); pNewItem->SetName(items[i]);
m_aItems.Insert(pNewItem, (uint)(pos + i)); m_aItems.Insert(pNewItem, (size_t)(pos + i));
ListBox_SetItemData(hwnd, i, pNewItem); ListBox_SetItemData(hwnd, i, pNewItem);
} }
} }

View File

@ -363,8 +363,8 @@ void wxNotebook::OnSize(wxSizeEvent& event)
GetSize((int *)&rc.right, (int *)&rc.bottom); GetSize((int *)&rc.right, (int *)&rc.bottom);
TabCtrl_AdjustRect(m_hwnd, FALSE, &rc); TabCtrl_AdjustRect(m_hwnd, FALSE, &rc);
uint nCount = m_aPages.Count(); size_t nCount = m_aPages.Count();
for ( uint nPage = 0; nPage < nCount; nPage++ ) { for ( size_t nPage = 0; nPage < nCount; nPage++ ) {
wxNotebookPage *pPage = m_aPages[nPage]; wxNotebookPage *pPage = m_aPages[nPage];
pPage->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top); pPage->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
if ( pPage->GetAutoLayout() ) if ( pPage->GetAutoLayout() )

View File

@ -159,7 +159,7 @@ const char *GetIidName(REFIID riid)
#undef ADD_KNOWN_IID #undef ADD_KNOWN_IID
// try to find the interface in the table // try to find the interface in the table
for ( uint ui = 0; ui < WXSIZEOF(aKnownIids); ui++ ) { for ( size_t ui = 0; ui < WXSIZEOF(aKnownIids); ui++ ) {
if ( riid == *aKnownIids[ui].pIid ) { if ( riid == *aKnownIids[ui].pIid ) {
return aKnownIids[ui].szName; return aKnownIids[ui].szName;
} }

View File

@ -46,18 +46,18 @@ wxOwnerDrawn::wxOwnerDrawn(const wxString& str,
} }
#if defined(__WXMSW__) && defined(__WIN32__) #if defined(__WXMSW__) && defined(__WIN32__)
uint wxOwnerDrawn::ms_nDefaultMarginWidth = GetSystemMetrics(SM_CXMENUCHECK); size_t wxOwnerDrawn::ms_nDefaultMarginWidth = GetSystemMetrics(SM_CXMENUCHECK);
#else // # what is the reasonable default? #else // # what is the reasonable default?
uint wxOwnerDrawn::ms_nDefaultMarginWidth = 15; size_t wxOwnerDrawn::ms_nDefaultMarginWidth = 15;
#endif #endif
uint wxOwnerDrawn::ms_nLastMarginWidth = ms_nDefaultMarginWidth; size_t wxOwnerDrawn::ms_nLastMarginWidth = ms_nDefaultMarginWidth;
// drawing // drawing
// ------- // -------
// get size of the item // get size of the item
bool wxOwnerDrawn::OnMeasureItem(uint *pwidth, uint *pheight) bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight)
{ {
wxMemoryDC dc; wxMemoryDC dc;
dc.SetFont(GetFont()); dc.SetFont(GetFont());

View File

@ -111,7 +111,7 @@ void wxRegConfig::SetPath(const wxString& strPath)
// recombine path parts in one variable // recombine path parts in one variable
wxString strRegPath; wxString strRegPath;
m_strPath.Empty(); m_strPath.Empty();
for ( uint n = 0; n < aParts.Count(); n++ ) { for ( size_t n = 0; n < aParts.Count(); n++ ) {
strRegPath << '\\' << aParts[n]; strRegPath << '\\' << aParts[n];
m_strPath << wxCONFIG_PATH_SEPARATOR << aParts[n]; m_strPath << wxCONFIG_PATH_SEPARATOR << aParts[n];
} }
@ -198,9 +198,9 @@ bool wxRegConfig::GetNextEntry(wxString& str, long& lIndex) const
return bOk; return bOk;
} }
uint wxRegConfig::GetNumberOfEntries(bool bRecursive) const size_t wxRegConfig::GetNumberOfEntries(bool bRecursive) const
{ {
uint nEntries = 0; size_t nEntries = 0;
// dummy vars // dummy vars
wxString str; wxString str;
@ -215,9 +215,9 @@ uint wxRegConfig::GetNumberOfEntries(bool bRecursive) const
return nEntries; return nEntries;
} }
uint wxRegConfig::GetNumberOfGroups(bool bRecursive) const size_t wxRegConfig::GetNumberOfGroups(bool bRecursive) const
{ {
uint nGroups = 0; size_t nGroups = 0;
// dummy vars // dummy vars
wxString str; wxString str;

View File

@ -342,7 +342,7 @@ void wxRegionIterator::Reset(const wxRegion& region)
m_rects = new wxRect[header->nCount]; m_rects = new wxRect[header->nCount];
RECT* rect = (RECT*) (rgnData + sizeof(RGNDATAHEADER)) ; RECT* rect = (RECT*) (rgnData + sizeof(RGNDATAHEADER)) ;
uint i; size_t i;
for (i = 0; i < header->nCount; i++) for (i = 0; i < header->nCount; i++)
{ {
m_rects[i] = wxRect(rect->left, rect->top, m_rects[i] = wxRect(rect->left, rect->top,

View File

@ -86,6 +86,10 @@ aStdKeys[] =
// the registry name separator (perhaps one day MS will change it to '/' ;-) // the registry name separator (perhaps one day MS will change it to '/' ;-)
#define REG_SEPARATOR '\\' #define REG_SEPARATOR '\\'
// useful for Windows programmers: makes somewhat more clear all these zeroes
// being passed to Windows APIs
#define RESERVED (NULL)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// macros // macros
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -122,7 +126,7 @@ const size_t wxRegKey::nStdKeys = WXSIZEOF(aStdKeys);
// @@ should take a `StdKey key', but as it's often going to be used in loops // @@ should take a `StdKey key', but as it's often going to be used in loops
// it would require casts in user code. // it would require casts in user code.
const char *wxRegKey::GetStdKeyName(uint key) const char *wxRegKey::GetStdKeyName(size_t key)
{ {
// return empty string if key is invalid // return empty string if key is invalid
wxCHECK_MSG( key < nStdKeys, "", "invalid key in wxRegKey::GetStdKeyName" ); wxCHECK_MSG( key < nStdKeys, "", "invalid key in wxRegKey::GetStdKeyName" );
@ -130,7 +134,7 @@ const char *wxRegKey::GetStdKeyName(uint key)
return aStdKeys[key].szName; return aStdKeys[key].szName;
} }
const char *wxRegKey::GetStdKeyShortName(uint key) const char *wxRegKey::GetStdKeyShortName(size_t key)
{ {
// return empty string if key is invalid // return empty string if key is invalid
wxCHECK( key < nStdKeys, "" ); wxCHECK( key < nStdKeys, "" );
@ -143,7 +147,7 @@ wxRegKey::StdKey wxRegKey::ExtractKeyName(wxString& strKey)
wxString strRoot = strKey.Left(REG_SEPARATOR); wxString strRoot = strKey.Left(REG_SEPARATOR);
HKEY hRootKey; HKEY hRootKey;
uint ui; size_t ui;
for ( ui = 0; ui < nStdKeys; ui++ ) { for ( ui = 0; ui < nStdKeys; ui++ ) {
if ( strRoot.CmpNoCase(aStdKeys[ui].szName) == 0 || if ( strRoot.CmpNoCase(aStdKeys[ui].szName) == 0 ||
strRoot.CmpNoCase(aStdKeys[ui].szShortName) == 0 ) { strRoot.CmpNoCase(aStdKeys[ui].szShortName) == 0 ) {
@ -168,7 +172,7 @@ wxRegKey::StdKey wxRegKey::ExtractKeyName(wxString& strKey)
wxRegKey::StdKey wxRegKey::GetStdKeyFromHkey(HKEY hkey) wxRegKey::StdKey wxRegKey::GetStdKeyFromHkey(HKEY hkey)
{ {
for ( uint ui = 0; ui < nStdKeys; ui++ ) { for ( size_t ui = 0; ui < nStdKeys; ui++ ) {
if ( aStdKeys[ui].hkey == hkey ) if ( aStdKeys[ui].hkey == hkey )
return (StdKey)ui; return (StdKey)ui;
} }
@ -298,10 +302,10 @@ wxString wxRegKey::GetName(bool bShortPrefix) const
} }
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
bool wxRegKey::GetKeyInfo(uint* pnSubKeys, bool wxRegKey::GetKeyInfo(size_t* pnSubKeys,
uint* pnMaxKeyLen, size_t* pnMaxKeyLen,
uint* pnValues, size_t* pnValues,
uint* pnMaxValueLen) const size_t* pnMaxValueLen) const
#else #else
bool wxRegKey::GetKeyInfo(ulong *pnSubKeys, bool wxRegKey::GetKeyInfo(ulong *pnSubKeys,
ulong *pnMaxKeyLen, ulong *pnMaxKeyLen,
@ -427,8 +431,8 @@ bool wxRegKey::DeleteSelf()
bCont = GetNextKey(strKey, lIndex); bCont = GetNextKey(strKey, lIndex);
} }
uint nKeyCount = astrSubkeys.Count(); size_t nKeyCount = astrSubkeys.Count();
for ( uint nKey = 0; nKey < nKeyCount; nKey++ ) { for ( size_t nKey = 0; nKey < nKeyCount; nKey++ ) {
wxRegKey key(*this, astrSubkeys[nKey]); wxRegKey key(*this, astrSubkeys[nKey]);
if ( !key.DeleteSelf() ) if ( !key.DeleteSelf() )
return FALSE; return FALSE;