From 8d29a35947bb8ed28e3f51a7bbaa4c1f23210e0e Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sun, 14 Nov 2021 18:02:26 -0800 Subject: [PATCH] intptr-ization --- BeefySysLib/Span.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/BeefySysLib/Span.h b/BeefySysLib/Span.h index a09388aa..ec381cf7 100644 --- a/BeefySysLib/Span.h +++ b/BeefySysLib/Span.h @@ -9,7 +9,7 @@ class Span { public: T* mVals; - int mSize; + intptr mSize; public: struct Iterator @@ -50,13 +50,13 @@ public: } - Span(T* mPtr, int size) + Span(T* mPtr, intptr size) { - mSize = (int)refVec.size(); - mVals = NULL; + mVals = mPtr; + mSize = size; } - T& operator[](int idx) const + T& operator[](intptr idx) const { return mVals[idx]; } @@ -76,7 +76,7 @@ public: return mVals[mSize - 1]; } - int size() const + intptr size() const { return mSize; } @@ -91,7 +91,7 @@ public: return mSize == 0; } - T Get(int idx) + T Get(intptr idx) { if ((idx < 0) || (idx >= mSize)) return (T)0; @@ -99,7 +99,7 @@ public: } template - T2 GetAs(int idx) + T2 GetAs(intptr idx) { if ((idx < 0) || (idx >= mSize)) return (T2)0; @@ -120,7 +120,7 @@ public: return mVals[0]; } - void SetSize(int size) + void SetSize(intptr size) { BF_ASSERT(size <= mSize); mSize = size;