all repos — mgba @ fa73d25acb0b20636bd0adbe3611b528cc1f954f

mGBA Game Boy Advance Emulator

Merge branch 'master' into feature/input-revamp
Vicki Pfau vi@endrift.com
Sat, 03 Jun 2017 17:52:22 -0700
commit

fa73d25acb0b20636bd0adbe3611b528cc1f954f

parent

c784fad04a7c21dfd389c1d82e8e081a347acf51

2 files changed, 4 insertions(+), 7 deletions(-)

jump to
M src/platform/qt/library/LibraryTree.cppsrc/platform/qt/library/LibraryTree.cpp

@@ -147,15 +147,12 @@

LibraryEntryRef currentGame = selectedEntry(); int count = m_widget->topLevelItemCount(); - for (int a = 0; a < count; a++) { - m_widget->takeTopLevelItem(0); + for (int a = count - 1; a >= 0; --a) { + m_widget->takeTopLevelItem(a); } for (QTreeWidgetItem* i : m_pathNodes.values()) { - count = i->childCount(); - for (int a = 0; a < count; a++) { - i->takeChild(0); - } + i->takeChildren(); } if (m_currentStyle == LibraryStyle::STYLE_TREE) {
M src/util/circle-buffer.csrc/util/circle-buffer.c

@@ -127,7 +127,7 @@ }

size_t CircleBufferWrite(struct CircleBuffer* buffer, const void* input, size_t length) { int8_t* data = buffer->writePtr; - if (buffer->size + sizeof(int16_t) > buffer->capacity) { + if (buffer->size + length > buffer->capacity) { return 0; } size_t remaining = buffer->capacity - ((int8_t*) data - (int8_t*) buffer->data);