indent() << function_signature(*f_iter, "") << " {" << endl;
indent_up();
f_header_ <<
- indent() << "uint32_t sz = ifaces_.size();" << endl <<
- indent() << "for (uint32_t i = 0; i < sz; ++i) {" << endl;
+ indent() << "size_t sz = ifaces_.size();" << endl <<
+ indent() << "for (size_t i = 0; i < sz; ++i) {" << endl;
if (!(*f_iter)->get_returntype()->is_void()) {
f_header_ <<
indent() << " if (i == sz - 1) {" << endl;
"xfer += oprot->writeMapBegin(" <<
type_to_enum(((t_map*)ttype)->get_key_type()) << ", " <<
type_to_enum(((t_map*)ttype)->get_val_type()) << ", " <<
- prefix << ".size());" << endl;
+ "static_cast<uint32_t>(" << prefix << ".size()));" << endl;
} else if (ttype->is_set()) {
indent(out) <<
"xfer += oprot->writeSetBegin(" <<
type_to_enum(((t_set*)ttype)->get_elem_type()) << ", " <<
- prefix << ".size());" << endl;
+ "static_cast<uint32_t>(" << prefix << ".size()));" << endl;
} else if (ttype->is_list()) {
indent(out) <<
"xfer += oprot->writeListBegin(" <<
type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " <<
- prefix << ".size());" << endl;
+ "static_cast<uint32_t>(" << prefix << ".size()));" << endl;
}
string iter = tmp("_iter");
if (TDB_LIKELY(static_cast<ptrdiff_t>(*len) <= rBound_ - rBase_)) {
// With strict aliasing, writing to len shouldn't force us to
// refetch rBase_ from memory. TODO(dreiss): Verify this.
- *len = rBound_ - rBase_;
+ *len = static_cast<uint32_t>(rBound_ - rBase_);
return rBase_;
}
return borrowSlow(buf, len);
// TODO(dreiss): Make bufPtr const.
void getBuffer(uint8_t** bufPtr, uint32_t* sz) {
*bufPtr = rBase_;
- *sz = wBase_ - rBase_;
+ *sz = static_cast<uint32_t>(wBase_ - rBase_);
}
std::string getBufferAsString() {
uint32_t available_read() const {
// Remember, wBase_ is the real rBound_.
- return wBase_ - rBase_;
+ return static_cast<uint32_t>(wBase_ - rBase_);
}
uint32_t available_write() const {
- return wBound_ - wBase_;
+ return static_cast<uint32_t>(wBound_ - wBase_);
}
// Returns a pointer to where the client can write data to append to