Skip to content

Commit 37630da

Browse files
Add this-> where needed to appease permissive-
In some inheritance structures (access of a protected member of a public base of a public base, for instance), permissive- mode has a requirement that the variable is referenced using this->, which we've previously had favorable discussions about anyway as a case where the notation improves readability.
1 parent da92e38 commit 37630da

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

lib/Common/DataStructures/List.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ namespace JsUtil
341341
template <typename TConditionalFunction>
342342
bool Last(TConditionalFunction function, T& outElement)
343343
{
344-
for (int i = count - 1; i >= 0; --i)
344+
for (int i = this->count - 1; i >= 0; --i)
345345
{
346346
if (function(this->buffer[i]))
347347
{
@@ -420,7 +420,7 @@ namespace JsUtil
420420
JsUtil::ExternalApi::RaiseOnIntOverflow();
421421
}
422422

423-
js_memcpy_s(buffer + this->count, availableByteSpace, items, givenBufferSize);
423+
js_memcpy_s(this->buffer + this->count, availableByteSpace, items, givenBufferSize);
424424
this->count = requiredSize;
425425

426426
return requiredSize; //Returns count

lib/Common/Memory/AutoAllocatorObjectPtr.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ class AutoAllocatorArrayPtr : public BasePtr<T>
6161
private:
6262
void Clear()
6363
{
64-
if (ptr != nullptr)
64+
if (this->ptr != nullptr)
6565
{
66-
DeleteArray<TAllocator>(m_allocator, m_elementCount, ptr);
67-
ptr = nullptr;
66+
DeleteArray<TAllocator>(m_allocator, this->m_elementCount, this->ptr);
67+
this->ptr = nullptr;
6868
}
6969
}
7070
};
@@ -98,14 +98,14 @@ class AutoAllocatorObjectArrayPtr : public AutoAllocatorArrayPtr<T*, ArrayAlloca
9898
private:
9999
void Clear()
100100
{
101-
if (ptr != nullptr)
101+
if (this->ptr != nullptr)
102102
{
103-
for (size_t i = 0; i < m_elementCount; i++)
103+
for (size_t i = 0; i < this->m_elementCount; i++)
104104
{
105-
if (ptr[i] != nullptr)
105+
if (this->ptr[i] != nullptr)
106106
{
107-
DeleteObject<TAllocator>(m_allocator, ptr[i]);
108-
ptr[i] = nullptr;
107+
DeleteObject<TAllocator>(this->m_allocator, this->ptr[i]);
108+
this->ptr[i] = nullptr;
109109
}
110110
}
111111
}

lib/Common/Memory/AutoPtr.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@ class AutoArrayAndItemsPtr : public AutoArrayPtr<T>
7676
private:
7777
void Clear()
7878
{
79-
if (ptr != nullptr){
79+
if (this->ptr != nullptr){
8080
for (size_t i = 0; i < this->m_elementCount; i++)
8181
{
82-
if (ptr[i] != nullptr)
82+
if (this->ptr[i] != nullptr)
8383
{
84-
ptr[i]->CleanUp();
85-
ptr[i] = nullptr;
84+
this->ptr[i]->CleanUp();
85+
this->ptr[i] = nullptr;
8686
}
8787
}
8888

89-
HeapDeleteArray(m_elementCount, ptr);
90-
ptr = nullptr;
89+
HeapDeleteArray(this->m_elementCount, this->ptr);
90+
this->ptr = nullptr;
9191
}
9292
}
9393
};

0 commit comments

Comments
 (0)