X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6058220154150a2f60b09198a444411873050e52..f5a1953b341d16396763bee067ccdd96108f3aad:/src/common/longlong.cpp diff --git a/src/common/longlong.cpp b/src/common/longlong.cpp index 62afbf79a4..e3d6a56586 100644 --- a/src/common/longlong.cpp +++ b/src/common/longlong.cpp @@ -1092,21 +1092,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 ) \ - { \ - result.Prepend((wxChar)(_T('0') + (ll % 10).ToLong())); \ - ll /= 10; \ + while ( ll != 0 ) \ + { \ + long digit = (ll % 10).ToLong(); \ + result.Prepend((wxChar)(_T('0') + digit)); \ + ll /= 10; \ + } \ } \ \ if ( result.empty() ) \