From 03de737f0d18526b99b59a1810c7e290b66f4be2 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 6 Jul 2017 11:11:01 -0700 Subject: Fix many warnings-as-errors issues. The code should now compile cleanly with warnings as errors for VS2015 with `W3`. Most of the changes had to do with propagating a real pointer-sized integer type through code that had been using `int`. --- source/core/slang-string.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/core/slang-string.h') diff --git a/source/core/slang-string.h b/source/core/slang-string.h index 8294d4bc3..ba68e405e 100644 --- a/source/core/slang-string.h +++ b/source/core/slang-string.h @@ -452,7 +452,7 @@ namespace Slang return getData(); } - OSString ToWString(int* len = 0) const; + OSString ToWString(UInt* len = 0) const; bool Equals(const String & str, bool caseSensitive = true) { @@ -636,13 +636,13 @@ namespace Slang class StringBuilder : public String { private: - static const int InitialSize = 1024; + enum { InitialSize = 1024 }; public: - explicit StringBuilder(int bufferSize = InitialSize) + explicit StringBuilder(UInt bufferSize = InitialSize) { ensureUniqueStorageWithCapacity(bufferSize); } - void EnsureCapacity(int size) + void EnsureCapacity(UInt size) { ensureUniqueStorageWithCapacity(size); } @@ -678,7 +678,7 @@ namespace Slang } StringBuilder & operator << (const char * str) { - Append(str, (int)strlen(str)); + Append(str, strlen(str)); return *this; } StringBuilder & operator << (const String & str) @@ -736,9 +736,9 @@ namespace Slang } void Append(const char * str) { - Append(str, (int)strlen(str)); + Append(str, strlen(str)); } - void Append(const char * str, int strLen) + void Append(const char * str, UInt strLen) { append(str, str + strLen); } -- cgit v1.2.3