# # # patch "ChangeLog" # from [7436f3f8621a686bbf9e1352bd88831c00b41e3e] # to [c88ef697b84e3864fe7312b5af01739f7b17d4ef] # # patch "hash_map.hh" # from [c994a47121bf30448e8103ffe42b6db847ac7fb2] # to [98827ec1d7ba91683c64e731820f434f022fdbe0] # # patch "merkle_tree.hh" # from [b521fb7e79fb73eb780abc2225363917982b4e96] # to [af2fed86c559da7f86f0d9a0f6189ab385ee8c08] # # patch "netsync.cc" # from [e6680e393c344a1614e0f247d4ea351237549a41] # to [87f721925a3075710a060622c97f29f850999d7c] # ============================================================ --- ChangeLog 7436f3f8621a686bbf9e1352bd88831c00b41e3e +++ ChangeLog c88ef697b84e3864fe7312b5af01739f7b17d4ef @@ -1,5 +1,13 @@ 2006-05-14 Graydon Hoare + * netsync.cc: Fix invariant typo. + * merkle_tree.hh: Remove unused equal_to struct. + * hash_map.hh: Correct for Microsoft hash_map assumption + that the binary functor in the traits class is an order, + not just an equality predicate. + +2006-05-14 Graydon Hoare + * netxx_pipe.{cc,hh}: Various cleanups to build on unix. * netsync.cc (drop_session_associated_with_fd): New helper, and use it everywhere we did sessions.erase() before. ============================================================ --- hash_map.hh c994a47121bf30448e8103ffe42b6db847ac7fb2 +++ hash_map.hh 98827ec1d7ba91683c64e731820f434f022fdbe0 @@ -5,15 +5,25 @@ #include namespace hashmap { + template class equal_to : public std::equal_to<_T> - {}; + { + // bool operator()(_T const & b, _T const & b) const; + }; + + template + class less : public std::less<_T> + { + // bool operator()(_T const & b, _T const & b) const; + }; template struct hash { -// size_t operator()(_T const & t) const; + // size_t operator()(_T const & t) const; }; + template<> struct hash { @@ -131,7 +141,7 @@ { static const size_t bucket_size = 4; static const size_t min_buckets = 8; - equal_to<_T> eq; + less<_T> lt; hash<_T> h; size_t operator( )(_T const & s) const @@ -141,7 +151,7 @@ bool operator( )(_T const & a, _T const & b) const { - return eq(a, b); + return lt(a, b); } }; template ============================================================ --- merkle_tree.hh b521fb7e79fb73eb780abc2225363917982b4e96 +++ merkle_tree.hh af2fed86c559da7f86f0d9a0f6189ab385ee8c08 @@ -114,15 +114,6 @@ return sh(m.first()) + m.second; } }; - template<> - struct equal_to - { - bool operator()(merkle_node_id const & a, - merkle_node_id const & b) const - { - return a.second == b.second && a.first == b.first; - } - }; } typedef hashmap::hash_map merkle_table; ============================================================ --- netsync.cc e6680e393c344a1614e0f247d4ea351237549a41 +++ netsync.cc 87f721925a3075710a060622c97f29f850999d7c @@ -2547,8 +2547,8 @@ shared_ptr pipe = boost::dynamic_pointer_cast(sess->str); I(static_cast(pipe)); - I(static_cast(pipe->get_writefd()) != -1); - I(static_cast(pipe->get_readfd()) != -1); + I(pipe->get_writefd() != -1); + I(pipe->get_readfd() != -1); sessions.erase(pipe->get_readfd()); sessions.erase(pipe->get_writefd()); }