From b78c729880705c1bf28f266b087046c4eaed8317 Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 10 Mar 2014 11:56:23 -0700 Subject: Fixed Alignment issue in ByteBuffer --- src/StringUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/StringUtils.h') diff --git a/src/StringUtils.h b/src/StringUtils.h index dfbfc2a75..b64108409 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -58,7 +58,7 @@ extern unsigned int RateCompareString(const AString & s1, const AString & s2 ); extern void ReplaceString(AString & iHayStack, const AString & iNeedle, const AString & iReplaceWith); // tolua_export /// Converts a stream of BE shorts into UTF-8 string; returns a ref to a_UTF8 -extern AString & RawBEToUTF8(short * a_RawData, int a_NumShorts, AString & a_UTF8); +extern AString & RawBEToUTF8(const char * a_RawData, int a_NumShorts, AString & a_UTF8); /// Converts a UTF-8 string into a UTF-16 BE string, packing that back into AString; return a ref to a_UTF16 extern AString & UTF8ToRawBEUTF16(const char * a_UTF8, size_t a_UTF8Length, AString & a_UTF16); -- cgit v1.2.3 From 53faac10c50ba88ce540e0464123f388bd7db069 Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 11 Mar 2014 13:41:15 -0700 Subject: Added macros to follow format string checking through wrappers --- src/StringUtils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/StringUtils.h') diff --git a/src/StringUtils.h b/src/StringUtils.h index b64108409..a7f22b100 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -22,13 +22,13 @@ typedef std::list AStringList; /** Add the formated string to the existing data in the string */ -extern AString & AppendVPrintf(AString & str, const char * format, va_list args); +extern AString & AppendVPrintf(AString & str, const char * format, va_list args) FORMATSTRING(2,0); /// Output the formatted text into the string -extern AString & Printf (AString & str, const char * format, ...); +extern AString & Printf (AString & str, const char * format, ...) FORMATSTRING(2,3); /// Output the formatted text into string, return string by value -extern AString Printf(const char * format, ...); +extern AString Printf(const char * format, ...) FORMATSTRING(1,2); /// Add the formatted string to the existing data in the string extern AString & AppendPrintf (AString & str, const char * format, ...); -- cgit v1.2.3 From 7e6ee7ef8158a037c11405986513aa344ce68f42 Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 11 Mar 2014 14:43:14 -0700 Subject: Fixed more Format issues --- src/StringUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/StringUtils.h') diff --git a/src/StringUtils.h b/src/StringUtils.h index a7f22b100..728ce31e6 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -31,7 +31,7 @@ extern AString & Printf (AString & str, const char * format, ...) FORMATST extern AString Printf(const char * format, ...) FORMATSTRING(1,2); /// Add the formatted string to the existing data in the string -extern AString & AppendPrintf (AString & str, const char * format, ...); +extern AString & AppendPrintf (AString & str, const char * format, ...) FORMATSTRING(2,3); /// Split the string at any of the listed delimiters, return as a stringvector extern AStringVector StringSplit(const AString & str, const AString & delim); -- cgit v1.2.3 From cd6ab5617cd7b26b13cfe26a950ca17fecefd550 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 14 Mar 2014 06:11:49 -0700 Subject: Fixed xofts issues --- src/StringUtils.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/StringUtils.h') diff --git a/src/StringUtils.h b/src/StringUtils.h index 728ce31e6..4feff7553 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -22,16 +22,16 @@ typedef std::list AStringList; /** Add the formated string to the existing data in the string */ -extern AString & AppendVPrintf(AString & str, const char * format, va_list args) FORMATSTRING(2,0); +extern AString & AppendVPrintf(AString & str, const char * format, va_list args) FORMATSTRING(2, 0); /// Output the formatted text into the string -extern AString & Printf (AString & str, const char * format, ...) FORMATSTRING(2,3); +extern AString & Printf (AString & str, const char * format, ...) FORMATSTRING(2, 3); /// Output the formatted text into string, return string by value -extern AString Printf(const char * format, ...) FORMATSTRING(1,2); +extern AString Printf(const char * format, ...) FORMATSTRING(1, 2); /// Add the formatted string to the existing data in the string -extern AString & AppendPrintf (AString & str, const char * format, ...) FORMATSTRING(2,3); +extern AString & AppendPrintf (AString & str, const char * format, ...) FORMATSTRING(2, 3); /// Split the string at any of the listed delimiters, return as a stringvector extern AStringVector StringSplit(const AString & str, const AString & delim); -- cgit v1.2.3 From bcf5021feb3bbb8069b80e3b892f0c80db35a4c6 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 1 Apr 2014 22:47:39 +0200 Subject: Exported the Base64 encoding and decoding functions to Lua API. --- src/StringUtils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/StringUtils.h') diff --git a/src/StringUtils.h b/src/StringUtils.h index 4feff7553..da395e5b5 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -79,10 +79,10 @@ extern AString URLDecode(const AString & a_String); // Cannot export to Lua aut extern AString ReplaceAllCharOccurrences(const AString & a_String, char a_From, char a_To); // Needn't export to Lua, since Lua doesn't have chars anyway /// Decodes a Base64-encoded string into the raw data -extern AString Base64Decode(const AString & a_Base64String); +extern AString Base64Decode(const AString & a_Base64String); // Exported manually due to embedded NULs and extra parameter /// Encodes a string into Base64 -extern AString Base64Encode(const AString & a_Input); +extern AString Base64Encode(const AString & a_Input); // Exported manually due to embedded NULs and extra parameter /// Reads two bytes from the specified memory location and interprets them as BigEndian short extern short GetBEShort(const char * a_Mem); -- cgit v1.2.3 From 5dee19648d8b3b068698fd1c9cb62e9038bf0e2c Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 4 Apr 2014 10:31:50 +0200 Subject: More Clang warning fixes in the protocols. --- src/StringUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/StringUtils.h') diff --git a/src/StringUtils.h b/src/StringUtils.h index da395e5b5..ce24e89bc 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -64,7 +64,7 @@ extern AString & RawBEToUTF8(const char * a_RawData, int a_NumShorts, AString & extern AString & UTF8ToRawBEUTF16(const char * a_UTF8, size_t a_UTF8Length, AString & a_UTF16); /// Creates a nicely formatted HEX dump of the given memory block. Max a_BytesPerLine is 120 -extern AString & CreateHexDump(AString & a_Out, const void * a_Data, int a_Size, int a_BytesPerLine); +extern AString & CreateHexDump(AString & a_Out, const void * a_Data, size_t a_Size, int a_BytesPerLine); /// Returns a copy of a_Message with all quotes and backslashes escaped by a backslash extern AString EscapeString(const AString & a_Message); // tolua_export -- cgit v1.2.3 From e1f75ab6d0862d77bf91b588d54acf63fdf20c63 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 4 Apr 2014 10:42:17 +0200 Subject: Fixed CreateHexDump's signedness. --- src/StringUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/StringUtils.h') diff --git a/src/StringUtils.h b/src/StringUtils.h index ce24e89bc..b69e47d3c 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -64,7 +64,7 @@ extern AString & RawBEToUTF8(const char * a_RawData, int a_NumShorts, AString & extern AString & UTF8ToRawBEUTF16(const char * a_UTF8, size_t a_UTF8Length, AString & a_UTF16); /// Creates a nicely formatted HEX dump of the given memory block. Max a_BytesPerLine is 120 -extern AString & CreateHexDump(AString & a_Out, const void * a_Data, size_t a_Size, int a_BytesPerLine); +extern AString & CreateHexDump(AString & a_Out, const void * a_Data, size_t a_Size, size_t a_BytesPerLine); /// Returns a copy of a_Message with all quotes and backslashes escaped by a backslash extern AString EscapeString(const AString & a_Message); // tolua_export -- cgit v1.2.3