Split settings into seperate source and header files
[oweals/minetest.git] / src / socket.cpp
index bca9c5390b987a58f9e412b96a88535a79ba890e..0e9183f18058c11cc645cd892a16347f1d01d462 100644 (file)
@@ -19,6 +19,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "socket.h"
 
+#include <stdio.h>
+#include <iostream>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <sstream>
+#include <iomanip>
+#include "util/string.h"
+#include "util/numeric.h"
+#include "constants.h"
+#include "debug.h"
+#include "settings.h"
+#include "log.h"
+#include "main.h" // for g_settings
+
 #ifdef _WIN32
        #ifndef WIN32_LEAN_AND_MEAN
                #define WIN32_LEAN_AND_MEAN
@@ -46,20 +61,6 @@ typedef int socklen_t;
 typedef int socket_t;
 #endif
 
-#include "constants.h"
-#include "debug.h"
-#include "settings.h"
-#include "main.h" // for g_settings
-#include <stdio.h>
-#include <iostream>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sstream>
-#include <iomanip>
-#include "util/string.h"
-#include "util/numeric.h"
-
 // Set to true to enable verbose debug output
 bool socket_enable_debug_output = false;
 
@@ -202,7 +203,8 @@ std::string Address::serializeString() const
 #ifdef _WIN32
        if(m_addr_family == AF_INET)
        {
-               u8 a, b, c, d, addr;
+               u8 a, b, c, d;
+               u32 addr;
                addr = ntohl(m_address.ipv4.sin_addr.s_addr);
                a = (addr & 0xFF000000) >> 24;
                b = (addr & 0x00FF0000) >> 16;