]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/longlong.cpp
Fix crash when using a proxy (m_protocol already gets cleaned up via CleanData())
[wxWidgets.git] / src / common / longlong.cpp
index 63db358fff4781960a0aa852816d1e80a2026923..e3d6a5658623702d4e770d20657450224e4c1004 100644 (file)
@@ -751,7 +751,7 @@ wxULongLongWx& wxULongLongWx::operator*=(const wxULongLongWx& ll)
     m_hi = m_lo = 0;
 
 #ifdef wxLONGLONG_TEST_MODE
-    unsigned wxLongLong_t llOld = m_ll;
+    wxULongLong_t llOld = m_ll;
     m_ll = 0;
 #endif // wxLONGLONG_TEST_MODE
 
@@ -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() )                                        \
@@ -1150,11 +1153,13 @@ void *wxULongLongWx::asArray(void) const
 #if wxUSE_STD_IOSTREAM
 
 // input/output
+WXDLLIMPEXP_BASE
 wxSTD ostream& operator<< (wxSTD ostream& o, const wxLongLong& ll)
 {
     return o << ll.ToString();
 }
 
+WXDLLIMPEXP_BASE
 wxSTD ostream& operator<< (wxSTD ostream& o, const wxULongLong& ll)
 {
     return o << ll.ToString();
@@ -1162,12 +1167,12 @@ wxSTD ostream& operator<< (wxSTD ostream& o, const wxULongLong& ll)
 
 #endif // wxUSE_STD_IOSTREAM
 
-wxString& operator<< (wxString& s, const wxLongLong& ll)
+WXDLLIMPEXP_BASE wxString& operator<< (wxString& s, const wxLongLong& ll)
 {
     return s << ll.ToString();
 }
 
-wxString& operator<< (wxString& s, const wxULongLong& ll)
+WXDLLIMPEXP_BASE wxString& operator<< (wxString& s, const wxULongLong& ll)
 {
     return s << ll.ToString();
 }