folly: build with -Wunused-parameter
[folly.git] / folly / detail / FileUtilDetail.h
index 108138b78436df255b4be9ef52e50a1d81eb3445..a5daee25efe5b3eab8cb052bd33a6e222901e647 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2015 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ ssize_t wrapNoInt(F f, Args... args) {
   return r;
 }
 
-inline void incr(ssize_t n) { }
+inline void incr(ssize_t /* n */) {}
 inline void incr(ssize_t n, off_t& offset) { offset += n; }
 
 // Wrap call to read/pread/write/pwrite(fd, buf, count, offset?) to retry on
@@ -74,10 +74,10 @@ ssize_t wrapFull(F f, int fd, void* buf, size_t count, Offset... offset) {
 template <class F, class... Offset>
 ssize_t wrapvFull(F f, int fd, iovec* iov, int count, Offset... offset) {
   ssize_t totalBytes = 0;
-  ssize_t r;
+  size_t r;
   do {
     r = f(fd, iov, count, offset...);
-    if (r == -1) {
+    if (r == (size_t)-1) {
       if (errno == EINTR) {
         continue;
       }
@@ -109,4 +109,3 @@ ssize_t wrapvFull(F f, int fd, iovec* iov, int count, Offset... offset) {
 }}  // namespaces
 
 #endif /* FOLLY_DETAIL_FILEUTILDETAIL_H_ */
-