From c2efba6907fab934a04959b9bb644cf7141cc955 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sat, 1 Jul 2023 23:04:04 +0100 Subject: matched T2DLL as well as i can --- src/T2DLL/T2RequestArrayList.cpp | 84 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'src/T2DLL/T2RequestArrayList.cpp') diff --git a/src/T2DLL/T2RequestArrayList.cpp b/src/T2DLL/T2RequestArrayList.cpp index 0b5acbb..8fac11a 100644 --- a/src/T2DLL/T2RequestArrayList.cpp +++ b/src/T2DLL/T2RequestArrayList.cpp @@ -11,36 +11,36 @@ T2RequestArrayList::T2RequestArrayList() /*virtual*/ T2RequestArrayList::~T2RequestArrayList() { LArrayIterator iterator(*this); - T2RequestArray *requestArray; + T2RequestArray *theRequestArray; - while (iterator.Next(&requestArray)) - delete requestArray; + while (iterator.Next(&theRequestArray)) + delete theRequestArray; } -void T2RequestArrayList::Add(T2RequestArray* requestArray) { - InsertItemsAt(1, mItemCount + 1, &requestArray); +void T2RequestArrayList::Add(T2RequestArray* inRequestArray) { + InsertItemsAt(1, mItemCount + 1, &inRequestArray); } unsigned int T2RequestArrayList::GetItemCount() { return GetCount(); } -T2RequestArray* T2RequestArrayList::GetItemAt(int index) { - T2RequestArray *requestArray; - if (FetchItemAt(index, &requestArray)) - return requestArray; +T2RequestArray* T2RequestArrayList::GetItemAt(int inIndex) { + T2RequestArray *theRequestArray; + if (FetchItemAt(inIndex, &theRequestArray)) + return theRequestArray; else return NULL; } -T2Request* T2RequestArrayList::GetRequestByID(unsigned int requestID) { - if (requestID == 0) +T2Request* T2RequestArrayList::GetRequestByID(unsigned int inRequestID) { + if (inRequestID == 0) return NULL; - if (requestID < 1000) + if (inRequestID < 1000) return NULL; - int group = (requestID - 1000) / 64; - int indexInGroup = (requestID - 1000) % 64; + int group = (inRequestID - 1000) / 64; + int indexInGroup = (inRequestID - 1000) % 64; T2RequestArray *requestArray = GetItemAt(group + 1); if (requestArray) return requestArray->GetIndexRequest(indexInGroup); @@ -49,67 +49,67 @@ T2Request* T2RequestArrayList::GetRequestByID(unsigned int requestID) { } T2Request* T2RequestArrayList::FindUnusedRequest() { - T2Request *result = NULL; + T2Request *theRequest = NULL; LArrayIterator iterator(*this); - T2RequestArray *requestArray = NULL; + T2RequestArray *theRequestArray = NULL; - while (!result && iterator.Next(&requestArray)) { - result = requestArray->FindUnusedRequest(); + while (!theRequest && iterator.Next(&theRequestArray)) { + theRequest = theRequestArray->FindUnusedRequest(); } - if (!result) { + if (!theRequest) { unsigned int newStartID = 1000; - if (requestArray) - newStartID = requestArray->GetStartID() + 64; + if (theRequestArray) + newStartID = theRequestArray->GetStartID() + 64; - requestArray = new T2RequestArray(newStartID); - if (requestArray) { - Add(requestArray); - result = requestArray->FindUnusedRequest(); + theRequestArray = new T2RequestArray(newStartID); + if (theRequestArray) { + Add(theRequestArray); + theRequest = theRequestArray->FindUnusedRequest(); } } - return result; + return theRequest; } -void T2RequestArrayList::BreakoutEmergency(T2TowerDoc* towerDoc) { +void T2RequestArrayList::BreakoutEmergency(T2TowerDoc* inDoc) { LArrayIterator iterator(*this); T2RequestArray *requestArray; while (iterator.Next(&requestArray)) - requestArray->BreakoutEmergency(towerDoc); + requestArray->BreakoutEmergency(inDoc); } -void T2RequestArrayList::Read(T2Archive& archive, T2TowerDoc* towerDoc) { +void T2RequestArrayList::Read(T2Archive& inArchive, T2TowerDoc* inDoc) { int count; - archive >> count; + inArchive >> count; RemoveItemsAt(GetCount(), 1); unsigned int startID = 1000; for (int i = 0; i < count; i++) { - T2RequestArray *requestArray = new T2RequestArray(startID); - requestArray->Read(archive, towerDoc); - Add(requestArray); + T2RequestArray *theRequestArray = new T2RequestArray(startID); + theRequestArray->Read(inArchive, inDoc); + Add(theRequestArray); startID += 64; } } -void T2RequestArrayList::Write(T2Archive& archive) { +void T2RequestArrayList::Write(T2Archive& inArchive) { int count = GetItemCount(); - archive << count; + inArchive << count; LArrayIterator iterator(*this); - T2RequestArray *requestArray; + T2RequestArray *theRequestArray; - while (iterator.Next(&requestArray)) - requestArray->Write(archive); + while (iterator.Next(&theRequestArray)) + theRequestArray->Write(inArchive); } -void T2RequestArrayList::DispatchIdle(T2TowerDoc* towerDoc) { +void T2RequestArrayList::DispatchIdle(T2TowerDoc* inDoc) { LArrayIterator iterator(*this); - T2RequestArray *requestArray; + T2RequestArray *theRequestArray; - while (iterator.Next(&requestArray)) - requestArray->DispatchIdle(towerDoc, 0); + while (iterator.Next(&theRequestArray)) + theRequestArray->DispatchIdle(inDoc, 0); } -- cgit v1.2.3