From 9d6bd920ed35229a579ee378b59f021691cbdff4 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Fri, 23 Jan 2015 13:11:04 +0100 Subject: [PATCH 1/3] there is a space expected behind the arguments --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 438144c62..c18f726a6 100644 --- a/main.cpp +++ b/main.cpp @@ -573,8 +573,8 @@ static void printHelp(const char *cn,FILE *out) fprintf(out,"Available switches:"ZT_EOL_S); fprintf(out," -h - Display this help"ZT_EOL_S); fprintf(out," -v - Show version"ZT_EOL_S); - fprintf(out," -p - Port for UDP (default: 9993)"ZT_EOL_S); - fprintf(out," -t - Port for TCP (default: disabled)"ZT_EOL_S); + fprintf(out," -p - Port for UDP (default: 9993)"ZT_EOL_S); + fprintf(out," -t - Port for TCP (default: disabled)"ZT_EOL_S); //fprintf(out," -T - Override root topology, do not authenticate or update"ZT_EOL_S); #ifdef __UNIX_LIKE__ fprintf(out," -d - Fork and run as daemon (Unix-ish OSes)"ZT_EOL_S); From acd77a5441275cf2a8af9ebb5b24bdd6ccda6a07 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Fri, 6 Feb 2015 17:23:40 +0100 Subject: [PATCH 2/3] drop namespace from std::size_t and std::ptrdiff_t the C and C++ definitions identical, but they might not be defined in std for some alternative stdc++ libraries --- control/NodeControlClient.cpp | 2 ++ node/Array.hpp | 22 ++++++++++++---------- node/InetAddress.cpp | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/control/NodeControlClient.cpp b/control/NodeControlClient.cpp index 6fd7b12ed..e5ea2c20e 100644 --- a/control/NodeControlClient.cpp +++ b/control/NodeControlClient.cpp @@ -33,6 +33,8 @@ #include "IpcListener.hpp" #include "NodeControlService.hpp" +#include "stddef.h" + #ifdef __WINDOWS__ #include #include diff --git a/node/Array.hpp b/node/Array.hpp index ce179c16c..a1779909a 100644 --- a/node/Array.hpp +++ b/node/Array.hpp @@ -31,12 +31,14 @@ #include #include +#include "stddef.h" + namespace ZeroTier { /** * Static array -- a simple thing that's belonged in STL since the time of the dinosaurs */ -template +template class Array { public: @@ -44,19 +46,19 @@ public: Array(const Array &a) { - for(std::size_t i=0;i reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; @@ -83,11 +85,11 @@ public: inline const_reverse_iterator rbegin() const throw() { return const_reverse_iterator(begin()); } inline const_reverse_iterator rend() const throw() { return const_reverse_iterator(end()); } - inline std::size_t size() const throw() { return S; } - inline std::size_t max_size() const throw() { return S; } + inline size_t size() const throw() { return S; } + inline size_t max_size() const throw() { return S; } - inline reference operator[](const std::size_t n) throw() { return data[n]; } - inline const_reference operator[](const std::size_t n) const throw() { return data[n]; } + inline reference operator[](const size_t n) throw() { return data[n]; } + inline const_reference operator[](const size_t n) const throw() { return data[n]; } inline reference front() throw() { return data[0]; } inline const_reference front() const throw() { return data[0]; } diff --git a/node/InetAddress.cpp b/node/InetAddress.cpp index 832acf04c..5e36be0d5 100644 --- a/node/InetAddress.cpp +++ b/node/InetAddress.cpp @@ -137,7 +137,7 @@ std::string InetAddress::toString() const void InetAddress::fromString(const std::string &ipSlashPort) { - std::size_t slashAt = ipSlashPort.find('/'); + size_t slashAt = ipSlashPort.find('/'); if ((slashAt == std::string::npos)||(slashAt >= ipSlashPort.length())) set(ipSlashPort,0); else { From 52280c7a636e65e7bc120e47a93f7e67dcd8aa4e Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Mon, 9 Feb 2015 10:31:06 +0100 Subject: [PATCH 3/3] remove unused include --- node/Packet.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/node/Packet.hpp b/node/Packet.hpp index 35cc5c7d2..a0647078e 100644 --- a/node/Packet.hpp +++ b/node/Packet.hpp @@ -33,7 +33,6 @@ #include #include -#include #include "Constants.hpp"