added wx(U)int64, then added it to wxDataStream so contrib should
(hopefully) now build on alpha, ia64, s/390 without the kludge from 2.2 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12701 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
1489a2c037
commit
41b0a1139d
19
debian/changelog
vendored
19
debian/changelog
vendored
@ -22,6 +22,25 @@ wxwindows2.3 (2.3.0) unstable; urgency=low
|
||||
|
||||
-- Ron Lee <ron@debian.org> Sat, 27 Jan 2001 01:51:24 -0800
|
||||
|
||||
wxwindows2.2 (2.2.8.4) unstable; urgency=low
|
||||
|
||||
* Put the (modified) size_t == ulong kludge back into sndwav.cpp
|
||||
it's still needed until wxDataOutputStream is made 64 bit
|
||||
friendly, which may not happen for 2.2 since it will probably
|
||||
not be binary compatible.
|
||||
* caps a memory leak in the jpeg handler.
|
||||
|
||||
-- Ron Lee <ron@debian.org> Sun, 25 Nov 2001 11:53:59 -0800
|
||||
|
||||
wxwindows2.2 (2.2.8.3) unstable; urgency=low
|
||||
|
||||
* Backported size_t test from 2.3 tree, removes the need for
|
||||
specific tests for various 64 bit platforms including now
|
||||
S/390 (thanks to Gerhard Tonn for the report).
|
||||
Closes: #120768
|
||||
|
||||
-- Ron Lee <ron@debian.org> Fri, 23 Nov 2001 20:53:49 -0800
|
||||
|
||||
wxwindows2.2 (2.2.8.2) unstable; urgency=low
|
||||
|
||||
* python-dev doesn't get me python? More bytes in Build-Dep then
|
||||
|
@ -17,6 +17,7 @@
|
||||
#endif
|
||||
|
||||
#include "wx/stream.h"
|
||||
#include "wx/longlong.h"
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
|
||||
@ -28,6 +29,7 @@ public:
|
||||
|
||||
bool IsOk() { return m_input->IsOk(); }
|
||||
|
||||
wxUint64 Read64();
|
||||
wxUint32 Read32();
|
||||
wxUint16 Read16();
|
||||
wxUint8 Read8();
|
||||
@ -41,6 +43,7 @@ public:
|
||||
wxDataInputStream& operator>>(wxUint8& c);
|
||||
wxDataInputStream& operator>>(wxUint16& i);
|
||||
wxDataInputStream& operator>>(wxUint32& i);
|
||||
wxDataInputStream& operator>>(wxUint64& i);
|
||||
wxDataInputStream& operator>>(double& i);
|
||||
wxDataInputStream& operator>>(float& f);
|
||||
|
||||
@ -59,6 +62,7 @@ public:
|
||||
|
||||
bool IsOk() { return m_output->IsOk(); }
|
||||
|
||||
void Write64(wxUint64 i);
|
||||
void Write32(wxUint32 i);
|
||||
void Write16(wxUint16 i);
|
||||
void Write8(wxUint8 i);
|
||||
@ -73,6 +77,7 @@ public:
|
||||
wxDataOutputStream& operator<<(wxUint8 c);
|
||||
wxDataOutputStream& operator<<(wxUint16 i);
|
||||
wxDataOutputStream& operator<<(wxUint32 i);
|
||||
wxDataOutputStream& operator<<(wxUint64 i);
|
||||
wxDataOutputStream& operator<<(double f);
|
||||
wxDataOutputStream& operator<<(float f);
|
||||
|
||||
|
@ -164,13 +164,11 @@
|
||||
#endif // compilers
|
||||
#endif // HAVE_BOOL
|
||||
|
||||
#if !defined(HAVE_BOOL) && !defined(bool)
|
||||
#if !defined(HAVE_BOOL) && !defined(bool) && !defined(VMS)
|
||||
// NB: of course, this doesn't replace the standard type, because, for
|
||||
// example, overloading based on bool/int parameter doesn't work and
|
||||
// so should be avoided in portable programs
|
||||
#ifndef VMS
|
||||
typedef unsigned int bool;
|
||||
#endif
|
||||
#endif // bool
|
||||
|
||||
typedef short int WXTYPE;
|
||||
@ -433,47 +431,27 @@ enum
|
||||
#define wxInt8 char signed
|
||||
#define wxUint8 char unsigned
|
||||
|
||||
#ifdef __WIN16__
|
||||
#if defined(__WIN16__) || (defined(SIZEOF_INT) && (SIZEOF_INT == 2))
|
||||
#define wxInt16 int signed
|
||||
#define wxUint16 int unsigned
|
||||
#define wxInt32 long signed
|
||||
#define wxUint32 long unsigned
|
||||
#endif
|
||||
|
||||
#ifdef __WIN32__
|
||||
#else
|
||||
#define wxInt16 short signed
|
||||
#define wxUint16 short unsigned
|
||||
#define wxInt32 int signed
|
||||
#define wxUint32 int unsigned
|
||||
#endif
|
||||
|
||||
#ifdef __WXMAC__
|
||||
#define wxInt16 short signed
|
||||
#define wxUint16 short unsigned
|
||||
#define wxInt32 int signed
|
||||
#define wxUint32 int unsigned
|
||||
#endif
|
||||
|
||||
#ifdef __WXOS2__
|
||||
#define wxInt16 short signed
|
||||
#define wxUint16 short unsigned
|
||||
#define wxInt32 int signed
|
||||
#define wxUint32 int unsigned
|
||||
#endif
|
||||
|
||||
#if !defined(__WXMSW__) && !defined(__WXMAC__) && !defined(__WXOS2__)
|
||||
#if defined(SIZEOF_INT)
|
||||
/* well, this shouldn't happen... */
|
||||
#define wxInt16 short signed
|
||||
#define wxUint16 short unsigned
|
||||
#define wxInt32 int signed
|
||||
#define wxUint32 int unsigned
|
||||
#else
|
||||
#define wxInt16 short signed
|
||||
#define wxUint16 short unsigned
|
||||
#define wxInt32 int signed
|
||||
#define wxUint32 int unsigned
|
||||
#endif
|
||||
#if defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
|
||||
#define wxInt64 long signed
|
||||
#define wxUint64 long unsigned
|
||||
#elif defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
|
||||
#define wxInt64 long long signed
|
||||
#define wxUint64 long long unsigned
|
||||
#else // FIXME: what else can we do here aside from implementing wxULongLong
|
||||
#define wxInt64 wxLongLong
|
||||
#define wxUint64 wxLongLong
|
||||
#endif
|
||||
|
||||
#define wxByte wxUint8
|
||||
@ -572,6 +550,29 @@ typedef float wxFloat32 ;
|
||||
#endif
|
||||
// machine specific byte swapping
|
||||
|
||||
#define wxUINT64_SWAP_ALWAYS(val) \
|
||||
((wxUint64) ( \
|
||||
((wxLongLong(val) & wxLongLong(0L, 0x000000ffU)) << 56) | \
|
||||
((wxLongLong(val) & wxLongLong(0L, 0x0000ff00U)) << 40) | \
|
||||
((wxLongLong(val) & wxLongLong(0L, 0x00ff0000U)) << 24) | \
|
||||
((wxLongLong(val) & wxLongLong(0L, 0xff000000U)) << 8) | \
|
||||
((wxLongLong(val) & wxLongLong(0x000000ffL, 0U)) >> 8) | \
|
||||
((wxLongLong(val) & wxLongLong(0x0000ff00L, 0U)) >> 24) | \
|
||||
((wxLongLong(val) & wxLongLong(0x00ff0000L, 0U)) >> 40) | \
|
||||
((wxLongLong(val) & wxLongLong(0xff000000L, 0U)) >> 56)).GetValue())
|
||||
|
||||
#define wxINT64_SWAP_ALWAYS(val) \
|
||||
((wxInt64) ( \
|
||||
((wxLongLong(val) & wxLongLong(0L, 0x000000ffU)) << 56) | \
|
||||
((wxLongLong(val) & wxLongLong(0L, 0x0000ff00U)) << 40) | \
|
||||
((wxLongLong(val) & wxLongLong(0L, 0x00ff0000U)) << 24) | \
|
||||
((wxLongLong(val) & wxLongLong(0L, 0xff000000U)) << 8) | \
|
||||
((wxLongLong(val) & wxLongLong(0x000000ffL, 0U)) >> 8) | \
|
||||
((wxLongLong(val) & wxLongLong(0x0000ff00L, 0U)) >> 24) | \
|
||||
((wxLongLong(val) & wxLongLong(0x00ff0000L, 0U)) >> 40) | \
|
||||
((wxLongLong(val) & wxLongLong(0xff000000L, 0U)) >> 56)).GetValue())
|
||||
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define wxUINT16_SWAP_ON_BE(val) wxUINT16_SWAP_ALWAYS(val)
|
||||
#define wxINT16_SWAP_ON_BE(val) wxINT16_SWAP_ALWAYS(val)
|
||||
@ -581,6 +582,8 @@ typedef float wxFloat32 ;
|
||||
#define wxINT32_SWAP_ON_BE(val) wxINT32_SWAP_ALWAYS(val)
|
||||
#define wxUINT32_SWAP_ON_LE(val) (val)
|
||||
#define wxINT32_SWAP_ON_LE(val) (val)
|
||||
#define wxUINT64_SWAP_ON_BE(val) wxUINT64_SWAP_ALWAYS(val)
|
||||
#define wxUINT64_SWAP_ON_LE(val) (val)
|
||||
#else
|
||||
#define wxUINT16_SWAP_ON_LE(val) wxUINT16_SWAP_ALWAYS(val)
|
||||
#define wxINT16_SWAP_ON_LE(val) wxINT16_SWAP_ALWAYS(val)
|
||||
@ -590,6 +593,8 @@ typedef float wxFloat32 ;
|
||||
#define wxINT32_SWAP_ON_LE(val) wxINT32_SWAP_ALWAYS(val)
|
||||
#define wxUINT32_SWAP_ON_BE(val) (val)
|
||||
#define wxINT32_SWAP_ON_BE(val) (val)
|
||||
#define wxUINT64_SWAP_ON_LE(val) wxUINT64_SWAP_ALWAYS(val)
|
||||
#define wxUINT64_SWAP_ON_BE(val) (val)
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -37,6 +37,18 @@ wxDataInputStream::~wxDataInputStream()
|
||||
{
|
||||
}
|
||||
|
||||
wxUint64 wxDataInputStream::Read64()
|
||||
{
|
||||
wxUint64 i64;
|
||||
|
||||
m_input->Read(&i64, 8);
|
||||
|
||||
if (m_be_order)
|
||||
return wxUINT64_SWAP_ON_LE(i64);
|
||||
else
|
||||
return wxUINT64_SWAP_ON_BE(i64);
|
||||
}
|
||||
|
||||
wxUint32 wxDataInputStream::Read32()
|
||||
{
|
||||
wxUint32 i32;
|
||||
@ -151,6 +163,12 @@ wxDataInputStream& wxDataInputStream::operator>>(wxUint32& i)
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxDataInputStream& wxDataInputStream::operator>>(wxUint64& i)
|
||||
{
|
||||
i = Read64();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxDataInputStream& wxDataInputStream::operator>>(double& i)
|
||||
{
|
||||
i = ReadDouble();
|
||||
@ -176,6 +194,17 @@ wxDataOutputStream::~wxDataOutputStream()
|
||||
{
|
||||
}
|
||||
|
||||
void wxDataOutputStream::Write64(wxUint64 i)
|
||||
{
|
||||
wxUint64 i64;
|
||||
|
||||
if (m_be_order)
|
||||
i64 = wxUINT64_SWAP_ON_LE(i);
|
||||
else
|
||||
i64 = wxUINT64_SWAP_ON_BE(i);
|
||||
m_output->Write(&i64, 8);
|
||||
}
|
||||
|
||||
void wxDataOutputStream::Write32(wxUint32 i)
|
||||
{
|
||||
wxUint32 i32;
|
||||
@ -279,6 +308,12 @@ wxDataOutputStream& wxDataOutputStream::operator<<(wxUint32 i)
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxDataOutputStream& wxDataOutputStream::operator<<(wxUint64 i)
|
||||
{
|
||||
Write64(i);
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxDataOutputStream& wxDataOutputStream::operator<<(double f)
|
||||
{
|
||||
WriteDouble(f);
|
||||
|
Loading…
Reference in New Issue
Block a user