1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

intptr-ization

This commit is contained in:
Brian Fiete 2021-11-14 18:02:26 -08:00
parent f9b4526934
commit 8d29a35947

View file

@ -9,7 +9,7 @@ class Span
{ {
public: public:
T* mVals; T* mVals;
int mSize; intptr mSize;
public: public:
struct Iterator struct Iterator
@ -50,13 +50,13 @@ public:
} }
Span(T* mPtr, int size) Span(T* mPtr, intptr size)
{ {
mSize = (int)refVec.size(); mVals = mPtr;
mVals = NULL; mSize = size;
} }
T& operator[](int idx) const T& operator[](intptr idx) const
{ {
return mVals[idx]; return mVals[idx];
} }
@ -76,7 +76,7 @@ public:
return mVals[mSize - 1]; return mVals[mSize - 1];
} }
int size() const intptr size() const
{ {
return mSize; return mSize;
} }
@ -91,7 +91,7 @@ public:
return mSize == 0; return mSize == 0;
} }
T Get(int idx) T Get(intptr idx)
{ {
if ((idx < 0) || (idx >= mSize)) if ((idx < 0) || (idx >= mSize))
return (T)0; return (T)0;
@ -99,7 +99,7 @@ public:
} }
template <typename T2> template <typename T2>
T2 GetAs(int idx) T2 GetAs(intptr idx)
{ {
if ((idx < 0) || (idx >= mSize)) if ((idx < 0) || (idx >= mSize))
return (T2)0; return (T2)0;
@ -120,7 +120,7 @@ public:
return mVals[0]; return mVals[0];
} }
void SetSize(int size) void SetSize(intptr size)
{ {
BF_ASSERT(size <= mSize); BF_ASSERT(size <= mSize);
mSize = size; mSize = size;