diff --git a/src/common/buffer.cc b/src/common/buffer.cc index be6fa65eda5..19b4cd2ef7c 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -1041,7 +1041,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; : iterator_impl(i.bl, i.off, i.p, i.p_off) {} template - void buffer::list::iterator_impl::advance(int o) + void buffer::list::iterator_impl::advance(ssize_t o) { //cout << this << " advance " << o << " from " << off << " (p_off " << p_off << " in " << p->length() << ")" << std::endl; if (o > 0) { @@ -1080,7 +1080,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; } template - void buffer::list::iterator_impl::seek(unsigned o) + void buffer::list::iterator_impl::seek(size_t o) { p = ls->begin(); off = p_off = 0; @@ -1247,12 +1247,12 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; : iterator_impl(l, o, ip, po) {} - void buffer::list::iterator::advance(int o) + void buffer::list::iterator::advance(ssize_t o) { buffer::list::iterator_impl::advance(o); } - void buffer::list::iterator::seek(unsigned o) + void buffer::list::iterator::seek(size_t o) { buffer::list::iterator_impl::seek(o); } diff --git a/src/include/buffer.h b/src/include/buffer.h index 99985732378..49fd999ee6d 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -308,8 +308,8 @@ namespace buffer CEPH_BUFFER_API { //return off == bl->length(); } - void advance(int o); - void seek(unsigned o); + void advance(ssize_t o); + void seek(size_t o); char operator*() const; iterator_impl& operator++(); ptr get_current_ptr() const; @@ -351,8 +351,8 @@ namespace buffer CEPH_BUFFER_API { iterator(bl_t *l, unsigned o=0); iterator(bl_t *l, unsigned o, list_iter_t ip, unsigned po); - void advance(int o); - void seek(unsigned o); + void advance(ssize_t o); + void seek(size_t o); char operator*(); iterator& operator++(); ptr get_current_ptr();