Fix some warnings in folly
authormwilliams <mwilliams@fb.com>
Fri, 24 Jul 2015 18:44:20 +0000 (11:44 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Sat, 25 Jul 2015 17:22:06 +0000 (10:22 -0700)
Summary: Remove a couple of unused variables, and move one
that was only used inside an ifdef

Reviewed By: @yfeldblum

Differential Revision: D2279989

folly/experimental/fibers/FiberManager.cpp
folly/io/async/AsyncServerSocket.cpp

index 445b65ad6e8f22db569321662e65e15f383e1e5d..9f71f3ba3663620a91c15b2a2a913b2c16b12ca5 100644 (file)
@@ -41,8 +41,6 @@ FiberManager::~FiberManager() {
     loopController_->cancel();
   }
 
     loopController_->cancel();
   }
 
-  Fiber* fiberIt;
-  Fiber* fiberItNext;
   while (!fibersPool_.empty()) {
     fibersPool_.pop_front_and_dispose([] (Fiber* fiber) {
       delete fiber;
   while (!fibersPool_.empty()) {
     fibersPool_.pop_front_and_dispose([] (Fiber* fiber) {
       delete fiber;
index b6a28cd0e9980cd8ecbeb1b78e4bc27ce98381af..75e0da30ad45a8cfc01adf373c8dae438294bc27 100644 (file)
@@ -636,7 +636,6 @@ void AsyncServerSocket::setupSocket(int fd) {
   // Get the address family
   SocketAddress address;
   address.setFromLocalAddress(fd);
   // Get the address family
   SocketAddress address;
   address.setFromLocalAddress(fd);
-  auto family = address.getFamily();
 
   // Put the socket in non-blocking mode
   if (fcntl(fd, F_SETFL, O_NONBLOCK) != 0) {
 
   // Put the socket in non-blocking mode
   if (fcntl(fd, F_SETFL, O_NONBLOCK) != 0) {
@@ -679,6 +678,7 @@ void AsyncServerSocket::setupSocket(int fd) {
   // Set TCP nodelay if available, MAC OS X Hack
   // See http://lists.danga.com/pipermail/memcached/2005-March/001240.html
 #ifndef TCP_NOPUSH
   // Set TCP nodelay if available, MAC OS X Hack
   // See http://lists.danga.com/pipermail/memcached/2005-March/001240.html
 #ifndef TCP_NOPUSH
+  auto family = address.getFamily();
   if (family != AF_UNIX) {
     if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)) != 0) {
       // This isn't a fatal error; just log an error message and continue
   if (family != AF_UNIX) {
     if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)) != 0) {
       // This isn't a fatal error; just log an error message and continue