{
encode_nohead(std::string_view(s), bl);
}
-inline void decode_nohead(int len, std::string& s, bufferlist::const_iterator& p)
+inline void decode_nohead(unsigned len, std::string& s, bufferlist::const_iterator& p)
{
s.clear();
p.copy(len, s);
{
bl.append(s);
}
-inline void decode_nohead(int len, bufferlist& s, bufferlist::const_iterator& p)
+inline void decode_nohead(unsigned len, bufferlist& s, bufferlist::const_iterator& p)
{
s.clear();
p.copy(len, s);
encode_nohead(const std::set<T,Comp,Alloc>& s, bufferlist& bl);
template<class T, class Comp, class Alloc, typename traits=denc_traits<T>>
inline std::enable_if_t<!traits::supported>
-decode_nohead(int len, std::set<T,Comp,Alloc>& s, bufferlist::iterator& p);
+decode_nohead(unsigned len, std::set<T,Comp,Alloc>& s, bufferlist::iterator& p);
template<class T, class Comp, class Alloc, typename traits=denc_traits<T>>
inline std::enable_if_t<!traits::supported>
encode(const boost::container::flat_set<T, Comp, Alloc>& s, bufferlist& bl);
bufferlist& bl);
template<class T, class Comp, class Alloc, typename traits=denc_traits<T>>
inline std::enable_if_t<!traits::supported>
-decode_nohead(int len, boost::container::flat_set<T, Comp, Alloc>& s,
+decode_nohead(unsigned len, boost::container::flat_set<T, Comp, Alloc>& s,
bufferlist::iterator& p);
template<class T, class Comp, class Alloc>
inline void encode(const std::multiset<T,Comp,Alloc>& s, bufferlist& bl);
encode_nohead(const std::vector<T,Alloc>& v, bufferlist& bl);
template<class T, class Alloc, typename traits=denc_traits<T>>
inline std::enable_if_t<!traits::supported>
-decode_nohead(int len, std::vector<T,Alloc>& v, bufferlist::const_iterator& p);
+decode_nohead(unsigned len, std::vector<T,Alloc>& v, bufferlist::const_iterator& p);
template<class T,class Alloc>
inline void encode(const std::vector<std::shared_ptr<T>,Alloc>& v,
bufferlist& bl,
encode_nohead(const boost::container::small_vector<T,N,Alloc>& v, bufferlist& bl);
template<class T, std::size_t N, class Alloc, typename traits=denc_traits<T>>
inline std::enable_if_t<!traits::supported>
-decode_nohead(int len, boost::container::small_vector<T,N,Alloc>& v, bufferlist::const_iterator& p);
+decode_nohead(unsigned len, boost::container::small_vector<T,N,Alloc>& v, bufferlist::const_iterator& p);
// std::map
template<class T, class U, class Comp, class Alloc,
typename t_traits=denc_traits<T>, typename u_traits=denc_traits<U>>
template<class T, class U, class Comp, class Alloc,
typename t_traits=denc_traits<T>, typename u_traits=denc_traits<U>>
inline std::enable_if_t<!t_traits::supported || !u_traits::supported>
-decode_nohead(int n, std::map<T,U,Comp,Alloc>& m, bufferlist::const_iterator& p);
+decode_nohead(unsigned n, std::map<T,U,Comp,Alloc>& m, bufferlist::const_iterator& p);
template<class T, class U, class Comp, class Alloc,
typename t_traits=denc_traits<T>, typename u_traits=denc_traits<U>>
inline std::enable_if_t<!t_traits::supported || !u_traits::supported>
template<class T, class U, class Comp, class Alloc,
typename t_traits=denc_traits<T>, typename u_traits=denc_traits<U>>
inline std::enable_if_t<!t_traits::supported || !u_traits::supported>
-decode_nohead(int n, boost::container::flat_map<T,U,Comp,Alloc>& m,
+decode_nohead(unsigned n, boost::container::flat_map<T,U,Comp,Alloc>& m,
bufferlist::const_iterator& p);
template<class T, class U, class Comp, class Alloc>
inline void encode(const std::multimap<T,U,Comp,Alloc>& m, bufferlist& bl);
}
template<class T, class Comp, class Alloc, typename traits>
inline std::enable_if_t<!traits::supported>
- decode_nohead(int len, std::set<T,Comp,Alloc>& s, bufferlist::const_iterator& p)
+ decode_nohead(unsigned len, std::set<T,Comp,Alloc>& s, bufferlist::const_iterator& p)
{
- for (int i=0; i<len; i++) {
+ for (unsigned i=0; i<len; i++) {
T v;
decode(v, p);
s.insert(v);
}
template<class T, class Comp, class Alloc, typename traits>
inline std::enable_if_t<!traits::supported>
-decode_nohead(int len, boost::container::flat_set<T, Comp, Alloc>& s,
+decode_nohead(unsigned len, boost::container::flat_set<T, Comp, Alloc>& s,
bufferlist::iterator& p)
{
s.reserve(len);
- for (int i=0; i<len; i++) {
+ for (unsigned i=0; i<len; i++) {
T v;
decode(v, p);
s.insert(v);
}
template<class T, class Alloc, typename traits>
inline std::enable_if_t<!traits::supported>
- decode_nohead(int len, std::vector<T,Alloc>& v, bufferlist::const_iterator& p)
+ decode_nohead(unsigned len, std::vector<T,Alloc>& v, bufferlist::const_iterator& p)
{
v.resize(len);
for (__u32 i=0; i<v.size(); i++)
}
template<class T, std::size_t N, class Alloc, typename traits>
inline std::enable_if_t<!traits::supported>
- decode_nohead(int len, boost::container::small_vector<T,N,Alloc>& v, bufferlist::const_iterator& p)
+ decode_nohead(unsigned len, boost::container::small_vector<T,N,Alloc>& v, bufferlist::const_iterator& p)
{
v.resize(len);
for (auto& i : v)
template<class T, class U, class Comp, class Alloc,
typename t_traits, typename u_traits>
inline std::enable_if_t<!t_traits::supported || !u_traits::supported>
- decode_nohead(int n, std::map<T,U,Comp,Alloc>& m, bufferlist::const_iterator& p)
+ decode_nohead(unsigned n, std::map<T,U,Comp,Alloc>& m, bufferlist::const_iterator& p)
{
m.clear();
while (n--) {
template <std::move_constructible T, std::move_constructible U, class Comp, class Alloc,
typename t_traits, typename u_traits>
inline std::enable_if_t<!t_traits::supported || !u_traits::supported>
-decode_nohead(int n, std::map<T, U, Comp, Alloc>& m, bufferlist::const_iterator& p)
+decode_nohead(unsigned n, std::map<T, U, Comp, Alloc>& m, bufferlist::const_iterator& p)
{
m.clear();
while (n--) {
template<class T, class U, class Comp, class Alloc,
typename t_traits, typename u_traits>
inline std::enable_if_t<!t_traits::supported || !u_traits::supported>
- decode_nohead(int n, boost::container::flat_map<T,U,Comp,Alloc>& m,
+ decode_nohead(unsigned n, boost::container::flat_map<T,U,Comp,Alloc>& m,
bufferlist::const_iterator& p)
{
m.clear();