cppcheck: fix warnings
[awesomized/libmemcached] / util / instance.cc
index e96f414f72e6280ba899414496b81ce376c3c5ac..8f5d17383d95d3add0c7e5f0c6a693178328e8ff 100644 (file)
@@ -36,7 +36,7 @@
  */
 
 
-#include <config.h>
+#include "mem_config.h"
 
 #include "util/instance.hpp"
 
 #include <sys/types.h>
 
 #ifdef HAVE_UNISTD_H
-#include <unistd.h>
+# include <unistd.h>
+#endif
+
+#ifndef INVALID_SOCKET
+# define INVALID_SOCKET -1
+#endif
+
+#ifndef SOCKET_ERROR
+# define SOCKET_ERROR -1
+#endif
+
+#ifndef get_socket_errno
+# define get_socket_errno() errno
+#endif
+
+#ifndef closesocket
+# define closesocket(a) close(a)
 #endif
 
 
@@ -135,7 +151,7 @@ bool Instance::run()
         return false;
       }
       _addrinfo_next= _addrinfo_next->ai_next;
-
+      /* fall through */
 
     case CONNECT:
       close_socket();
@@ -211,7 +227,6 @@ bool Instance::run()
     case READING:
       if (operation->has_response())
       {
-        size_t total_read;
         ssize_t read_length;
 
         do
@@ -240,7 +255,6 @@ bool Instance::run()
           }
 
           operation->push(buffer, static_cast<size_t>(read_length));
-          total_read+= static_cast<size_t>(read_length);
 
         } while (more_to_read());
       } // end has_response