Fix type mismatch in IOBuf::getIov()
authorPeter Griess <pgriess@fb.com>
Fri, 18 Apr 2014 20:06:07 +0000 (13:06 -0700)
committerDave Watson <davejwatson@fb.com>
Tue, 20 May 2014 19:53:39 +0000 (12:53 -0700)
Summary: - On iOS, iovec::iov_len is a size_t, which is a uint32_t; convert

Test Plan:
- fbconfig -r folly && fbmake runtests
- Builds in fbobjc

Reviewed By: simpkins@fb.com

FB internal diff: D1284931

folly/io/IOBuf.cpp

index 783c4553c4a0cd73d13cdb5fe1d2523e3ac244fb..f8a34fd06abdc0c7714c9e7360d738d24f3c6704 100644 (file)
@@ -882,7 +882,7 @@ folly::fbvector<struct iovec> IOBuf::getIov() const {
   do {
     // some code can get confused by empty iovs, so skip them
     if (p->length() > 0) {
-      iov.push_back({(void*)p->data(), p->length()});
+      iov.push_back({(void*)p->data(), folly::to<size_t>(p->length())});
     }
     p = p->next();
   } while (p != this);