diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/base64.cpp | 2 | ||||
-rw-r--r-- | src/utils/strprintf.cpp | 1 | ||||
-rw-r--r-- | src/utils/tostring.h | 15 | ||||
-rw-r--r-- | src/utils/xml.cpp | 2 |
4 files changed, 19 insertions, 1 deletions
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp index 8cea60f9..9d8ba836 100644 --- a/src/utils/base64.cpp +++ b/src/utils/base64.cpp @@ -27,8 +27,8 @@ +----------------------------------------------------------------------+ */ -#include <string.h> #include <stdlib.h> +#include <string.h> #include "base64.h" diff --git a/src/utils/strprintf.cpp b/src/utils/strprintf.cpp index bed4a7c4..07fb3508 100644 --- a/src/utils/strprintf.cpp +++ b/src/utils/strprintf.cpp @@ -45,3 +45,4 @@ std::string strprintf(char const *format, ...) delete [] buf2; return res; } + diff --git a/src/utils/tostring.h b/src/utils/tostring.h index 5ac1d3aa..62eb44e4 100644 --- a/src/utils/tostring.h +++ b/src/utils/tostring.h @@ -32,4 +32,19 @@ std::string toString(const T &arg) return ss.str(); } +// TODO: Is there a good way to suppress warnings from classes which don't use +// this function? +inline char *iptostring(int address) +{ + static char asciiIP[16]; + + sprintf(asciiIP, "%i.%i.%i.%i", + (unsigned char)(address), + (unsigned char)(address >> 8), + (unsigned char)(address >> 16), + (unsigned char)(address >> 24)); + + return asciiIP; +} + #endif diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index f6498c9f..d5dd54be 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -20,7 +20,9 @@ */ #include "xml.h" + #include "../log.h" + #include "../resources/resourcemanager.h" namespace XML |