template <class Pod, class T>
inline void podFill(Pod* b, Pod* e, T c) {
FBSTRING_ASSERT(b && e && b <= e);
- /*static*/ if (sizeof(T) == 1) {
+ constexpr auto kUseMemset = sizeof(T) == 1;
+ /* static */ if (kUseMemset) {
memset(b, c, size_t(e - b));
} else {
auto const ee = b + ((e - b) & ~7u);
}
}
#else
-inline void getDeviceOptions(dev_t device, off_t& pageSize,
- bool& autoExtend) { }
+inline void getDeviceOptions(dev_t, off_t&, bool&) {}
#endif
} // namespace
}
uint32_t after = (state & kMayDefer) == 0 ? 0 : kPrevDefer;
- if (!ReaderPriority || (state & (kMayDefer | kHasS)) == 0) {
+ if (!kReaderPriority || (state & (kMayDefer | kHasS)) == 0) {
// Block readers immediately, either because we are in write
// priority mode or because we can acquire the lock in one
// step. Note that if state has kHasU, then we are doing an
return false;
}
- if (ReaderPriority && (state & kHasE) == 0) {
+ if (kReaderPriority && (state & kHasE) == 0) {
assert((state & kBegunE) != 0);
if (!state_.compare_exchange_strong(state,
(state & ~kBegunE) | kHasE)) {
#else
-void MemoryIdler::unmapUnusedStack(size_t retain) {
-}
+void MemoryIdler::unmapUnusedStack(size_t /* retain */) {}
#endif
#else
-ssize_t tfo_sendmsg(int sockfd, const struct msghdr* msg, int flags) {
+ssize_t
+tfo_sendmsg(int /* sockfd */, const struct msghdr* /* msg */, int /* flags */) {
errno = EOPNOTSUPP;
return -1;
}
-int tfo_enable(int sockfd, size_t max_queue_size) {
+int tfo_enable(int /* sockfd */, size_t /* max_queue_size */) {
errno = ENOPROTOOPT;
return -1;
}
-bool tfo_succeeded(int sockfd) {
+bool tfo_succeeded(int /* sockfd */) {
errno = EOPNOTSUPP;
return false;
}
}
int AsyncSocket::setQuickAck(bool quickack) {
+ (void)quickack;
if (fd_ < 0) {
VLOG(4) << "AsyncSocket::setQuickAck() called on non-open socket "
<< this << "(state=" << state_ << ")";
FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) {
// I really hope frame is zero...
+ (void)frame;
assert(frame == 0);
return _ReturnAddress();
}
return 0;
}
-inline int pthread_attr_getguardsize(pthread_attr_t* attr, size_t* guardsize) {
+inline int pthread_attr_getguardsize(
+ pthread_attr_t* /* attr */,
+ size_t* guardsize) {
*guardsize = 0;
return 0;
}
return recvfrom(s, (void*)buf, (size_t)len, flags, from, fromlen);
}
-ssize_t recvmsg(int s, struct msghdr* message, int fl) {
+ssize_t recvmsg(int s, struct msghdr* message, int /* flags */) {
SOCKET h = fd_to_socket(s);
// Don't currently support the name translation.
return send(s, (const void*)buf, (size_t)len, flags);
}
-ssize_t sendmsg(int s, const struct msghdr* message, int fl) {
+ssize_t sendmsg(int s, const struct msghdr* message, int /* flags */) {
SOCKET h = fd_to_socket(s);
// Unfortunately, WSASendMsg requires the socket to have been opened
}
extern "C" {
-int madvise(const void* addr, size_t len, int advise) {
+int madvise(const void* /* addr */, size_t /* len */, int /* advise */) {
// We do nothing at all.
// Could probably implement dontneed via VirtualAlloc
// with the MEM_RESET and MEM_RESET_UNDO flags.
return -1;
}
-int getrusage(int who, rusage* usage) {
+int getrusage(int /* who */, rusage* usage) {
// You get NOTHING! Good day to you sir.
ZeroMemory(usage, sizeof(rusage));
return 0;
}
-int setrlimit(int type, rlimit* src) {
+int setrlimit(int /* type */, rlimit* /* src */) {
// Do nothing for setting them for now.
// We couldn't set the stack size at runtime even if we wanted to.
return 0;
// Just return the result of a normal stat for now
int lstat(const char* path, struct stat* st) { return stat(path, st); }
-int mkdir(const char* fn, int mode) { return _mkdir(fn); }
+int mkdir(const char* fn, int /* mode */) {
+ return _mkdir(fn);
+}
int umask(int md) { return _umask(md); }
}
return ret;
}
-void* sbrk(intptr_t i) { return (void*)-1; }
+void* sbrk(intptr_t /* i */) {
+ return (void*)-1;
+}
unsigned int sleep(unsigned int seconds) {
Sleep((DWORD)(seconds * 1000));