From ff570df24727347a9eddffd1a831d767aead7d5b Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Sun, 2 Oct 2005 11:37:36 +0000 Subject: [PATCH] Fix MS Visual C 6.0 library bug --- docs/notework.txt | 4 ++++ goldnode/goldnode.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/docs/notework.txt b/docs/notework.txt index e2c6146..3bea4d1 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,10 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +- Fix MS Visual C 6.0 library bug in vector::sort(). GoldNode+/MSVC sort + nodelist correctly with nodes quantity > 32767 now. + (Patch from Ianos Gnatiuc 2:5030/830.17) + + Add CHS tables and XLATCHARSET lines for the double recoded russian text. (Tables by Eugene Palenock 2:5020/2065.468@FidoNet.) diff --git a/goldnode/goldnode.cpp b/goldnode/goldnode.cpp index 2d1db0e..60ca071 100644 --- a/goldnode/goldnode.cpp +++ b/goldnode/goldnode.cpp @@ -74,7 +74,48 @@ const size_t maxnodes = 262000; typedef std::vector::iterator addr_iter; typedef std::vector::iterator stamp_iter; + +#if (_MSC_VER == 1200) +class _geidxlist : public std::list<_GEIdx> +{ +public: + void sort() + { + if (2 <= size()) + { + const size_t _MAXN = 15; + _Myt _X(allocator), _A[_MAXN + 1]; + size_t _N = 0; + + while (!empty()) + { + _X.splice(_X.begin(), *this, begin()); + size_t _I; + + for (_I = 0; _I < _N && !_A[_I].empty(); ++_I) + { + _A[_I].merge(_X); + _A[_I].swap(_X); + } + + if (_I == _MAXN) _A[_I].merge(_X); + else + { + _A[_I].swap(_X); + if (_I == _N) ++_N; + } + } + + for (int _NN = _N; _NN >= 0; _NN--) + merge(_A[_NN]); + } + } +}; + +typedef _geidxlist geidxlist; +#else typedef std::list<_GEIdx> geidxlist; +#endif // Nodelists std::vector nodelist; // nodelist files,stamps,update marker