X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d4037aa1f081ee2273468aa6f6cc5918d5e7d14..659af826726fea66d2476d3a0ead2fb00e34ad23:/src/common/longlong.cpp diff --git a/src/common/longlong.cpp b/src/common/longlong.cpp index aa40465563..9334dcc3f4 100644 --- a/src/common/longlong.cpp +++ b/src/common/longlong.cpp @@ -35,6 +35,8 @@ #include // for memset() #endif +#include "wx/ioswrap.h" + // ============================================================================ // implementation // ============================================================================ @@ -1092,24 +1094,24 @@ void *wxULongLongWx::asArray(void) const \ name ll = *this; \ \ - bool neg; \ - if ( ll < 0 ) \ + bool neg = ll < 0; \ + if ( neg ) \ { \ - ll.Negate(); \ - neg = true; \ + while ( ll != 0 ) \ + { \ + long digit = (ll % 10).ToLong(); \ + result.Prepend((wxChar)(_T('0') - digit)); \ + ll /= 10; \ + } \ } \ else \ { \ - neg = false; \ - } \ - \ - while ( ll != 0 ) \ - { \ - long digit = (ll % 10).ToLong(); \ - if ( neg ) \ - digit = -digit; \ - result.Prepend((wxChar)(_T('0') + digit)); \ - ll /= 10; \ + while ( ll != 0 ) \ + { \ + long digit = (ll % 10).ToLong(); \ + result.Prepend((wxChar)(_T('0') + digit)); \ + ll /= 10; \ + } \ } \ \ if ( result.empty() ) \