X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/216a72f3b9ab2bf72f489aceac0093138a6e7707..0be274189380d9de3c60836dab2fc080f21f88ee:/src/common/longlong.cpp diff --git a/src/common/longlong.cpp b/src/common/longlong.cpp index b8364d8579..772ecc0b9a 100644 --- a/src/common/longlong.cpp +++ b/src/common/longlong.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/longlong.cpp +// Name: src/common/longlong.cpp // Purpose: implementation of wxLongLongNative // Author: Jeffrey C. Ollie , Vadim Zeitlin // Remarks: this class is not public in wxWidgets 2.0! It is intentionally @@ -22,17 +22,21 @@ #endif #if wxUSE_LONGLONG + #include "wx/longlong.h" -#include "wx/math.h" // for fabs() + +#ifndef WX_PRECOMP + #include "wx/math.h" // for fabs() +#endif #if wxUSE_STREAMS -#include "wx/txtstrm.h" + #include "wx/txtstrm.h" #endif #if defined(__MWERKS__) && defined(__WXMSW__) -#include // for memset() + #include // for memset() #else -#include // for memset() + #include // for memset() #endif #include "wx/ioswrap.h" @@ -190,6 +194,19 @@ double wxLongLongWx::ToDouble() const return d; } +double wxULongLongWx::ToDouble() const +{ + unsigned double d = m_hi; + d *= 1.0 + (double)ULONG_MAX; + d += m_lo; + +#ifdef wxLONGLONG_TEST_MODE + wxASSERT( d == m_ll ); +#endif // wxLONGLONG_TEST_MODE + + return d; +} + wxLongLongWx wxLongLongWx::operator<<(int shift) const { wxLongLongWx ll(*this); @@ -1257,7 +1274,7 @@ WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &o, wxString s = o.ReadWord(); ll = wxULongLong(0l, 0l); - size_t length = s.Length(); + size_t length = s.length(); size_t idx = 0; wxChar ch = READ_STRING_CHAR(s, idx, length); @@ -1282,7 +1299,7 @@ WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &o, wxString s = o.ReadWord(); ll = wxLongLong(0l, 0l); - size_t length = s.Length(); + size_t length = s.length(); size_t idx = 0; wxChar ch = READ_STRING_CHAR(s, idx, length);