diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-07-01 23:04:04 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-07-01 23:04:04 +0100 |
commit | c2efba6907fab934a04959b9bb644cf7141cc955 (patch) | |
tree | c047244f99870e44a7a5d7e733c2857434c03765 /src/T2DLL/T2PeoplePtrList.cpp | |
parent | 1eb8da84d77d0c865623421069ec38bfc7b0d461 (diff) | |
download | t2win-c2efba6907fab934a04959b9bb644cf7141cc955.tar.gz t2win-c2efba6907fab934a04959b9bb644cf7141cc955.zip |
matched T2DLL as well as i can
Diffstat (limited to 'src/T2DLL/T2PeoplePtrList.cpp')
-rw-r--r-- | src/T2DLL/T2PeoplePtrList.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/T2DLL/T2PeoplePtrList.cpp b/src/T2DLL/T2PeoplePtrList.cpp index 315d664..40e1f22 100644 --- a/src/T2DLL/T2PeoplePtrList.cpp +++ b/src/T2DLL/T2PeoplePtrList.cpp @@ -15,22 +15,22 @@ T2PeoplePtrList::T2PeoplePtrList(int count) void T2PeoplePtrList::Init(unsigned int count) { if (count > 0) { AdjustAllocation(count); - T2People *zero = NULL; - InsertItemsAt(count, 1, &zero); + T2People *nullPeople = NULL; + InsertItemsAt(count, 1, &nullPeople); } } BOOL T2PeoplePtrList::Add(T2People* people) { - BOOL result = false; - T2People *zero = NULL; + BOOL done = false; + T2People *nullPeople = NULL; - int index; - if (GetPeopleIndex(zero, index)) { - AssignItemsAt(1, index, &people); - result = true; + int theIndex; + if (GetPeopleIndex(nullPeople, theIndex)) { + AssignItemsAt(1, theIndex, &people); + done = true; } - return result; + return done; } T2People* T2PeoplePtrList::GetItemAt(int index) const { @@ -53,21 +53,21 @@ BOOL T2PeoplePtrList::GetPeopleIndex(T2People* people, int& outIndex) const { } BOOL T2PeoplePtrList::HasSpace() const { - int index; - T2People *zero = NULL; - return GetPeopleIndex(zero, index); + int theIndex; + T2People *nullPeople = NULL; + return GetPeopleIndex(nullPeople, theIndex); } void T2PeoplePtrList::Clear() { - T2People *zero = NULL; - AssignItemsAt(mItemCount, 1, &zero); + T2People *nullPeople = NULL; + AssignItemsAt(mItemCount, 1, &nullPeople); } void T2PeoplePtrList::Clear(T2People* people) { - int index; - if (GetPeopleIndex(people, index)) { - T2People *zero = NULL; - AssignItemsAt(1, index, &zero); + int theIndex; + if (GetPeopleIndex(people, theIndex)) { + T2People *nullPeople = NULL; + AssignItemsAt(1, theIndex, &nullPeople); } } @@ -122,27 +122,27 @@ void T2PeoplePtrList::IncEstimate(int value) { } BOOL T2PeoplePtrList::InSameTenant(unsigned int tenantID) const { - BOOL result = true; + BOOL inSameTenant = true; LArrayIterator iterator(*this); - T2People *people; + T2People *thePeople; - while (result && iterator.Next(&people)) { - if (people && people->GetCurTenantID() != tenantID) - result = false; + while (inSameTenant && iterator.Next(&thePeople)) { + if (thePeople && thePeople->GetCurTenantID() != tenantID) + inSameTenant = false; } - return result; + return inSameTenant; } void T2PeoplePtrList::LoadSelf(T2Archive& archive, T2PeopleArrayList* list) { - int count; - archive >> count; - Init(count); + int numPeople; + archive >> numPeople; + Init(numPeople); - for (unsigned int i = 0; i < count; i++) { + for (unsigned int i = 0; i < numPeople; i++) { unsigned int peopleID; archive >> peopleID; - if (peopleID) + if (list) Add(list->FindPeople(peopleID)); } } |