Hello,
I'd just like to clarify the usage of wxInt16, should it be used to replace int or is int ok to use as standard? My understanding was that int would not port to devices such as Palm whereas wxInt16 would.
Cheers,
Usage of wxInt16 and int Topic is solved
Re: Usage of wxInt16 and int
Actually wxInt16 is just a typedef for signed short. Using int is perfectly fine, but there's a little bit more to wxInt16: It does some automatic byte swapping when needed. For PowerPC platforms, wxInt16 is allways byte swapped, meaing the endianess is changed from little endian (Intel platforms) to big endian (Mac). You can however use int and do the swapping yourself if needed using the wxINTXX_SWAP_XXX() macros.furries wrote: I'd just like to clarify the usage of wxInt16, should it be used to replace int or is int ok to use as standard? My understanding was that int would not port to devices such as Palm whereas wxInt16 would.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
Using wxInt16 you don't have to, using int you'll need to swap bytes before using values (loading saved docs, recieved transmission etc.)furries wrote:I see, so when for MacOS I will need to add #ifdefs to convert?
LPCSTR -> CHAR* -> char*furries wrote: LPCTSTR - pointer to a string? So I can replace with wxString*?
I depends on what you want to do. To construct a wxString from char* use either string = char_array, or wxString string(char_array).
To get a wxStringas a char*, use one of the xxx_str() functions, like c_str(), mb_str() etc.
UINT -> unsigned intfurries wrote: UINT - not sure what I should replace this with!
Should be wxUint16
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
Ups, right, 32 bits, sorry for that one.
http://www.wxwidgets.org/manuals/2.6.2/ ... rdermacros
There's a list of byte order macros to use.
The types are:
wxInt32
wxUint32
wxInt16
wxUint16
There's also wxLongLong, for 64 bit values. For compilers that don't support 64 bit variables, wxWidgets "emulates" this type. Normaly newer compilers should support "long long" or "__int64" as types. In that case wxLongLong is only a define for the correct type.
http://www.wxwidgets.org/manuals/2.6.2/ ... rdermacros
There's a list of byte order macros to use.
The types are:
wxInt32
wxUint32
wxInt16
wxUint16
There's also wxLongLong, for 64 bit values. For compilers that don't support 64 bit variables, wxWidgets "emulates" this type. Normaly newer compilers should support "long long" or "__int64" as types. In that case wxLongLong is only a define for the correct type.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda