jgadget debug improvements (#3000)

This commit is contained in:
TakaRikka
2025-12-27 14:24:27 -08:00
committed by GitHub
parent 5fcfa49f3b
commit 4a75dc3736
37 changed files with 1016 additions and 87 deletions
+3 -3
View File
@@ -35,9 +35,9 @@ char* JSUInputStream::read(char* str) {
}
s32 JSUInputStream::skip(s32 count) {
u8 buffer;
s32 skipCount = 0;
for (; skipCount < count; skipCount++) {
s32 skipCount;
for (skipCount = 0; skipCount < count; skipCount++) {
u8 buffer;
if (readData(&buffer, sizeof(buffer)) != sizeof(buffer)) {
setState(IOS_STATE_1);
break;
+8 -12
View File
@@ -23,11 +23,9 @@ JSUPtrList::JSUPtrList(bool init) {
JSUPtrList::~JSUPtrList() {
JSUPtrLink* node = mHead;
s32 removed = 0;
while (mLength > removed) {
for (int i = 0; i < mLength; i++) {
node->mList = NULL;
node = node->getNext();
removed += 1;
node = node->mNext;
}
}
@@ -47,10 +45,9 @@ void JSUPtrList::setFirst(JSUPtrLink* first) {
}
bool JSUPtrList::append(JSUPtrLink* ptr) {
JSUPtrList* list = ptr->mList;
bool result = (NULL == list);
bool result = ptr->mList == NULL;
if (!result) {
result = list->remove(ptr);
result = ptr->mList->remove(ptr);
}
if (result) {
@@ -70,10 +67,9 @@ bool JSUPtrList::append(JSUPtrLink* ptr) {
}
bool JSUPtrList::prepend(JSUPtrLink* ptr) {
JSUPtrList* list = ptr->mList;
bool result = (NULL == list);
bool result = ptr->mList == NULL;
if (!result) {
result = list->remove(ptr);
result = ptr->mList->remove(ptr);
}
if (result) {
@@ -103,7 +99,7 @@ bool JSUPtrList::insert(JSUPtrLink* before, JSUPtrLink* ptr) {
return false;
}
bool result = (NULL == ptr->mList);
bool result = ptr->mList == NULL;
if (!result) {
result = ptr->mList->remove(ptr);
}
@@ -152,7 +148,7 @@ JSUPtrLink* JSUPtrList::getNthLink(u32 index) const {
JSUPtrLink* node = mHead;
for (u32 i = 0; i < index; i++) {
node = node->getNext();
node = node->mNext;
}
return node;