Remove wxUSE_LONGLONG and always use wxLongLong_t

All supported platforms provide 64-bit integer types since many years,
so remove the legacy wxLongLongWx implementation and rename
wxLongLongNative to just wxLongLong and always compile it in.

Note that wxLongLong itself must still be kept for compatibility as it
has member functions, such as GetValue() or ToString(), that can be used
in the existing code.
This commit is contained in:
Vadim Zeitlin
2024-10-18 19:26:15 +02:00
parent a83d1b9843
commit 7aa6da06d0
69 changed files with 303 additions and 2901 deletions
-1
View File
@@ -183,7 +183,6 @@ wx_option(wxUSE_FSVOLUME "use wxFSVolume class")
wx_option(wxUSE_FSWATCHER "use wxFileSystemWatcher class")
wx_option(wxUSE_GEOMETRY "use geometry class")
wx_option(wxUSE_LOG "use logging system")
wx_option(wxUSE_LONGLONG "use wxLongLong class")
wx_option(wxUSE_MIMETYPE "use wxMimeTypesManager")
wx_option(wxUSE_PRINTF_POS_PARAMS "use wxVsnprintf() which supports positional parameters")
wx_option(wxUSE_SECRETSTORE "use wxSecretStore class")
-2
View File
@@ -162,8 +162,6 @@
#cmakedefine01 wxUSE_STD_STRING_CONV_IN_WXSTRING
#cmakedefine01 wxUSE_LONGLONG
#cmakedefine01 wxUSE_BASE64
#cmakedefine01 wxUSE_CONSOLE_EVENTLOOP
Vendored
-36
View File
@@ -1190,7 +1190,6 @@ enable_fsvolume
enable_fswatcher
enable_geometry
enable_log
enable_longlong
enable_mimetype
enable_printfposparam
enable_secretstore
@@ -2161,7 +2160,6 @@ Optional Features:
--enable-fswatcher use wxFileSystemWatcher class
--enable-geometry use geometry class
--enable-log use logging system
--enable-longlong use wxLongLong class
--enable-mimetype use wxMimeTypesManager
--enable-printfposparam use wxVsnprintf() which supports positional parameters
--enable-secretstore use wxSecretStore class
@@ -7428,35 +7426,6 @@ fi
eval "$wx_cv_use_log"
enablestring=
defaultval=$wxUSE_ALL_FEATURES
if test -z "$defaultval"; then
if test x"$enablestring" = xdisable; then
defaultval=yes
else
defaultval=no
fi
fi
# Check whether --enable-longlong was given.
if test "${enable_longlong+set}" = set; then :
enableval=$enable_longlong;
if test "$enableval" = yes; then
wx_cv_use_longlong='wxUSE_LONGLONG=yes'
else
wx_cv_use_longlong='wxUSE_LONGLONG=no'
fi
else
wx_cv_use_longlong='wxUSE_LONGLONG=${'DEFAULT_wxUSE_LONGLONG":-$defaultval}"
fi
eval "$wx_cv_use_longlong"
enablestring=
defaultval=$wxUSE_ALL_FEATURES
if test -z "$defaultval"; then
@@ -37297,11 +37266,6 @@ if test "$wxUSE_LOG" = "yes"; then
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS keyboard"
fi
if test "$wxUSE_LONGLONG" = "yes"; then
$as_echo "#define wxUSE_LONGLONG 1" >>confdefs.h
fi
if test "$wxUSE_GEOMETRY" = "yes"; then
$as_echo "#define wxUSE_GEOMETRY 1" >>confdefs.h
-5
View File
@@ -722,7 +722,6 @@ WX_ARG_FEATURE(fsvolume, [ --enable-fsvolume use wxFSVolume class],
WX_ARG_FEATURE(fswatcher, [ --enable-fswatcher use wxFileSystemWatcher class], wxUSE_FSWATCHER)
WX_ARG_FEATURE(geometry, [ --enable-geometry use geometry class], wxUSE_GEOMETRY)
WX_ARG_FEATURE(log, [ --enable-log use logging system], wxUSE_LOG)
WX_ARG_FEATURE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG)
WX_ARG_FEATURE(mimetype, [ --enable-mimetype use wxMimeTypesManager], wxUSE_MIMETYPE)
WX_ARG_FEATURE(printfposparam,[ --enable-printfposparam use wxVsnprintf() which supports positional parameters], wxUSE_PRINTF_POS_PARAMS)
WX_ARG_FEATURE(secretstore, [ --enable-secretstore use wxSecretStore class], wxUSE_SECRETSTORE)
@@ -5473,10 +5472,6 @@ if test "$wxUSE_LOG" = "yes"; then
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS keyboard"
fi
if test "$wxUSE_LONGLONG" = "yes"; then
AC_DEFINE(wxUSE_LONGLONG)
fi
if test "$wxUSE_GEOMETRY" = "yes"; then
AC_DEFINE(wxUSE_GEOMETRY)
fi
+3 -7
View File
@@ -194,13 +194,9 @@ Currently the following symbols exist:
@itemdef{wxHAS_LARGE_FFILES, Defined if wxFFile supports files more than 4GB in
size (notice that you must include @c wx/filefn.h before testing for this
symbol).}
@itemdef{wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG, Defined if compiler supports a
64 bit integer type (available as @c wxLongLong_t) and this type is
different from long. Notice that, provided wxUSE_LONGLONG is not turned
off, some 64 bit type is always available to wxWidgets programs and this
symbol only indicates a presence of such primitive type. It is useful to
decide whether some function should be overloaded for both
<code>long</code> and <code>long long</code> types.}
@itemdef{wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG, Defined if the <code>long
long</code> and <code>long</code> types are different. This can be useful
to decide whether some function should be overloaded for both types or not.}
@itemdef{wxHAS_MULTIPLE_FILEDLG_FILTERS, Defined if wxFileDialog supports multiple ('|'-separated) filters.}
@itemdef{wxHAS_NATIVE_ANIMATIONCTRL, Defined if native wxAnimationCtrl class is being used (this symbol only exists in wxWidgets 3.1.4 and later).}
@itemdef{wxHAS_NATIVE_DATAVIEWCTRL, Defined if native wxDataViewCtrl class is being used (this symbol only exists in wxWidgets 3.1.4 and later).}
-3
View File
@@ -154,9 +154,6 @@ library:
@itemdef{wxUSE_LOG_DIALOG, Use wxLogDialog class.}
@itemdef{wxUSE_LOGGUI, Use wxLogGui class.}
@itemdef{wxUSE_LOGWINDOW, Use wxLogFrame class.}
@itemdef{wxUSE_LONGLONG, Use wxLongLong class.}
@itemdef{wxUSE_LONGLONG_NATIVE, Use native <tt>long long</tt> type in wxLongLong implementation.}
@itemdef{wxUSE_LONGLONG_WX, Use generic wxLongLong implementation.}
@itemdef{wxUSE_MARKUP, Provide wxControl::SetLabelMarkup() method.}
@itemdef{wxUSE_MDI, Use wxMDIParentFrame, and wxMDIChildFrame}
@itemdef{wxUSE_MDI_ARCHITECTURE, Use MDI-based document-view classes.}
-15
View File
@@ -322,19 +322,6 @@
// non GUI features selection
// ----------------------------------------------------------------------------
// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
// integer which is implemented in terms of native 64 bit integers if any or
// uses emulation otherwise.
//
// This class is required by wxDateTime and so you should enable it if you want
// to use wxDateTime. For most modern platforms, it will use the native 64 bit
// integers in which case (almost) all of its functions are inline and it
// almost does not take any space, so there should be no reason to switch it
// off.
//
// Recommended setting: 1
#define wxUSE_LONGLONG 1
// Set wxUSE_BASE64 to 1, to compile in Base64 support. This is required for
// storing binary data in wxConfig on most platforms.
//
@@ -421,8 +408,6 @@
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
// allow to manipulate dates, times and time intervals.
//
// Requires: wxUSE_LONGLONG
//
// Default is 1
//
// Recommended setting: 1
+2 -16
View File
@@ -30,9 +30,7 @@ union wxAnyValueBuffer
{
union Alignment
{
#if wxHAS_INT64
wxInt64 m_int64;
#endif
long double m_longDouble;
void ( *m_funcPtr )(void);
void ( wxAnyValueBuffer::*m_mFuncPtr )(void);
@@ -410,14 +408,8 @@ _WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE)\
// Integer value types
//
#ifdef wxLongLong_t
typedef wxLongLong_t wxAnyBaseIntType;
typedef wxULongLong_t wxAnyBaseUintType;
#else
typedef long wxAnyBaseIntType;
typedef unsigned long wxAnyBaseUintType;
#endif
typedef wxLongLong_t wxAnyBaseIntType;
typedef wxULongLong_t wxAnyBaseUintType;
class WXDLLIMPEXP_BASE wxAnyValueTypeImplInt :
public wxAnyValueTypeImplBase<wxAnyBaseIntType>
@@ -453,17 +445,13 @@ WX_ANY_DEFINE_SUB_TYPE(signed long, Int)
WX_ANY_DEFINE_SUB_TYPE(signed int, Int)
WX_ANY_DEFINE_SUB_TYPE(signed short, Int)
WX_ANY_DEFINE_SUB_TYPE(signed char, Int)
#ifdef wxLongLong_t
WX_ANY_DEFINE_SUB_TYPE(wxLongLong_t, Int)
#endif
WX_ANY_DEFINE_SUB_TYPE(unsigned long, Uint)
WX_ANY_DEFINE_SUB_TYPE(unsigned int, Uint)
WX_ANY_DEFINE_SUB_TYPE(unsigned short, Uint)
WX_ANY_DEFINE_SUB_TYPE(unsigned char, Uint)
#ifdef wxLongLong_t
WX_ANY_DEFINE_SUB_TYPE(wxULongLong_t, Uint)
#endif
//
@@ -916,9 +904,7 @@ public:
WXANY_IMPLEMENT_INT_EQ_OP(signed short, unsigned short)
WXANY_IMPLEMENT_INT_EQ_OP(signed int, unsigned int)
WXANY_IMPLEMENT_INT_EQ_OP(signed long, unsigned long)
#ifdef wxLongLong_t
WXANY_IMPLEMENT_INT_EQ_OP(wxLongLong_t, wxULongLong_t)
#endif
wxGCC_WARNING_SUPPRESS(float-equal)
-38
View File
@@ -184,14 +184,6 @@
# endif
#endif /* !defined(wxUSE_LOG) */
#ifndef wxUSE_LONGLONG
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_LONGLONG must be defined, please read comment near the top of this file."
# else
# define wxUSE_LONGLONG 0
# endif
#endif /* !defined(wxUSE_LONGLONG) */
#ifndef wxUSE_MIMETYPE
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_MIMETYPE must be defined, please read comment near the top of this file."
@@ -1431,17 +1423,6 @@
# endif
#endif /* wxUSE_FS_INET */
#if wxUSE_STOPWATCH || wxUSE_DATETIME
# if !wxUSE_LONGLONG
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_STOPWATCH and wxUSE_DATETIME require wxUSE_LONGLONG"
# else
# undef wxUSE_LONGLONG
# define wxUSE_LONGLONG 1
# endif
# endif
#endif /* wxUSE_STOPWATCH */
#if wxUSE_MIMETYPE && !wxUSE_TEXTFILE
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_MIMETYPE requires wxUSE_TEXTFILE"
@@ -2333,17 +2314,6 @@
# endif
#endif /* wxUSE_PRIVATE_FONTS */
#if wxUSE_MEDIACTRL
# if !wxUSE_LONGLONG
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxMediaCtrl requires wxUSE_LONGLONG"
# else
# undef wxUSE_LONGLONG
# define wxUSE_LONGLONG 1
# endif
# endif
#endif /* wxUSE_MEDIACTRL */
#if wxUSE_STC
# if !wxUSE_STOPWATCH
# ifdef wxABORT_ON_CONFIG_ERROR
@@ -2373,14 +2343,6 @@
# define wxUSE_RICHTEXT 0
# endif
# endif
# if !wxUSE_LONGLONG
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxRichTextCtrl requires wxUSE_LONGLONG"
# else
# undef wxUSE_LONGLONG
# define wxUSE_LONGLONG 1
# endif
# endif
# if !wxUSE_VARIANT
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxRichTextCtrl requires wxUSE_VARIANT"
-28
View File
@@ -74,12 +74,8 @@ public:
bool IsOk() { return m_input->IsOk(); }
#if wxHAS_INT64
wxUint64 Read64();
#endif
#if wxUSE_LONGLONG
wxLongLong ReadLL();
#endif
wxUint32 Read32();
wxUint16 Read16();
wxUint8 Read8();
@@ -87,18 +83,12 @@ public:
float ReadFloat();
wxString ReadString();
#if wxHAS_INT64
void Read64(wxUint64 *buffer, size_t size);
void Read64(wxInt64 *buffer, size_t size);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
void Read64(wxULongLong *buffer, size_t size);
void Read64(wxLongLong *buffer, size_t size);
#endif
#if wxUSE_LONGLONG
void ReadLL(wxULongLong *buffer, size_t size);
void ReadLL(wxLongLong *buffer, size_t size);
#endif
void Read32(wxUint32 *buffer, size_t size);
void Read16(wxUint16 *buffer, size_t size);
void Read8(wxUint8 *buffer, size_t size);
@@ -112,14 +102,10 @@ public:
wxDataInputStream& operator>>(wxUint8& c);
wxDataInputStream& operator>>(wxUint16& i);
wxDataInputStream& operator>>(wxUint32& i);
#if wxHAS_INT64
wxDataInputStream& operator>>(wxUint64& i);
wxDataInputStream& operator>>(wxInt64& i);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxDataInputStream& operator>>(wxULongLong& i);
wxDataInputStream& operator>>(wxLongLong& i);
#endif
wxDataInputStream& operator>>(double& d);
wxDataInputStream& operator>>(float& f);
@@ -136,14 +122,10 @@ public:
bool IsOk() { return m_output->IsOk(); }
#if wxHAS_INT64
void Write64(wxUint64 i);
void Write64(wxInt64 i);
#endif
#if wxUSE_LONGLONG
void WriteLL(const wxLongLong &ll);
void WriteLL(const wxULongLong &ll);
#endif
void Write32(wxUint32 i);
void Write16(wxUint16 i);
void Write8(wxUint8 i);
@@ -151,18 +133,12 @@ public:
void WriteFloat(float f);
void WriteString(const wxString& string);
#if wxHAS_INT64
void Write64(const wxUint64 *buffer, size_t size);
void Write64(const wxInt64 *buffer, size_t size);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
void Write64(const wxULongLong *buffer, size_t size);
void Write64(const wxLongLong *buffer, size_t size);
#endif
#if wxUSE_LONGLONG
void WriteLL(const wxULongLong *buffer, size_t size);
void WriteLL(const wxLongLong *buffer, size_t size);
#endif
void Write32(const wxUint32 *buffer, size_t size);
void Write16(const wxUint16 *buffer, size_t size);
void Write8(const wxUint8 *buffer, size_t size);
@@ -176,14 +152,10 @@ public:
wxDataOutputStream& operator<<(wxUint8 c);
wxDataOutputStream& operator<<(wxUint16 i);
wxDataOutputStream& operator<<(wxUint32 i);
#if wxHAS_INT64
wxDataOutputStream& operator<<(wxUint64 i);
wxDataOutputStream& operator<<(wxInt64 i);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxDataOutputStream& operator<<(const wxULongLong &i);
wxDataOutputStream& operator<<(const wxLongLong &i);
#endif
wxDataOutputStream& operator<<(double d);
wxDataOutputStream& operator<<(float f);
+37 -64
View File
@@ -1128,51 +1128,27 @@ typedef double wxDouble;
(((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24)))
/* machine specific byte swapping */
#ifdef wxLongLong_t
#define wxUINT64_SWAP_ALWAYS(val) \
((wxUint64) ( \
(((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) << 8) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >> 8) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \
(((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56)))
#define wxUINT64_SWAP_ALWAYS(val) \
((wxUint64) ( \
(((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) << 8) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >> 8) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \
(((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56)))
#define wxINT64_SWAP_ALWAYS(val) \
((wxInt64) ( \
(((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) << 8) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >> 8) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \
(((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56)))
#elif wxUSE_LONGLONG /* !wxLongLong_t */
#define wxUINT64_SWAP_ALWAYS(val) \
((wxUint64) ( \
((wxULongLong(val) & wxULongLong(0L, 0x000000ffU)) << 56) | \
((wxULongLong(val) & wxULongLong(0L, 0x0000ff00U)) << 40) | \
((wxULongLong(val) & wxULongLong(0L, 0x00ff0000U)) << 24) | \
((wxULongLong(val) & wxULongLong(0L, 0xff000000U)) << 8) | \
((wxULongLong(val) & wxULongLong(0x000000ffL, 0U)) >> 8) | \
((wxULongLong(val) & wxULongLong(0x0000ff00L, 0U)) >> 24) | \
((wxULongLong(val) & wxULongLong(0x00ff0000L, 0U)) >> 40) | \
((wxULongLong(val) & wxULongLong(0xff000000L, 0U)) >> 56)))
#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)))
#endif /* wxLongLong_t/!wxLongLong_t */
#define wxINT64_SWAP_ALWAYS(val) \
((wxInt64) ( \
(((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) << 8) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >> 8) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \
(((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \
(((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56)))
#ifdef WORDS_BIGENDIAN
#define wxUINT16_SWAP_ON_BE(val) wxUINT16_SWAP_ALWAYS(val)
@@ -1183,17 +1159,16 @@ typedef double wxDouble;
#define wxINT32_SWAP_ON_BE(val) wxINT32_SWAP_ALWAYS(val)
#define wxUINT32_SWAP_ON_LE(val) (val)
#define wxINT32_SWAP_ON_LE(val) (val)
#if wxHAS_INT64
#define wxUINT64_SWAP_ON_BE(val) wxUINT64_SWAP_ALWAYS(val)
#define wxUINT64_SWAP_ON_LE(val) (val)
#define wxINT64_SWAP_ON_BE(val) wxINT64_SWAP_ALWAYS(val)
#define wxINT64_SWAP_ON_LE(val) (val)
#define wxUINT64_SWAP_ON_BE_IN_PLACE(val) val = wxUINT64_SWAP_ALWAYS(val)
#define wxINT64_SWAP_ON_BE_IN_PLACE(val) val = wxINT64_SWAP_ALWAYS(val)
#define wxUINT64_SWAP_ON_LE_IN_PLACE(val)
#define wxINT64_SWAP_ON_LE_IN_PLACE(val)
#endif
#define wxUINT64_SWAP_ON_BE(val) wxUINT64_SWAP_ALWAYS(val)
#define wxUINT64_SWAP_ON_LE(val) (val)
#define wxINT64_SWAP_ON_BE(val) wxINT64_SWAP_ALWAYS(val)
#define wxINT64_SWAP_ON_LE(val) (val)
#define wxUINT64_SWAP_ON_BE_IN_PLACE(val) val = wxUINT64_SWAP_ALWAYS(val)
#define wxINT64_SWAP_ON_BE_IN_PLACE(val) val = wxINT64_SWAP_ALWAYS(val)
#define wxUINT64_SWAP_ON_LE_IN_PLACE(val)
#define wxINT64_SWAP_ON_LE_IN_PLACE(val)
#define wxUINT16_SWAP_ON_BE_IN_PLACE(val) val = wxUINT16_SWAP_ALWAYS(val)
#define wxINT16_SWAP_ON_BE_IN_PLACE(val) val = wxINT16_SWAP_ALWAYS(val)
@@ -1212,16 +1187,14 @@ typedef double wxDouble;
#define wxINT32_SWAP_ON_LE(val) wxINT32_SWAP_ALWAYS(val)
#define wxUINT32_SWAP_ON_BE(val) (val)
#define wxINT32_SWAP_ON_BE(val) (val)
#if wxHAS_INT64
#define wxUINT64_SWAP_ON_LE(val) wxUINT64_SWAP_ALWAYS(val)
#define wxUINT64_SWAP_ON_BE(val) (val)
#define wxINT64_SWAP_ON_LE(val) wxINT64_SWAP_ALWAYS(val)
#define wxINT64_SWAP_ON_BE(val) (val)
#define wxUINT64_SWAP_ON_BE_IN_PLACE(val)
#define wxINT64_SWAP_ON_BE_IN_PLACE(val)
#define wxUINT64_SWAP_ON_LE_IN_PLACE(val) val = wxUINT64_SWAP_ALWAYS(val)
#define wxINT64_SWAP_ON_LE_IN_PLACE(val) val = wxINT64_SWAP_ALWAYS(val)
#endif
#define wxUINT64_SWAP_ON_LE(val) wxUINT64_SWAP_ALWAYS(val)
#define wxUINT64_SWAP_ON_BE(val) (val)
#define wxINT64_SWAP_ON_LE(val) wxINT64_SWAP_ALWAYS(val)
#define wxINT64_SWAP_ON_BE(val) (val)
#define wxUINT64_SWAP_ON_BE_IN_PLACE(val)
#define wxINT64_SWAP_ON_BE_IN_PLACE(val)
#define wxUINT64_SWAP_ON_LE_IN_PLACE(val) val = wxUINT64_SWAP_ALWAYS(val)
#define wxINT64_SWAP_ON_LE_IN_PLACE(val) val = wxINT64_SWAP_ALWAYS(val)
#define wxUINT16_SWAP_ON_BE_IN_PLACE(val)
#define wxINT16_SWAP_ON_BE_IN_PLACE(val)
-4
View File
@@ -44,10 +44,8 @@ enum wxDirTraverseResult
wxDIR_CONTINUE // continue into this directory
};
#if wxUSE_LONGLONG
// error code of wxDir::GetTotalSize()
extern WXDLLIMPEXP_DATA_BASE(const wxULongLong) wxInvalidSize;
#endif // wxUSE_LONGLONG
// ----------------------------------------------------------------------------
// wxDirTraverser: helper class for wxDir::Traverse()
@@ -159,10 +157,8 @@ public:
const wxString& filespec,
int flags = wxDIR_DEFAULT);
#if wxUSE_LONGLONG
// returns the size of all directories recursively found in given path
static wxULongLong GetTotalSize(const wxString &dir, wxArrayString *filesSkipped = nullptr);
#endif // wxUSE_LONGLONG
// static utilities for directory management
-2
View File
@@ -3012,9 +3012,7 @@ protected:
bool m_isCheckable;
bool m_is3State;
wxString m_text;
#if wxUSE_LONGLONG
static wxLongLong sm_lastUpdate;
#endif
static long sm_updateInterval;
static wxUpdateUIMode sm_updateMode;
-4
View File
@@ -121,10 +121,8 @@ enum
wxFILE_EXISTS_ANY = 0x1FFF // check for existence of anything
};
#if wxUSE_LONGLONG
// error code of wxFileName::GetSize()
extern WXDLLIMPEXP_DATA_BASE(const wxULongLong) wxInvalidSize;
#endif // wxUSE_LONGLONG
@@ -595,7 +593,6 @@ public:
// File size
#if wxUSE_LONGLONG
// returns the size of the given filename
wxULongLong GetSize() const;
static wxULongLong GetSize(const wxString &file);
@@ -610,7 +607,6 @@ public:
const wxString& nullsize = wxGetTranslation(wxASCII_STR("Not available")),
int precision = 1,
wxSizeConvention conv = wxSIZE_CONV_TRADITIONAL);
#endif // wxUSE_LONGLONG
// deprecated methods, don't use any more
-15
View File
@@ -322,19 +322,6 @@
// non GUI features selection
// ----------------------------------------------------------------------------
// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
// integer which is implemented in terms of native 64 bit integers if any or
// uses emulation otherwise.
//
// This class is required by wxDateTime and so you should enable it if you want
// to use wxDateTime. For most modern platforms, it will use the native 64 bit
// integers in which case (almost) all of its functions are inline and it
// almost does not take any space, so there should be no reason to switch it
// off.
//
// Recommended setting: 1
#define wxUSE_LONGLONG 1
// Set wxUSE_BASE64 to 1, to compile in Base64 support. This is required for
// storing binary data in wxConfig on most platforms.
//
@@ -421,8 +408,6 @@
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
// allow to manipulate dates, times and time intervals.
//
// Requires: wxUSE_LONGLONG
//
// Default is 1
//
// Recommended setting: 1
+183 -794
View File
File diff suppressed because it is too large Load Diff
-2
View File
@@ -51,10 +51,8 @@ WX_TYPE_HIERARCHY_LEVEL( 5, int);
WX_TYPE_HIERARCHY_LEVEL( 6, unsigned int);
WX_TYPE_HIERARCHY_LEVEL( 7, long);
WX_TYPE_HIERARCHY_LEVEL( 8, unsigned long);
#ifdef wxLongLong_t
WX_TYPE_HIERARCHY_LEVEL( 9, wxLongLong_t);
WX_TYPE_HIERARCHY_LEVEL(10, wxULongLong_t);
#endif
WX_TYPE_HIERARCHY_LEVEL(11, float);
WX_TYPE_HIERARCHY_LEVEL(12, double);
WX_TYPE_HIERARCHY_LEVEL(13, long double);
-2
View File
@@ -48,10 +48,8 @@ WX_DECLARE_TYPE_POD(long double)
#if wxWCHAR_T_IS_REAL_TYPE
WX_DECLARE_TYPE_POD(wchar_t)
#endif
#ifdef wxLongLong_t
WX_DECLARE_TYPE_POD(wxLongLong_t)
WX_DECLARE_TYPE_POD(wxULongLong_t)
#endif
// pointers are Plain Old Data:
template<typename T>
-15
View File
@@ -322,19 +322,6 @@
// non GUI features selection
// ----------------------------------------------------------------------------
// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
// integer which is implemented in terms of native 64 bit integers if any or
// uses emulation otherwise.
//
// This class is required by wxDateTime and so you should enable it if you want
// to use wxDateTime. For most modern platforms, it will use the native 64 bit
// integers in which case (almost) all of its functions are inline and it
// almost does not take any space, so there should be no reason to switch it
// off.
//
// Recommended setting: 1
#define wxUSE_LONGLONG 1
// Set wxUSE_BASE64 to 1, to compile in Base64 support. This is required for
// storing binary data in wxConfig on most platforms.
//
@@ -421,8 +408,6 @@
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
// allow to manipulate dates, times and time intervals.
//
// Requires: wxUSE_LONGLONG
//
// Default is 1
//
// Recommended setting: 1
-15
View File
@@ -329,19 +329,6 @@
// non GUI features selection
// ----------------------------------------------------------------------------
// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
// integer which is implemented in terms of native 64 bit integers if any or
// uses emulation otherwise.
//
// This class is required by wxDateTime and so you should enable it if you want
// to use wxDateTime. For most modern platforms, it will use the native 64 bit
// integers in which case (almost) all of its functions are inline and it
// almost does not take any space, so there should be no reason to switch it
// off.
//
// Recommended setting: 1
#define wxUSE_LONGLONG 1
// Set wxUSE_BASE64 to 1, to compile in Base64 support. This is required for
// storing binary data in wxConfig on most platforms.
//
@@ -428,8 +415,6 @@
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
// allow to manipulate dates, times and time intervals.
//
// Requires: wxUSE_LONGLONG
//
// Default is 1
//
// Recommended setting: 1
-14
View File
@@ -56,9 +56,7 @@ enum wxPrintfArgType
wxPAT_INT, // %d, %i, %o, %u, %x, %X
wxPAT_LONGINT, // %ld, etc
#ifdef wxLongLong_t
wxPAT_LONGLONGINT, // %Ld, etc
#endif
wxPAT_SIZET, // %zd, etc
wxPAT_DOUBLE, // %e, %E, %f, %g, %G
@@ -84,9 +82,7 @@ union wxPrintfArg
{
int pad_int; // %d, %i, %o, %u, %x, %X
long int pad_longint; // %ld, etc
#ifdef wxLongLong_t
wxLongLong_t pad_longlongint; // %Ld, etc
#endif
size_t pad_sizet; // %zd, etc
double pad_double; // %e, %E, %f, %g, %G
@@ -397,11 +393,7 @@ bool wxPrintfConvSpec<CharType>::Parse(const CharType *format)
else if (ilen == 1)
m_type = wxPAT_LONGINT;
else if (ilen == 2)
#ifdef wxLongLong_t
m_type = wxPAT_LONGLONGINT;
#else // !wxLongLong_t
m_type = wxPAT_LONGINT;
#endif // wxLongLong_t/!wxLongLong_t
else if (ilen == 3)
m_type = wxPAT_SIZET;
done = true;
@@ -544,11 +536,9 @@ bool wxPrintfConvSpec<CharType>::LoadArg(wxPrintfArg *p, va_list &argptr)
case wxPAT_LONGINT:
p->pad_longint = va_arg(argptr, long int);
break;
#ifdef wxLongLong_t
case wxPAT_LONGLONGINT:
p->pad_longlongint = va_arg(argptr, wxLongLong_t);
break;
#endif // wxLongLong_t
case wxPAT_SIZET:
p->pad_sizet = va_arg(argptr, size_t);
break;
@@ -623,11 +613,9 @@ int wxPrintfConvSpec<CharType>::Process(CharType *buf, size_t lenMax, wxPrintfAr
lenScratch = system_sprintf(szScratch, wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN, m_szFlags, p->pad_longint);
break;
#ifdef wxLongLong_t
case wxPAT_LONGLONGINT:
lenScratch = system_sprintf(szScratch, wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN, m_szFlags, p->pad_longlongint);
break;
#endif // SIZEOF_LONG_LONG
case wxPAT_SIZET:
lenScratch = system_sprintf(szScratch, wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN, m_szFlags, p->pad_sizet);
@@ -734,9 +722,7 @@ int wxPrintfConvSpec<CharType>::Process(CharType *buf, size_t lenMax, wxPrintfAr
{
case wxPAT_INT:
case wxPAT_LONGINT:
#ifdef wxLongLong_t
case wxPAT_LONGLONGINT:
#endif
case wxPAT_SIZET:
case wxPAT_LONGDOUBLE:
case wxPAT_DOUBLE:
-4
View File
@@ -426,12 +426,10 @@ template<> inline wxVariant WXVARIANT( const wxArrayString& value )
{ return wxVariant(value); }
template<> inline wxVariant WXVARIANT( const wxString& value )
{ return wxVariant(value); }
#if wxUSE_LONGLONG
template<> inline wxVariant WXVARIANT( const wxLongLong& value )
{ return wxVariant(value); }
template<> inline wxVariant WXVARIANT( const wxULongLong& value )
{ return wxVariant(value); }
#endif
#if wxUSE_DATETIME
template<> inline wxVariant WXVARIANT( const wxDateTime& value )
{ return wxVariant(value); }
@@ -600,10 +598,8 @@ template<> inline wxVariant WXVARIANT( const wxColour& value )
#if wxUSE_DATETIME
#define wxPG_VARIANT_TYPE_DATETIME wxS("datetime")
#endif
#if wxUSE_LONGLONG
#define wxPG_VARIANT_TYPE_LONGLONG wxS("longlong")
#define wxPG_VARIANT_TYPE_ULONGLONG wxS("ulonglong")
#endif
#endif // !SWIG
// -----------------------------------------------------------------------
-8
View File
@@ -535,11 +535,9 @@ public:
wxArrayString GetPropertyValueAsArrayString(wxPGPropArg id) const;
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxLongLong_t GetPropertyValueAsLongLong(wxPGPropArg id) const;
wxULongLong_t GetPropertyValueAsULongLong(wxPGPropArg id) const;
#endif
wxArrayInt GetPropertyValueAsArrayInt(wxPGPropArg id) const;
@@ -1084,36 +1082,30 @@ public:
SetPropVal( id, v );
}
#if wxUSE_LONGLONG
#ifdef wxLongLong_t
// Sets value (native 64-bit int) of a property.
void SetPropertyValue(wxPGPropArg id, wxLongLong_t value)
{
wxVariant v = wxLongLong(value);
SetPropVal(id, v);
}
#endif
// Sets value (wxLongLong) of a property.
void SetPropertyValue( wxPGPropArg id, wxLongLong value )
{
wxVariant v(value);
SetPropVal( id, v );
}
#ifdef wxULongLong_t
// Sets value (native 64-bit unsigned int) of a property.
void SetPropertyValue(wxPGPropArg id, wxULongLong_t value)
{
wxVariant v = wxULongLong(value);
SetPropVal(id, v);
}
#endif
// Sets value (wxULongLong) of a property.
void SetPropertyValue( wxPGPropArg id, wxULongLong value )
{
wxVariant v(value);
SetPropVal( id, v );
}
#endif
// Sets value (wxArrayInt&) of a property.
void SetPropertyValue( wxPGPropArg id, const wxArrayInt& value )
-8
View File
@@ -232,11 +232,9 @@ public:
long value = 0 );
virtual ~wxIntProperty() = default;
#if wxUSE_LONGLONG
wxIntProperty( const wxString& label,
const wxString& name,
const wxLongLong& value );
#endif
#if WXWIN_COMPATIBILITY_3_2
wxDEPRECATED_MSG("use ValueToString with 'flags' argument as wxPGPropValFormatFlags")
virtual wxString ValueToString(wxVariant& value, int flags) const override
@@ -276,12 +274,10 @@ public:
private:
// Validation helpers.
#if wxUSE_LONGLONG
static bool DoValidation( const wxNumericProperty* property,
wxLongLong& value,
wxPGValidationInfo* pValidationInfo,
wxPGNumericValidationMode = wxPGNumericValidationMode::ErrorMessage);
#endif // wxUSE_LONGLONG
static bool DoValidation(const wxNumericProperty* property,
long& value,
wxPGValidationInfo* pValidationInfo,
@@ -300,11 +296,9 @@ public:
const wxString& name = wxPG_LABEL,
unsigned long value = 0 );
virtual ~wxUIntProperty() = default;
#if wxUSE_LONGLONG
wxUIntProperty( const wxString& label,
const wxString& name,
const wxULongLong& value );
#endif
#if WXWIN_COMPATIBILITY_3_2
wxDEPRECATED_MSG("use ValueToString with 'flags' argument as wxPGPropValFormatFlags")
virtual wxString ValueToString(wxVariant& value, int flags) const override
@@ -351,12 +345,10 @@ private:
void Init();
// Validation helpers.
#if wxUSE_LONGLONG
static bool DoValidation(const wxNumericProperty* property,
wxULongLong& value,
wxPGValidationInfo* pValidationInfo,
wxPGNumericValidationMode = wxPGNumericValidationMode::ErrorMessage);
#endif // wxUSE_LONGLONG
static bool DoValidation(const wxNumericProperty* property,
long& value,
wxPGValidationInfo* pValidationInfo,
-15
View File
@@ -318,19 +318,6 @@
// non GUI features selection
// ----------------------------------------------------------------------------
// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
// integer which is implemented in terms of native 64 bit integers if any or
// uses emulation otherwise.
//
// This class is required by wxDateTime and so you should enable it if you want
// to use wxDateTime. For most modern platforms, it will use the native 64 bit
// integers in which case (almost) all of its functions are inline and it
// almost does not take any space, so there should be no reason to switch it
// off.
//
// Recommended setting: 1
#define wxUSE_LONGLONG 1
// Set wxUSE_BASE64 to 1, to compile in Base64 support. This is required for
// storing binary data in wxConfig on most platforms.
//
@@ -417,8 +404,6 @@
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
// allow to manipulate dates, times and time intervals.
//
// Requires: wxUSE_LONGLONG
//
// Default is 1
//
// Recommended setting: 1
-2
View File
@@ -2391,11 +2391,9 @@ public:
// convert to an unsigned long
bool ToULong(unsigned long *val, int base = 10) const;
// convert to wxLongLong
#if defined(wxLongLong_t)
bool ToLongLong(wxLongLong_t *val, int base = 10) const;
// convert to wxULongLong
bool ToULongLong(wxULongLong_t *val, int base = 10) const;
#endif // wxLongLong_t
// convert to a double
bool ToDouble(double *val) const;
+1 -3
View File
@@ -183,7 +183,7 @@ public:
#endif
#if defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG == SIZEOF_LONG
Arg_LongLongInt = Arg_LongInt,
#elif defined(wxLongLong_t)
#else
Arg_LongLongInt = 0x0020,
#endif
@@ -416,10 +416,8 @@ wxFORMAT_STRING_SPECIFIER(short int, wxFormatString::Arg_Int)
wxFORMAT_STRING_SPECIFIER(short unsigned int, wxFormatString::Arg_Int)
wxFORMAT_STRING_SPECIFIER(long int, wxFormatString::Arg_LongInt)
wxFORMAT_STRING_SPECIFIER(long unsigned int, wxFormatString::Arg_LongInt)
#ifdef wxLongLong_t
wxFORMAT_STRING_SPECIFIER(wxLongLong_t, wxFormatString::Arg_LongLongInt)
wxFORMAT_STRING_SPECIFIER(wxULongLong_t, wxFormatString::Arg_LongLongInt)
#endif
wxFORMAT_STRING_SPECIFIER(float, wxFormatString::Arg_Double)
wxFORMAT_STRING_SPECIFIER(double, wxFormatString::Arg_Double)
wxFORMAT_STRING_SPECIFIER(long double, wxFormatString::Arg_LongDouble)
+2 -11
View File
@@ -21,25 +21,16 @@ extern long WXDLLIMPEXP_BASE wxGetLocalTime();
// Get number of seconds since GMT 00:00:00, Jan 1st 1970.
extern long WXDLLIMPEXP_BASE wxGetUTCTime();
#if wxUSE_LONGLONG
typedef wxLongLong wxMilliClock_t;
inline long wxMilliClockToLong(wxLongLong ll) { return ll.ToLong(); }
#else
typedef double wxMilliClock_t;
inline long wxMilliClockToLong(double d) { return wx_truncate_cast(long, d); }
#endif // wxUSE_LONGLONG
typedef wxLongLong wxMilliClock_t;
inline long wxMilliClockToLong(wxLongLong ll) { return ll.ToLong(); }
// Get number of milliseconds since local time 00:00:00 Jan 1st 1970
extern wxMilliClock_t WXDLLIMPEXP_BASE wxGetLocalTimeMillis();
#if wxUSE_LONGLONG
// Get the number of milliseconds or microseconds since the Epoch.
wxLongLong WXDLLIMPEXP_BASE wxGetUTCTimeMillis();
wxLongLong WXDLLIMPEXP_BASE wxGetUTCTimeUSec();
#endif // wxUSE_LONGLONG
#define wxGetCurrentTime() wxGetLocalTime()
// on some really old systems gettimeofday() doesn't have the second argument,
+17 -29
View File
@@ -263,41 +263,29 @@ typedef wxUint32 wxDword;
#define wxLongLongSuffix l
#define wxLongLongFmtSpec "l"
#define wxLongLongIsLong
#else
#error "64-bit integer type must be available."
#endif
#define wxULongLong_t unsigned wxLongLong_t
#ifdef wxLongLong_t
#define wxULongLong_t unsigned wxLongLong_t
/*
wxLL() and wxULL() macros allow to define 64 bit constants in a
portable way.
*/
#define wxLL(x) wxCONCAT(x, wxLongLongSuffix)
#define wxULL(x) wxCONCAT(x, wxCONCAT(u, wxLongLongSuffix))
/*
wxLL() and wxULL() macros allow to define 64 bit constants in a
portable way.
*/
#define wxLL(x) wxCONCAT(x, wxLongLongSuffix)
#define wxULL(x) wxCONCAT(x, wxCONCAT(u, wxLongLongSuffix))
typedef wxLongLong_t wxInt64;
typedef wxULongLong_t wxUint64;
typedef wxLongLong_t wxInt64;
typedef wxULongLong_t wxUint64;
#define wxHAS_INT64 1
#ifndef wxLongLongIsLong
#define wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
#endif
#elif wxUSE_LONGLONG
/* these macros allow to define 64 bit constants in a portable way */
#define wxLL(x) wxLongLong(x)
#define wxULL(x) wxULongLong(x)
#define wxInt64 wxLongLong
#define wxUint64 wxULongLong
#define wxHAS_INT64 1
#else /* !wxUSE_LONGLONG */
#define wxHAS_INT64 0
// These symbols are only defined for compatibility, don't use them.
#define wxHAS_INT64 1
#define wxUSE_LONGLONG 1
#define wxUSE_LONGLONG_NATIVE 1
#ifndef wxLongLongIsLong
#define wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
#endif
/*
-15
View File
@@ -322,19 +322,6 @@
// non GUI features selection
// ----------------------------------------------------------------------------
// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
// integer which is implemented in terms of native 64 bit integers if any or
// uses emulation otherwise.
//
// This class is required by wxDateTime and so you should enable it if you want
// to use wxDateTime. For most modern platforms, it will use the native 64 bit
// integers in which case (almost) all of its functions are inline and it
// almost does not take any space, so there should be no reason to switch it
// off.
//
// Recommended setting: 1
#define wxUSE_LONGLONG 1
// Set wxUSE_BASE64 to 1, to compile in Base64 support. This is required for
// storing binary data in wxConfig on most platforms.
//
@@ -421,8 +408,6 @@
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
// allow to manipulate dates, times and time intervals.
//
// Requires: wxUSE_LONGLONG
//
// Default is 1
//
// Recommended setting: 1
+2 -10
View File
@@ -107,11 +107,7 @@ wxClip(T1 a, T2 b, T3 c)
// wxGetFreeMemory can return huge amount of memory on 32-bit platforms as well
// so to always use long long for its result type on all platforms which
// support it
#if wxUSE_LONGLONG
typedef wxLongLong wxMemorySize;
#else
typedef long wxMemorySize;
#endif
typedef wxLongLong wxMemorySize;
// ----------------------------------------------------------------------------
// Miscellaneous functions
@@ -563,11 +559,7 @@ WXDLLIMPEXP_BASE const wxChar* wxGetHomeDir(wxString *pstr);
WXDLLIMPEXP_BASE wxString wxGetUserHome(const wxString& user = wxEmptyString);
#if wxUSE_LONGLONG
typedef wxLongLong wxDiskspaceSize_t;
#else
typedef long wxDiskspaceSize_t;
#endif
typedef wxLongLong wxDiskspaceSize_t;
// get number of total/free bytes on the disk where path belongs
WXDLLIMPEXP_BASE bool wxGetDiskSpace(const wxString& path,
-5
View File
@@ -312,13 +312,8 @@ protected:
// Define the type we use here, it should be the maximal-sized integer type
// we support to make it possible to base wxIntegerValidator<> for any type
// on it.
#ifdef wxLongLong_t
typedef wxLongLong_t LongestValueType;
typedef wxULongLong_t ULongestValueType;
#else
typedef long LongestValueType;
typedef unsigned long ULongestValueType;
#endif
wxIntegerValidatorBase(int style)
: wxNumValidatorBase(style)
-6
View File
@@ -295,7 +295,6 @@ public:
void operator= (wxObject* value);
wxObject* GetWxObjectPtr() const;
#if wxUSE_LONGLONG
// wxLongLong
wxVariant(wxLongLong, const wxString& name = wxEmptyString);
bool operator==(wxLongLong value) const;
@@ -311,7 +310,6 @@ public:
void operator=(wxULongLong value);
operator wxULongLong() const { return GetULongLong(); }
wxULongLong GetULongLong() const;
#endif
// ------------------------------
// list operations
@@ -359,10 +357,8 @@ public:
#if wxUSE_DATETIME
bool Convert(wxDateTime* value) const;
#endif // wxUSE_DATETIME
#if wxUSE_LONGLONG
bool Convert(wxLongLong* value) const;
bool Convert(wxULongLong* value) const;
#ifdef wxLongLong_t
bool Convert(wxLongLong_t* value) const
{
wxLongLong temp;
@@ -379,8 +375,6 @@ public:
*value = temp.GetValue();
return true;
}
#endif // wxLongLong_t
#endif // wxUSE_LONGLONG
// Attributes
protected:
-2
View File
@@ -1007,10 +1007,8 @@ inline double wxStrtod(const wxCStrData& nptr, std::nullptr_t)
WX_STRTOX_FUNC(long, wxStrtol, wxCRT_StrtolA, wxCRT_StrtolW)
WX_STRTOX_FUNC(unsigned long, wxStrtoul, wxCRT_StrtoulA, wxCRT_StrtoulW)
#ifdef wxLongLong_t
WX_STRTOX_FUNC(wxLongLong_t, wxStrtoll, wxCRT_StrtollA, wxCRT_StrtollW)
WX_STRTOX_FUNC(wxULongLong_t, wxStrtoull, wxCRT_StrtoullA, wxCRT_StrtoullW)
#endif // wxLongLong_t
#undef WX_STRTOX_FUNC
+16 -18
View File
@@ -367,24 +367,22 @@ WXDLLIMPEXP_BASE wchar_t *wxCRT_StrtokW(wchar_t *psz, const wchar_t *delim, wcha
#endif
/* supply strtoll and strtoull, if needed */
#ifdef wxLongLong_t
#ifndef wxCRT_StrtollA
WXDLLIMPEXP_BASE wxLongLong_t wxCRT_StrtollA(const char* nptr,
char** endptr,
int base);
WXDLLIMPEXP_BASE wxULongLong_t wxCRT_StrtoullA(const char* nptr,
char** endptr,
int base);
#endif
#ifndef wxCRT_StrtollW
WXDLLIMPEXP_BASE wxLongLong_t wxCRT_StrtollW(const wchar_t* nptr,
wchar_t** endptr,
int base);
WXDLLIMPEXP_BASE wxULongLong_t wxCRT_StrtoullW(const wchar_t* nptr,
wchar_t** endptr,
int base);
#endif
#endif /* wxLongLong_t */
#ifndef wxCRT_StrtollA
WXDLLIMPEXP_BASE wxLongLong_t wxCRT_StrtollA(const char* nptr,
char** endptr,
int base);
WXDLLIMPEXP_BASE wxULongLong_t wxCRT_StrtoullA(const char* nptr,
char** endptr,
int base);
#endif
#ifndef wxCRT_StrtollW
WXDLLIMPEXP_BASE wxLongLong_t wxCRT_StrtollW(const wchar_t* nptr,
wchar_t** endptr,
int base);
WXDLLIMPEXP_BASE wxULongLong_t wxCRT_StrtoullW(const wchar_t* nptr,
wchar_t** endptr,
int base);
#endif
/* -------------------------------------------------------------------------
+10 -17
View File
@@ -8,15 +8,11 @@
/**
@class wxLongLong
This class represents a signed 64 bit long number. It is implemented using the
native 64 bit type where available (machines with 64 bit longs or compilers
which have (an analog of) @e long long type) and uses the emulation code in
the other cases which ensures that it is the most efficient solution for
working with 64 bit integers independently of the architecture.
This is a legacy class wrapping a 64-bit integer.
@note This class is obsolete as there are no supported implementations not
providing a native 64 bit integer type any longer and the application code
can safely use "long long" or "std::int64_t" directly instead of using this
should use "long long" or "std::int64_t" directly instead of using this
class.
wxLongLong defines all usual arithmetic operations such as addition,
@@ -191,7 +187,10 @@ public:
/**
@class wxULongLong
This class represents an unsigned 64 bit long number.
This is a legacy class wrapping an unsigned 64-bit integer.
@note Just as wxLongLong, this class is obsolete and shouldn't be used in
the new code.
See wxLongLong for more details.
@@ -337,10 +336,8 @@ public:
printed. Example of using it:
@code
#ifdef wxLongLong_t
wxLongLong_t ll = wxLL(0x1234567890abcdef);
printf("Long long = %" wxLongLongFmtSpec "x\n", ll);
#endif
wxLongLong_t ll = wxLL(0x1234567890abcdef);
printf("Long long = %" wxLongLongFmtSpec "x\n", ll);
@endcode
@see wxLL()
@@ -354,9 +351,7 @@ public:
and allow the use of 64 bit compile time constants:
@code
#ifdef wxLongLong_t
wxLongLong_t ll = wxLL(0x1234567890abcdef);
#endif
wxLongLong_t ll = wxLL(0x1234567890abcdef);
@endcode
@see wxULL(), wxLongLong
@@ -370,9 +365,7 @@ wxLongLong_t wxLL(number);
and allow the use of 64 bit compile time constants:
@code
#ifdef wxLongLong_t
unsigned wxLongLong_t ll = wxULL(0x1234567890abcdef);
#endif
unsigned wxLongLong_t ll = wxULL(0x1234567890abcdef);
@endcode
@see wxLL(), wxLongLong
+1 -1
View File
@@ -60,7 +60,7 @@
#endif // wxUSE_TIPWINDOW
#if wxUSE_PROGRESSDLG
#if wxUSE_STOPWATCH && wxUSE_LONGLONG
#if wxUSE_STOPWATCH
#include "wx/datetime.h" // wxDateTime
#endif
-5
View File
@@ -1460,11 +1460,7 @@ void FormMain::PopulateWithExamples ()
pg->Append( new wxPointProperty( "PointProperty", "Position", GetPosition() ) );
// UInt samples
#if wxUSE_LONGLONG
pg->Append( new wxUIntProperty( "UIntProperty", wxPG_LABEL, wxULongLong(wxULL(0xFEEEFEEEFEEE))));
#else
pg->Append( new wxUIntProperty( "UIntProperty", wxPG_LABEL, 0xFEEEFEEE));
#endif
pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_PREFIX, wxPG_PREFIX_NONE );
pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_BASE, wxPG_BASE_HEX );
//pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_PREFIX, wxPG_PREFIX_NONE );
@@ -1712,7 +1708,6 @@ void FormMain::PopulateWithLibraryConfig ()
ADD_WX_LIB_CONF( wxUSE_STD_IOSTREAM )
ADD_WX_LIB_CONF_GROUP("Non-GUI Features")
ADD_WX_LIB_CONF( wxUSE_LONGLONG )
ADD_WX_LIB_CONF( wxUSE_FILE )
ADD_WX_LIB_CONF( wxUSE_FFILE )
ADD_WX_LIB_CONF( wxUSE_FSVOLUME )
-2
View File
@@ -165,8 +165,6 @@
#define wxUSE_STD_STRING_CONV_IN_WXSTRING 0
#define wxUSE_LONGLONG 0
#define wxUSE_BASE64 0
#define wxUSE_CONSOLE_EVENTLOOP 0
-2
View File
@@ -197,8 +197,6 @@ typedef pid_t GPid;
#define wxUSE_STD_STRING_CONV_IN_WXSTRING 0
#define wxUSE_LONGLONG 1
#define wxUSE_BASE64 1
#define wxUSE_CONSOLE_EVENTLOOP 1
+4 -40
View File
@@ -150,7 +150,6 @@ bool wxConvertAnyToVariant(const wxAny& any, wxVariant* variant)
// and others to "longlong".
if ( wxANY_CHECK_TYPE(any, signed int) )
{
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxLongLong_t ll = 0;
if ( any.GetAs(&ll) )
{
@@ -166,13 +165,6 @@ bool wxConvertAnyToVariant(const wxAny& any, wxVariant* variant)
{
return false;
}
#else
long l;
if ( any.GetAs(&l) )
*variant = l;
else
return false;
#endif
return true;
}
@@ -240,24 +232,12 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxAnyValueTypeGlobalsManager, wxModule);
// Dynamic conversion member functions
//-------------------------------------------------------------------------
//
// Define integer minimum and maximum as helpers
#ifdef wxLongLong_t
#define UseIntMin (wxINT64_MIN)
#define UseIntMax (wxINT64_MAX)
#define UseUintMax (wxUINT64_MAX)
#else
#define UseIntMin (LONG_MIN)
#define UseIntMax (LONG_MAX)
#define UseUintMax (ULONG_MAX)
#endif
namespace
{
const double UseIntMinF = static_cast<double>(UseIntMin);
const double UseIntMaxF = static_cast<double>(UseIntMax);
const double UseUintMaxF = static_cast<double>(UseUintMax);
const double UseIntMinF = static_cast<double>(wxINT64_MIN);
const double UseIntMaxF = static_cast<double>(wxINT64_MAX);
const double UseUintMaxF = static_cast<double>(wxUINT64_MAX);
} // anonymous namespace
@@ -268,12 +248,8 @@ bool wxAnyValueTypeImplInt::ConvertValue(const wxAnyValueBuffer& src,
wxAnyBaseIntType value = GetValue(src);
if ( wxANY_VALUE_TYPE_CHECK_TYPE(dstType, wxString) )
{
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxLongLong ll(value);
wxString s = ll.ToString();
#else
wxString s = wxString::Format(wxS("%ld"), (long)value);
#endif
wxAnyValueTypeImpl<wxString>::SetValue(s, dst);
}
else if ( wxANY_VALUE_TYPE_CHECK_TYPE(dstType, wxAnyBaseUintType) )
@@ -306,17 +282,13 @@ bool wxAnyValueTypeImplUint::ConvertValue(const wxAnyValueBuffer& src,
wxAnyBaseUintType value = GetValue(src);
if ( wxANY_VALUE_TYPE_CHECK_TYPE(dstType, wxString) )
{
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxULongLong ull(value);
wxString s = ull.ToString();
#else
wxString s = wxString::Format(wxS("%lu"), (long)value);
#endif
wxAnyValueTypeImpl<wxString>::SetValue(s, dst);
}
else if ( wxANY_VALUE_TYPE_CHECK_TYPE(dstType, wxAnyBaseIntType) )
{
if ( value > UseIntMax )
if ( value > wxINT64_MAX )
return false;
wxAnyBaseIntType l = (wxAnyBaseIntType) value;
wxAnyValueTypeImplInt::SetValue(l, dst);
@@ -349,22 +321,14 @@ bool wxAnyConvertString(const wxString& value,
else if ( wxANY_VALUE_TYPE_CHECK_TYPE(dstType, wxAnyBaseIntType) )
{
wxAnyBaseIntType value2;
#ifdef wxLongLong_t
if ( !value.ToLongLong(&value2) )
#else
if ( !value.ToLong(&value2) )
#endif
return false;
wxAnyValueTypeImplInt::SetValue(value2, dst);
}
else if ( wxANY_VALUE_TYPE_CHECK_TYPE(dstType, wxAnyBaseUintType) )
{
wxAnyBaseUintType value2;
#ifdef wxLongLong_t
if ( !value.ToULongLong(&value2) )
#else
if ( !value.ToULong(&value2) )
#endif
return false;
wxAnyValueTypeImplUint::SetValue(value2, dst);
}
-48
View File
@@ -78,14 +78,12 @@ wxDataInputStream::wxDataInputStream(wxInputStream& s, const wxMBConv& conv)
{
}
#if wxHAS_INT64
wxUint64 wxDataInputStream::Read64()
{
wxUint64 tmp;
Read64(&tmp, 1);
return tmp;
}
#endif // wxHAS_INT64
wxUint32 wxDataInputStream::Read32()
{
@@ -184,8 +182,6 @@ wxString wxDataInputStream::ReadString()
return ret;
}
#if wxUSE_LONGLONG
template <class T>
static
void DoReadLL(T *buffer, size_t size, wxInputStream *input, bool be_order)
@@ -265,10 +261,6 @@ static void DoWriteLL(const T *buffer, size_t size, wxOutputStream *output, bool
delete[] pchBuffer;
}
#endif // wxUSE_LONGLONG
#ifdef wxLongLong_t
template <class T>
static
void DoReadI64(T *buffer, size_t size, wxInputStream *input, bool be_order)
@@ -320,30 +312,17 @@ void DoWriteI64(const T *buffer, size_t size, wxOutputStream *output, bool be_or
}
}
#endif // wxLongLong_t
#if wxHAS_INT64
void wxDataInputStream::Read64(wxUint64 *buffer, size_t size)
{
#ifndef wxLongLong_t
DoReadLL(buffer, size, m_input, m_be_order);
#else
DoReadI64(buffer, size, m_input, m_be_order);
#endif
}
void wxDataInputStream::Read64(wxInt64 *buffer, size_t size)
{
#ifndef wxLongLong_t
DoReadLL(buffer, size, m_input, m_be_order);
#else
DoReadI64(buffer, size, m_input, m_be_order);
#endif
}
#endif // wxHAS_INT64
#if defined(wxLongLong_t) && wxUSE_LONGLONG
void wxDataInputStream::Read64(wxULongLong *buffer, size_t size)
{
DoReadLL(buffer, size, m_input, m_be_order);
@@ -353,9 +332,7 @@ void wxDataInputStream::Read64(wxLongLong *buffer, size_t size)
{
DoReadLL(buffer, size, m_input, m_be_order);
}
#endif // wxLongLong_t
#if wxUSE_LONGLONG
void wxDataInputStream::ReadLL(wxULongLong *buffer, size_t size)
{
DoReadLL(buffer, size, m_input, m_be_order);
@@ -372,7 +349,6 @@ wxLongLong wxDataInputStream::ReadLL(void)
DoReadLL(&ll, (size_t)1, m_input, m_be_order);
return ll;
}
#endif // wxUSE_LONGLONG
void wxDataInputStream::Read32(wxUint32 *buffer, size_t size)
{
@@ -481,7 +457,6 @@ wxDataInputStream& wxDataInputStream::operator>>(wxUint32& i)
return *this;
}
#if wxHAS_INT64
wxDataInputStream& wxDataInputStream::operator>>(wxUint64& i)
{
i = Read64();
@@ -493,9 +468,7 @@ wxDataInputStream& wxDataInputStream::operator>>(wxInt64& i)
i = Read64();
return *this;
}
#endif // wxHAS_INT64
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxDataInputStream& wxDataInputStream::operator>>(wxULongLong& i)
{
i = ReadLL();
@@ -507,7 +480,6 @@ wxDataInputStream& wxDataInputStream::operator>>(wxLongLong& i)
i = ReadLL();
return *this;
}
#endif // wxLongLong_t
wxDataInputStream& wxDataInputStream::operator>>(double& d)
{
@@ -531,7 +503,6 @@ wxDataOutputStream::wxDataOutputStream(wxOutputStream& s, const wxMBConv& conv)
{
}
#if wxHAS_INT64
void wxDataOutputStream::Write64(wxUint64 i)
{
Write64(&i, 1);
@@ -541,7 +512,6 @@ void wxDataOutputStream::Write64(wxInt64 i)
{
Write64(&i, 1);
}
#endif // wxHAS_INT64
void wxDataOutputStream::Write32(wxUint32 i)
{
@@ -627,27 +597,16 @@ void wxDataOutputStream::WriteFloat(float f)
}
}
#if wxHAS_INT64
void wxDataOutputStream::Write64(const wxUint64 *buffer, size_t size)
{
#ifndef wxLongLong_t
DoWriteLL(buffer, size, m_output, m_be_order);
#else
DoWriteI64(buffer, size, m_output, m_be_order);
#endif
}
void wxDataOutputStream::Write64(const wxInt64 *buffer, size_t size)
{
#ifndef wxLongLong_t
DoWriteLL(buffer, size, m_output, m_be_order);
#else
DoWriteI64(buffer, size, m_output, m_be_order);
#endif
}
#endif // wxHAS_INT64
#if defined(wxLongLong_t) && wxUSE_LONGLONG
void wxDataOutputStream::Write64(const wxULongLong *buffer, size_t size)
{
DoWriteLL(buffer, size, m_output, m_be_order);
@@ -657,9 +616,7 @@ void wxDataOutputStream::Write64(const wxLongLong *buffer, size_t size)
{
DoWriteLL(buffer, size, m_output, m_be_order);
}
#endif // wxLongLong_t
#if wxUSE_LONGLONG
void wxDataOutputStream::WriteLL(const wxULongLong *buffer, size_t size)
{
DoWriteLL(buffer, size, m_output, m_be_order);
@@ -679,7 +636,6 @@ void wxDataOutputStream::WriteLL(const wxULongLong &ll)
{
WriteLL(&ll, 1);
}
#endif // wxUSE_LONGLONG
void wxDataOutputStream::Write32(const wxUint32 *buffer, size_t size)
{
@@ -788,7 +744,6 @@ wxDataOutputStream& wxDataOutputStream::operator<<(wxUint32 i)
return *this;
}
#if wxHAS_INT64
wxDataOutputStream& wxDataOutputStream::operator<<(wxUint64 i)
{
Write64(i);
@@ -800,9 +755,7 @@ wxDataOutputStream& wxDataOutputStream::operator<<(wxInt64 i)
Write64(i);
return *this;
}
#endif // wxHAS_INT64
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxDataOutputStream& wxDataOutputStream::operator<<(const wxULongLong &i)
{
WriteLL(i);
@@ -814,7 +767,6 @@ wxDataOutputStream& wxDataOutputStream::operator<<(const wxLongLong &i)
WriteLL(i);
return *this;
}
#endif // wxLongLong_t
wxDataOutputStream& wxDataOutputStream::operator<<(double d)
{
-4
View File
@@ -309,8 +309,6 @@ wxString wxDir::FindFirst(const wxString& dirname,
// wxDir::GetTotalSize()
// ----------------------------------------------------------------------------
#if wxUSE_LONGLONG
class wxDirTraverserSumSize : public wxDirTraverser
{
public:
@@ -374,8 +372,6 @@ wxULongLong wxDir::GetTotalSize(const wxString &dirname, wxArrayString *filesSki
return traverser.GetTotalSize();
}
#endif // wxUSE_LONGLONG
// ----------------------------------------------------------------------------
// wxDir helpers
// ----------------------------------------------------------------------------
-10
View File
@@ -456,9 +456,7 @@ wxNcPaintEvent::wxNcPaintEvent(wxWindowBase* window)
// wxUpdateUIEvent
// ----------------------------------------------------------------------------
#if wxUSE_LONGLONG
wxLongLong wxUpdateUIEvent::sm_lastUpdate = 0;
#endif
long wxUpdateUIEvent::sm_updateInterval = 0;
@@ -509,7 +507,6 @@ bool wxUpdateUIEvent::CanUpdate(wxWindowBase *win)
if (sm_updateInterval == 0)
return true;
#if wxUSE_STOPWATCH && wxUSE_LONGLONG
wxLongLong now = wxGetLocalTimeMillis();
if (now > (sm_lastUpdate + sm_updateInterval))
{
@@ -517,18 +514,12 @@ bool wxUpdateUIEvent::CanUpdate(wxWindowBase *win)
}
return false;
#else
// If we don't have wxStopWatch or wxLongLong, we
// should err on the safe side and update now anyway.
return true;
#endif
}
// Reset the update time to provide a delay until the next
// time we should update
void wxUpdateUIEvent::ResetUpdateTime()
{
#if wxUSE_STOPWATCH && wxUSE_LONGLONG
if (sm_updateInterval > 0)
{
wxLongLong now = wxGetLocalTimeMillis();
@@ -537,7 +528,6 @@ void wxUpdateUIEvent::ResetUpdateTime()
sm_lastUpdate = now;
}
}
#endif
}
// ----------------------------------------------------------------------------
-7
View File
@@ -125,9 +125,7 @@
#define S_ISDIR(mode) ((mode) & S_IFDIR)
#endif
#if wxUSE_LONGLONG
extern const wxULongLong wxInvalidSize = (unsigned)-1;
#endif // wxUSE_LONGLONG
namespace
{
@@ -2884,8 +2882,6 @@ bool wxFileName::GetTimes(wxDateTime *dtAccess,
// file size functions
// ----------------------------------------------------------------------------
#if wxUSE_LONGLONG
/* static */
wxULongLong wxFileName::GetSize(const wxString &filename)
{
@@ -2975,6 +2971,3 @@ wxString wxFileName::GetHumanReadableSize(const wxString& failmsg,
{
return GetHumanReadableSize(GetSize(), failmsg, precision, conv);
}
#endif // wxUSE_LONGLONG
+3 -1171
View File
File diff suppressed because it is too large Load Diff
-4
View File
@@ -150,8 +150,6 @@ wxLongLong wxStopWatch::TimeInMicro() const
// old timer functions superceded by wxStopWatch
// ----------------------------------------------------------------------------
#if wxUSE_LONGLONG
static wxLongLong wxStartTime = 0l;
// starts the global timer
@@ -171,5 +169,3 @@ long wxGetElapsedTime(bool resetTimer)
return (newTime - oldTime).GetLo();
}
#endif // wxUSE_LONGLONG
-2
View File
@@ -669,10 +669,8 @@ wxFormatString::ArgumentType ArgTypeFromParamType(wxPrintfArgType type)
return wxFormatString::Arg_Int;
case wxPAT_LONGINT:
return wxFormatString::Arg_LongInt;
#ifdef wxLongLong_t
case wxPAT_LONGLONGINT:
return wxFormatString::Arg_LongLongInt;
#endif
case wxPAT_SIZET:
return wxFormatString::Arg_Size_t;
-11
View File
@@ -219,8 +219,6 @@ long wxGetUTCTime()
return (long)time(nullptr);
}
#if wxUSE_LONGLONG
wxLongLong wxGetUTCTimeUSec()
{
#if defined(__WINDOWS__)
@@ -311,12 +309,3 @@ wxLongLong wxGetLocalTimeMillis()
{
return wxGetUTCTimeMillis() - wxGetTimeZone()*MILLISECONDS_PER_SECOND;
}
#else // !wxUSE_LONGLONG
double wxGetLocalTimeMillis()
{
return (double(clock()) / double(CLOCKS_PER_SEC)) * MILLISECONDS_PER_SECOND;
}
#endif // wxUSE_LONGLONG/!wxUSE_LONGLONG
-84
View File
@@ -1522,8 +1522,6 @@ wxArrayString wxVariant::GetArrayString() const
// wxVariantDataLongLong
// ----------------------------------------------------------------------------
#if wxUSE_LONGLONG
class WXDLLIMPEXP_BASE wxVariantDataLongLong : public wxVariantData
{
public:
@@ -1562,7 +1560,6 @@ protected:
// wxLongLong type requires customized wxAny conversion code
//
#if wxUSE_ANY
#ifdef wxLongLong_t
bool wxVariantDataLongLong::GetAsAny(wxAny* any) const
{
@@ -1577,22 +1574,6 @@ wxVariantData* wxVariantDataLongLong::VariantDataFactory(const wxAny& any)
REGISTER_WXANY_CONVERSION(wxLongLong_t, wxVariantDataLongLong)
#else // if !defined(wxLongLong_t)
bool wxVariantDataLongLong::GetAsAny(wxAny* any) const
{
*any = m_value;
return true;
}
wxVariantData* wxVariantDataLongLong::VariantDataFactory(const wxAny& any)
{
return new wxVariantDataLongLong(any.As<wxLongLong>());
}
REGISTER_WXANY_CONVERSION(wxLongLong, wxVariantDataLongLong)
#endif // defined(wxLongLong_t)/!defined(wxLongLong_t)
#endif // wxUSE_ANY
bool wxVariantDataLongLong::Eq(wxVariantData& data) const
@@ -1617,12 +1598,8 @@ bool wxVariantDataLongLong::Write(std::ostream& str) const
bool wxVariantDataLongLong::Write(wxString& str) const
{
#ifdef wxLongLong_t
str.Printf(wxS("%lld"), m_value.GetValue());
return true;
#else
return false;
#endif
}
#if wxUSE_STD_IOSTREAM
@@ -1654,15 +1631,11 @@ bool wxVariantDataLongLong::Read(wxInputStream& str)
bool wxVariantDataLongLong::Read(wxString& str)
{
#ifdef wxLongLong_t
wxLongLong_t value_t;
if ( !str.ToLongLong(&value_t) )
return false;
m_value = value_t;
return true;
#else
return false;
#endif
}
// wxVariant
@@ -1715,14 +1688,10 @@ wxLongLong wxVariant::GetLongLong() const
}
}
#endif // wxUSE_LONGLONG
// ----------------------------------------------------------------------------
// wxVariantDataULongLong
// ----------------------------------------------------------------------------
#if wxUSE_LONGLONG
class WXDLLIMPEXP_BASE wxVariantDataULongLong : public wxVariantData
{
public:
@@ -1761,7 +1730,6 @@ protected:
// wxULongLong type requires customized wxAny conversion code
//
#if wxUSE_ANY
#ifdef wxLongLong_t
bool wxVariantDataULongLong::GetAsAny(wxAny* any) const
{
@@ -1776,22 +1744,6 @@ wxVariantData* wxVariantDataULongLong::VariantDataFactory(const wxAny& any)
REGISTER_WXANY_CONVERSION(wxULongLong_t, wxVariantDataULongLong)
#else // if !defined(wxLongLong_t)
bool wxVariantDataULongLong::GetAsAny(wxAny* any) const
{
*any = m_value;
return true;
}
wxVariantData* wxVariantDataULongLong::VariantDataFactory(const wxAny& any)
{
return new wxVariantDataULongLong(any.As<wxULongLong>());
}
REGISTER_WXANY_CONVERSION(wxULongLong, wxVariantDataULongLong)
#endif // defined(wxLongLong_t)/!defined(wxLongLong_t)
#endif // wxUSE_ANY
@@ -1817,12 +1769,8 @@ bool wxVariantDataULongLong::Write(std::ostream& str) const
bool wxVariantDataULongLong::Write(wxString& str) const
{
#ifdef wxLongLong_t
str.Printf(wxS("%llu"), m_value.GetValue());
return true;
#else
return false;
#endif
}
#if wxUSE_STD_IOSTREAM
@@ -1854,15 +1802,11 @@ bool wxVariantDataULongLong::Read(wxInputStream& str)
bool wxVariantDataULongLong::Read(wxString& str)
{
#ifdef wxLongLong_t
wxULongLong_t value_t;
if ( !str.ToULongLong(&value_t) )
return false;
m_value = value_t;
return true;
#else
return false;
#endif
}
// wxVariant
@@ -1915,8 +1859,6 @@ wxULongLong wxVariant::GetULongLong() const
}
}
#endif // wxUSE_LONGLONG
// ----------------------------------------------------------------------------
// wxVariantDataList
// ----------------------------------------------------------------------------
@@ -2252,7 +2194,6 @@ bool wxVariant::Convert(long* value) const
*value = (long) (((wxVariantDataBool*)GetData())->GetValue());
else if (type == wxS("string"))
*value = wxAtol(((wxVariantDataString*)GetData())->GetValue());
#if wxUSE_LONGLONG
else if (type == wxS("longlong"))
{
wxLongLong v = ((wxVariantDataLongLong*)GetData())->GetValue();
@@ -2269,7 +2210,6 @@ bool wxVariant::Convert(long* value) const
return false;
*value = (long) v.ToULong();
}
#endif
else
return false;
@@ -2313,7 +2253,6 @@ bool wxVariant::Convert(double* value) const
*value = (double) (((wxVariantDataBool*)GetData())->GetValue());
else if (type == wxT("string"))
*value = (double) wxAtof(((wxVariantDataString*)GetData())->GetValue());
#if wxUSE_LONGLONG
else if (type == wxS("longlong"))
{
*value = ((wxVariantDataLongLong*)GetData())->GetValue().ToDouble();
@@ -2322,7 +2261,6 @@ bool wxVariant::Convert(double* value) const
{
*value = ((wxVariantDataULongLong*)GetData())->GetValue().ToDouble();
}
#endif
else
return false;
@@ -2377,7 +2315,6 @@ bool wxVariant::Convert(wxString* value) const
return true;
}
#if wxUSE_LONGLONG
bool wxVariant::Convert(wxLongLong* value) const
{
wxString type(GetType());
@@ -2388,17 +2325,10 @@ bool wxVariant::Convert(wxLongLong* value) const
else if (type == wxS("string"))
{
wxString s = ((wxVariantDataString*)GetData())->GetValue();
#ifdef wxLongLong_t
wxLongLong_t value_t;
if ( !s.ToLongLong(&value_t) )
return false;
*value = value_t;
#else
long l_value;
if ( !s.ToLong(&l_value) )
return false;
*value = l_value;
#endif
}
else if (type == wxS("bool"))
*value = (long) (((wxVariantDataBool*)GetData())->GetValue());
@@ -2424,17 +2354,10 @@ bool wxVariant::Convert(wxULongLong* value) const
else if (type == wxS("string"))
{
wxString s = ((wxVariantDataString*)GetData())->GetValue();
#ifdef wxLongLong_t
wxULongLong_t value_t;
if ( !s.ToULongLong(&value_t) )
return false;
*value = value_t;
#else
unsigned long l_value;
if ( !s.ToULong(&l_value) )
return false;
*value = l_value;
#endif
}
else if (type == wxS("bool"))
*value = (long) (((wxVariantDataBool*)GetData())->GetValue());
@@ -2445,13 +2368,7 @@ bool wxVariant::Convert(wxULongLong* value) const
if ( value_d < 0.0 )
return false;
#ifdef wxLongLong_t
*value = (wxULongLong_t) value_d;
#else
wxLongLong temp;
temp.Assign(value_d);
*value = temp;
#endif
}
else if (type == wxS("longlong"))
*value = ((wxVariantDataLongLong*)GetData())->GetValue();
@@ -2460,7 +2377,6 @@ bool wxVariant::Convert(wxULongLong* value) const
return true;
}
#endif // wxUSE_LONGLONG
#if wxUSE_DATETIME
bool wxVariant::Convert(wxDateTime* value) const

Some files were not shown because too many files have changed in this diff Show More