From 483856f3d327c5faaf3775475584183e52c25537 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 22 Feb 2021 12:47:58 +0100 Subject: [PATCH] Add wxIntegerValidatorBase::ULongestValueType typedef Allow just writing ULongestValueType instead of writing #ifdefs in several places. --- include/wx/valnum.h | 2 ++ src/common/valnum.cpp | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/wx/valnum.h b/include/wx/valnum.h index 5305796edd..6c94f53613 100644 --- a/include/wx/valnum.h +++ b/include/wx/valnum.h @@ -293,8 +293,10 @@ protected: // 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) diff --git a/src/common/valnum.cpp b/src/common/valnum.cpp index b4adef753b..b0735393b0 100644 --- a/src/common/valnum.cpp +++ b/src/common/valnum.cpp @@ -244,11 +244,7 @@ wxIntegerValidatorBase::FromString(const wxString& s, else { // Parse as unsigned to ensure we don't accept minus sign here. -#ifdef wxULongLong_t - wxULongLong_t uvalue; -#else - unsigned long uvalue; -#endif + ULongestValueType uvalue; if ( !wxNumberFormatter::FromString(s, &uvalue) ) return false;