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/int-set.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'source/core/int-set.h') diff --git a/source/core/int-set.h b/source/core/int-set.h index a56a58d64..6b6f5e7a8 100644 --- a/source/core/int-set.h +++ b/source/core/int-set.h @@ -46,7 +46,7 @@ namespace Slang { SetMax(maxVal); } - int Size() const + UInt Size() const { return buffer.Count()*32; } @@ -57,40 +57,40 @@ namespace Slang } void SetAll() { - for (int i = 0; i>5); if (buffer.Count() > oldBufferSize) memset(buffer.Buffer()+oldBufferSize, 0, (buffer.Count()-oldBufferSize) * sizeof(int)); } void Clear() { - for (int i = 0; i>5; + UInt id = val>>5; if (id < buffer.Count()) buffer[id] |= (1<<(val&31)); else { - int oldSize = buffer.Count(); + UInt oldSize = buffer.Count(); buffer.SetSize(id+1); memset(buffer.Buffer() + oldSize, 0, (buffer.Count()-oldSize)*sizeof(int)); buffer[id] |= (1<<(val&31)); } } - void Remove(int val) + void Remove(UInt val) { if ((val>>5) < buffer.Count()) buffer[(val>>5)] &= ~(1<<(val&31)); } - bool Contains(int val) const + bool Contains(UInt val) const { if ((val>>5) >= buffer.Count()) return false; @@ -98,7 +98,7 @@ namespace Slang } void UnionWith(const IntSet & set) { - for (int i = 0; i