X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketImpl.cc;h=777fae749bdb5e26ad8da9fed5831825940883b6;hb=82ad2ed94c12c3e53097fef92978de8c28239fab;hp=dd78bb767633ff0cbba2e71e8e4cbab4cc27c2ee;hpb=47368f306a577d1e46df69a7f729bd3893cbe5e7;p=senf.git diff --git a/Packets/PacketImpl.cc b/Packets/PacketImpl.cc index dd78bb7..777fae7 100644 --- a/Packets/PacketImpl.cc +++ b/Packets/PacketImpl.cc @@ -21,12 +21,11 @@ /** \file \brief PacketImpl non-inline non-template implementation */ -#include "PacketImpl.hh" //#include "PacketImpl.ih" // Custom includes #include -#include "PacketInterpreter.hh" +#include "Packets.hh" //#include "PacketImpl.mpp" #define prefix_ @@ -58,7 +57,7 @@ prefix_ void senf::detail::PacketImpl::clear(PacketData * self) truncateInterpreters(n); iterator first (boost::next(begin(),self->begin_)); data_.erase(first, boost::next(begin(),self->end_)); - updateIterators(self,first,-self->size()); + updateIterators(self,self->begin_,-self->size()); } // private members @@ -74,7 +73,7 @@ prefix_ void senf::detail::PacketImpl::eraseInterpreters(interpreter_list::itera } } -prefix_ void senf::detail::PacketImpl::updateIterators(PacketData * self, iterator pos, +prefix_ void senf::detail::PacketImpl::updateIterators(PacketData * self, difference_type pos, difference_type n) { // I hate to change the PacketData representation from here, I would have preferred to let @@ -102,7 +101,7 @@ prefix_ void senf::detail::PacketImpl::updateIterators(PacketData * self, iterat // c) interpreter_list::iterator const i_end (interpreters_.end()); if (++i != i_end) - if (std::distance(begin(), pos) < difference_type(i->begin_)) + if (pos <= difference_type(i->begin_)) // pos is before the packet, it must then be before all futher packets ... for (; i != i_end; ++i) { i->begin_ += n; @@ -122,4 +121,6 @@ prefix_ void senf::detail::PacketImpl::updateIterators(PacketData * self, iterat // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: