All: Fix whitespace errors

This commit is contained in:
Vicki Pfau 2024-09-30 17:24:04 -07:00
parent 8941f74292
commit bfc52cd2f0
46 changed files with 86 additions and 86 deletions

View File

@ -11,15 +11,15 @@
CXX_GUARD_START CXX_GUARD_START
struct mSize { struct mSize {
int width; int width;
int height; int height;
}; };
struct mRectangle { struct mRectangle {
int x; int x;
int y; int y;
int width; int width;
int height; int height;
}; };
void mRectangleUnion(struct mRectangle* dst, const struct mRectangle* add); void mRectangleUnion(struct mRectangle* dst, const struct mRectangle* add);

View File

@ -57,7 +57,7 @@ struct mVideoBackendCommand {
struct mVideoProxyBackend { struct mVideoProxyBackend {
struct VideoBackend d; struct VideoBackend d;
struct VideoBackend* backend; struct VideoBackend* backend;
struct RingFIFO in; struct RingFIFO in;
struct RingFIFO out; struct RingFIFO out;

View File

@ -9,23 +9,23 @@
#define mSAVEDATA_CLEANUP_THRESHOLD 15 #define mSAVEDATA_CLEANUP_THRESHOLD 15
enum { enum {
mSAVEDATA_DIRT_NONE = 0, mSAVEDATA_DIRT_NONE = 0,
mSAVEDATA_DIRT_NEW = 1, mSAVEDATA_DIRT_NEW = 1,
mSAVEDATA_DIRT_SEEN = 2, mSAVEDATA_DIRT_SEEN = 2,
}; };
static inline bool mSavedataClean(int* dirty, uint32_t* dirtAge, uint32_t frameCount) { static inline bool mSavedataClean(int* dirty, uint32_t* dirtAge, uint32_t frameCount) {
if (*dirty & mSAVEDATA_DIRT_NEW) { if (*dirty & mSAVEDATA_DIRT_NEW) {
*dirtAge = frameCount; *dirtAge = frameCount;
*dirty &= ~mSAVEDATA_DIRT_NEW; *dirty &= ~mSAVEDATA_DIRT_NEW;
if (!(*dirty & mSAVEDATA_DIRT_SEEN)) { if (!(*dirty & mSAVEDATA_DIRT_SEEN)) {
*dirty |= mSAVEDATA_DIRT_SEEN; *dirty |= mSAVEDATA_DIRT_SEEN;
} }
} else if ((*dirty & mSAVEDATA_DIRT_SEEN) && frameCount - *dirtAge > mSAVEDATA_CLEANUP_THRESHOLD) { } else if ((*dirty & mSAVEDATA_DIRT_SEEN) && frameCount - *dirtAge > mSAVEDATA_CLEANUP_THRESHOLD) {
*dirty = 0; *dirty = 0;
return true; return true;
} }
return false; return false;
} }
#endif #endif

View File

@ -88,7 +88,7 @@ DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(LSR1,
} }
THUMB_NEUTRAL_S( , , cpu->gprs[rd]);) THUMB_NEUTRAL_S( , , cpu->gprs[rd]);)
DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(ASR1, DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(ASR1,
if (!immediate) { if (!immediate) {
cpu->cpsr.c = ARM_SIGN(cpu->gprs[rm]); cpu->cpsr.c = ARM_SIGN(cpu->gprs[rm]);
if (cpu->cpsr.c) { if (cpu->cpsr.c) {

View File

@ -37,7 +37,7 @@ static uint32_t _patchMakeKey(struct mCheatPatch* patch) {
patchKey >>= 2; patchKey >>= 2;
break; break;
default: default:
break; break;
} }
// TODO: More than one segment // TODO: More than one segment
if (patch->segment > 0) { if (patch->segment > 0) {

View File

@ -656,7 +656,7 @@ void mCoreThreadContinue(struct mCoreThread* threadContext) {
if (threadContext->impl->requested) { if (threadContext->impl->requested) {
threadContext->impl->state = mTHREAD_REQUEST; threadContext->impl->state = mTHREAD_REQUEST;
} else { } else {
threadContext->impl->state = mTHREAD_RUNNING; threadContext->impl->state = mTHREAD_RUNNING;
} }
ConditionWake(&threadContext->impl->stateOnThreadCond); ConditionWake(&threadContext->impl->stateOnThreadCond);
} }

View File

@ -71,7 +71,7 @@ bool FFmpegDecoderOpen(struct FFmpegDecoder* decoder, const char* infile) {
codec = avcodec_find_decoder(context->codec_id); codec = avcodec_find_decoder(context->codec_id);
if (!codec) { if (!codec) {
FFmpegDecoderClose(decoder); FFmpegDecoderClose(decoder);
return false; return false;
} }
if (avcodec_open2(context, codec, NULL) < 0) { if (avcodec_open2(context, codec, NULL) < 0) {
FFmpegDecoderClose(decoder); FFmpegDecoderClose(decoder);

View File

@ -893,7 +893,7 @@ void FFmpegEncoderSetInputFrameRate(struct FFmpegEncoder* encoder, int numerator
void FFmpegEncoderSetInputSampleRate(struct FFmpegEncoder* encoder, int sampleRate) { void FFmpegEncoderSetInputSampleRate(struct FFmpegEncoder* encoder, int sampleRate) {
encoder->isampleRate = sampleRate; encoder->isampleRate = sampleRate;
if (encoder->resampleContext) { if (encoder->resampleContext) {
av_freep(&encoder->audioBuffer); av_freep(&encoder->audioBuffer);
#ifdef USE_LIBAVRESAMPLE #ifdef USE_LIBAVRESAMPLE
avresample_close(encoder->resampleContext); avresample_close(encoder->resampleContext);

View File

@ -295,7 +295,7 @@ void mGUIShowConfig(struct mGUIRunner* runner, struct GUIMenuItem* extra, size_t
test.v.s = mCoreConfigGetValue(&runner->config, item->data.v.s); test.v.s = mCoreConfigGetValue(&runner->config, item->data.v.s);
if (test.v.s && strcmp(test.v.s, v->v.s) == 0) { if (test.v.s && strcmp(test.v.s, v->v.s) == 0) {
item->state = j; item->state = j;
break; break;
} }
break; break;
case GUI_VARIANT_POINTER: case GUI_VARIANT_POINTER:

View File

@ -46,7 +46,7 @@ static void _updateList(const char* key, const char* value, void* user) {
if (strncmp("medusa.", key, 7) == 0) { if (strncmp("medusa.", key, 7) == 0) {
dotLoc = strchr(&key[7], '.'); dotLoc = strchr(&key[7], '.');
} else { } else {
dotLoc = strchr(key, '.'); dotLoc = strchr(key, '.');
} }
if (!dotLoc) { if (!dotLoc) {
return; return;

View File

@ -339,17 +339,17 @@ bool mVideoLoggerRendererRunInjected(struct mVideoLogger* logger) {
channel->injecting = true; channel->injecting = true;
bool res = mVideoLoggerRendererRun(logger, false); bool res = mVideoLoggerRendererRun(logger, false);
channel->injecting = false; channel->injecting = false;
return res; return res;
} }
void mVideoLoggerInjectionPoint(struct mVideoLogger* logger, enum mVideoLoggerInjectionPoint injectionPoint) { void mVideoLoggerInjectionPoint(struct mVideoLogger* logger, enum mVideoLoggerInjectionPoint injectionPoint) {
struct mVideoLogChannel* channel = logger->dataContext; struct mVideoLogChannel* channel = logger->dataContext;
channel->injectionPoint = injectionPoint; channel->injectionPoint = injectionPoint;
} }
void mVideoLoggerIgnoreAfterInjection(struct mVideoLogger* logger, uint32_t mask) { void mVideoLoggerIgnoreAfterInjection(struct mVideoLogger* logger, uint32_t mask) {
struct mVideoLogChannel* channel = logger->dataContext; struct mVideoLogChannel* channel = logger->dataContext;
channel->ignorePackets = mask; channel->ignorePackets = mask;
} }
static bool _writeData(struct mVideoLogger* logger, const void* data, size_t length) { static bool _writeData(struct mVideoLogger* logger, const void* data, size_t length) {

View File

@ -152,7 +152,7 @@ static bool _GBCoreInit(struct mCore* core) {
#ifdef ENABLE_VFS #ifdef ENABLE_VFS
mDirectorySetInit(&core->dirs); mDirectorySetInit(&core->dirs);
#endif #endif
return true; return true;
} }

View File

@ -267,7 +267,7 @@ void GBVideoProxyRendererDrawRange(struct GBVideoRenderer* renderer, int startX,
_copyExtraState(proxyRenderer); _copyExtraState(proxyRenderer);
proxyRenderer->backend->drawRange(proxyRenderer->backend, startX, endX, y); proxyRenderer->backend->drawRange(proxyRenderer->backend, startX, endX, y);
} }
mVideoLoggerRendererDrawRange(proxyRenderer->logger, startX, endX, y); mVideoLoggerRendererDrawRange(proxyRenderer->logger, startX, endX, y);
} }
void GBVideoProxyRendererFinishScanline(struct GBVideoRenderer* renderer, int y) { void GBVideoProxyRendererFinishScanline(struct GBVideoRenderer* renderer, int y) {

View File

@ -152,7 +152,7 @@ bool GBLoadGBX(struct GBXMetadata* metadata, struct VFile* vf) {
if (memcmp(footer, "MBC1", 4) == 0) { if (memcmp(footer, "MBC1", 4) == 0) {
metadata->mapperVars.u8[0] = 5; metadata->mapperVars.u8[0] = 5;
} else if (memcmp(footer, "MB1M", 4) == 0) { } else if (memcmp(footer, "MB1M", 4) == 0) {
metadata->mapperVars.u8[0] = 4; metadata->mapperVars.u8[0] = 4;
} }
return true; return true;
} }
@ -894,7 +894,7 @@ int GBValidModels(const uint8_t* bank0) {
} else if (cart->cgb == 0xC0) { } else if (cart->cgb == 0xC0) {
models = GB_MODEL_CGB; models = GB_MODEL_CGB;
} else { } else {
models = GB_MODEL_MGB; models = GB_MODEL_MGB;
} }
if (cart->sgb == 0x03 && cart->oldLicensee == 0x33) { if (cart->sgb == 0x03 && cart->oldLicensee == 0x33) {
models |= GB_MODEL_SGB; models |= GB_MODEL_SGB;

View File

@ -163,7 +163,7 @@ static bool _isMulticart(const uint8_t* mem) {
success = GBIsROM(vf); success = GBIsROM(vf);
vf->close(vf); vf->close(vf);
} }
return success; return success;
} }

View File

@ -131,7 +131,7 @@ static void _latchTAMA6Rtc(struct mRTCSource* rtc, struct GBTAMA5State* tama5, t
timerRegs[GBTAMA6_RTC_PA0_HOUR_10] = (diff % 24) / 10; timerRegs[GBTAMA6_RTC_PA0_HOUR_10] = (diff % 24) / 10;
} else { } else {
timerRegs[GBTAMA6_RTC_PA0_HOUR_1] = (diff % 12) % 10; timerRegs[GBTAMA6_RTC_PA0_HOUR_1] = (diff % 12) % 10;
timerRegs[GBTAMA6_RTC_PA0_HOUR_10] = (diff % 12) / 10 + (diff / 12) * 2; timerRegs[GBTAMA6_RTC_PA0_HOUR_10] = (diff % 12) / 10 + (diff / 12) * 2;
} }
t /= 24; t /= 24;
t += diff / 24; t += diff / 24;

View File

@ -349,7 +349,7 @@ void _GBHitek(struct GB* gb, uint16_t address, uint8_t value) {
break; break;
case 0x300: case 0x300:
// See hhugboy src/memory/mbc/MbcUnlHitek.cpp for commentary on this return // See hhugboy src/memory/mbc/MbcUnlHitek.cpp for commentary on this return
return; return;
} }
_GBMBC5(gb, address, value); _GBMBC5(gb, address, value);
} }
@ -396,10 +396,10 @@ uint8_t _GBGGB81Read(struct GBMemory* memory, uint16_t address) {
} }
void _GBLiCheng(struct GB* gb, uint16_t address, uint8_t value) { void _GBLiCheng(struct GB* gb, uint16_t address, uint8_t value) {
if (address > 0x2100 && address < 0x3000) { if (address > 0x2100 && address < 0x3000) {
return; return;
} }
_GBMBC5(gb, address, value); _GBMBC5(gb, address, value);
} }
void _GBSachen(struct GB* gb, uint16_t address, uint8_t value) { void _GBSachen(struct GB* gb, uint16_t address, uint8_t value) {

View File

@ -755,7 +755,7 @@ void GBVideoWriteLCDC(struct GBVideo* video, GBRegisterLCDC value) {
video->ly = 0; video->ly = 0;
video->p->memory.io[GB_REG_LY] = 0; video->p->memory.io[GB_REG_LY] = 0;
video->renderer->writePalette(video->renderer, 0, video->dmgPalette[0]); video->renderer->writePalette(video->renderer, 0, video->dmgPalette[0]);
mTimingDeschedule(&video->p->timing, &video->modeEvent); mTimingDeschedule(&video->p->timing, &video->modeEvent);
mTimingDeschedule(&video->p->timing, &video->frameEvent); mTimingDeschedule(&video->p->timing, &video->frameEvent);
mTimingSchedule(&video->p->timing, &video->frameEvent, GB_VIDEO_TOTAL_LENGTH << 1); mTimingSchedule(&video->p->timing, &video->frameEvent, GB_VIDEO_TOTAL_LENGTH << 1);

View File

@ -324,7 +324,7 @@ void GBAVideoProxyRendererSaveState(struct GBAVideoRenderer* renderer, void** st
proxyRenderer->logger->stateSize = 0; proxyRenderer->logger->stateSize = 0;
} else { } else {
proxyRenderer->backend->saveState(proxyRenderer->backend, state, size); proxyRenderer->backend->saveState(proxyRenderer->backend, state, size);
} }
} }
void GBAVideoProxyRendererWriteVRAM(struct GBAVideoRenderer* renderer, uint32_t address) { void GBAVideoProxyRendererWriteVRAM(struct GBAVideoRenderer* renderer, uint32_t address) {

View File

@ -195,7 +195,7 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) {
if (GBASerializedMiscFlagsIsIrqPending(miscFlags)) { if (GBASerializedMiscFlagsIsIrqPending(miscFlags)) {
int32_t when; int32_t when;
LOAD_32(when, 0, &state->nextIrq); LOAD_32(when, 0, &state->nextIrq);
mTimingSchedule(&gba->timing, &gba->irqEvent, when); mTimingSchedule(&gba->timing, &gba->irqEvent, when);
} }
gba->cpuBlocked = GBASerializedMiscFlagsGetBlocked(miscFlags); gba->cpuBlocked = GBASerializedMiscFlagsGetBlocked(miscFlags);
gba->keysLast = GBASerializedMiscFlagsGetKeyIRQKeys(miscFlags); gba->keysLast = GBASerializedMiscFlagsGetKeyIRQKeys(miscFlags);

View File

@ -160,7 +160,7 @@ void ctrActivateTexture(const C3D_Tex* texture) {
.m = { .m = {
// Rows are in the order w z y x, because ctrulib // Rows are in the order w z y x, because ctrulib
0.0f, 0.0f, 0.0f, 1.0f / activeTexture->width, 0.0f, 0.0f, 0.0f, 1.0f / activeTexture->width,
0.0f, 0.0f, 1.0f / activeTexture->height, 0.0f 0.0f, 0.0f, 1.0f / activeTexture->height, 0.0f
} }
}; };
C3D_FVUnifMtx2x4(GPU_GEOMETRY_SHADER, GSH_FVEC_textureMtx, &textureMtx); C3D_FVUnifMtx2x4(GPU_GEOMETRY_SHADER, GSH_FVEC_textureMtx, &textureMtx);

View File

@ -53,7 +53,7 @@ int main(int argc, char** argv) {
SocketClose(sock); SocketClose(sock);
SocketSubsystemDeinit(); SocketSubsystemDeinit();
didFail = true; didFail = true;
goto cleanup; goto cleanup;
} }
// Run the server // Run the server

View File

@ -253,7 +253,7 @@ static void mGLContextImageSize(struct VideoBackend* v, enum VideoLayer layer, i
*height = context->layerDims[layer].height; *height = context->layerDims[layer].height;
} else { } else {
*width = context->imageSizes[layer].width; *width = context->imageSizes[layer].width;
*height = context->imageSizes[layer].height; *height = context->imageSizes[layer].height;
} }
} }
@ -266,7 +266,7 @@ void mGLContextPostFrame(struct VideoBackend* v, enum VideoLayer layer, const vo
context->activeTex ^= 1; context->activeTex ^= 1;
glBindTexture(GL_TEXTURE_2D, context->tex[context->activeTex]); glBindTexture(GL_TEXTURE_2D, context->tex[context->activeTex]);
} else { } else {
glBindTexture(GL_TEXTURE_2D, context->layers[layer]); glBindTexture(GL_TEXTURE_2D, context->layers[layer]);
} }
int width = context->imageSizes[layer].width; int width = context->imageSizes[layer].width;

View File

@ -529,7 +529,7 @@ static void mGLES2ContextImageSize(struct VideoBackend* v, enum VideoLayer layer
*height = context->layerDims[layer].height; *height = context->layerDims[layer].height;
} else { } else {
*width = context->imageSizes[layer].width; *width = context->imageSizes[layer].width;
*height = context->imageSizes[layer].height; *height = context->imageSizes[layer].height;
} }
} }
@ -617,7 +617,7 @@ void mGLES2ShaderInit(struct mGLES2Shader* shader, const char* vs, const char* f
if (shader->width > 0 && shader->height > 0) { if (shader->width > 0 && shader->height > 0) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, shader->width, shader->height, 0, GL_RGB, GL_UNSIGNED_BYTE, 0); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, shader->width, shader->height, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
} else { } else {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, 0); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
} }
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, shader->tex, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, shader->tex, 0);

View File

@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef PSP2_COMMON_H #ifndef PSP2_COMMON_H
#define PSP2_COMMON_H #define PSP2_COMMON_H
#include <mgba-util/common.h> #include <mgba-util/common.h>
#define PSP2_HORIZONTAL_PIXELS 960 #define PSP2_HORIZONTAL_PIXELS 960

View File

@ -216,7 +216,7 @@ void BattleChipView::loadDeck() {
error->show(); error->show();
return; return;
} }
QList<int> newDeck; QList<int> newDeck;
QStringList deck = ini.value("deck").toString().split(','); QStringList deck = ini.value("deck").toString().split(',');
for (const auto& item : deck) { for (const auto& item : deck) {

View File

@ -130,7 +130,7 @@ private:
mGraphicsOpts m_graphicsOpts{}; mGraphicsOpts m_graphicsOpts{};
std::array<mSubParser, 2> m_subparsers; std::array<mSubParser, 2> m_subparsers;
bool m_parsed = false; bool m_parsed = false;
QHash<QString, QVariant> m_argvOptions; QHash<QString, QVariant> m_argvOptions;
QHash<QString, ConfigOption*> m_optionSet; QHash<QString, ConfigOption*> m_optionSet;
std::unique_ptr<QSettings> m_settings; std::unique_ptr<QSettings> m_settings;

View File

@ -162,7 +162,7 @@ void DebuggerConsoleController::historyLoad() {
if (line.endsWith("\r\n")) { if (line.endsWith("\r\n")) {
line.chop(2); line.chop(2);
} else if (line.endsWith("\n")) { } else if (line.endsWith("\n")) {
line.chop(1); line.chop(1);
} }
history.append(QString::fromUtf8(line)); history.append(QString::fromUtf8(line));
} }

View File

@ -62,7 +62,7 @@ public:
virtual void setVideoProxy(std::shared_ptr<VideoProxy> proxy) { m_videoProxy = std::move(proxy); } virtual void setVideoProxy(std::shared_ptr<VideoProxy> proxy) { m_videoProxy = std::move(proxy); }
std::shared_ptr<VideoProxy> videoProxy() { return m_videoProxy; } std::shared_ptr<VideoProxy> videoProxy() { return m_videoProxy; }
virtual VideoBackend* videoBackend(); virtual VideoBackend* videoBackend();
signals: signals:
void drawingStarted(); void drawingStarted();
void showCursor(); void showCursor();

View File

@ -314,7 +314,7 @@ bool DisplayGL::highestCompatible(QSurfaceFormat& format) {
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
format.setVersion(1, 4); format.setVersion(1, 4);
} else { } else {
format.setVersion(1, 1); format.setVersion(1, 1);
} }
format.setOption(QSurfaceFormat::DeprecatedFunctions); format.setOption(QSurfaceFormat::DeprecatedFunctions);
if (DisplayGL::supportsFormat(format)) { if (DisplayGL::supportsFormat(format)) {

View File

@ -160,7 +160,7 @@ void ForwarderController::gotManifest(QNetworkReply* reply) {
mUpdaterGetUpdateForChannel(&context, platform.toUtf8().constData(), m_channel.toUtf8().constData(), &update); mUpdaterGetUpdateForChannel(&context, platform.toUtf8().constData(), m_channel.toUtf8().constData(), &update);
downloadBuild({bucket + update.path}); downloadBuild({bucket + update.path});
mUpdaterDeinit(&context); mUpdaterDeinit(&context);
} }
void ForwarderController::downloadBuild(const QUrl& url) { void ForwarderController::downloadBuild(const QUrl& url) {
@ -174,7 +174,7 @@ void ForwarderController::downloadBuild(const QUrl& url) {
.arg(extension)); .arg(extension));
if (!m_sourceFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { if (!m_sourceFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
emit buildFailed(); emit buildFailed();
return; return;
} }
QNetworkReply* reply = GBAApp::app()->httpGet(url); QNetworkReply* reply = GBAApp::app()->httpGet(url);

View File

@ -97,7 +97,7 @@ void ForwarderView::build() {
if (m_ui.baseType->currentIndex() == 2) { if (m_ui.baseType->currentIndex() == 2) {
m_controller.setBaseFilename(m_ui.baseFilename->text()); m_controller.setBaseFilename(m_ui.baseFilename->text());
} else { } else {
m_controller.clearBaseFilename(); m_controller.clearBaseFilename();
} }
m_controller.startBuild(m_ui.outputFilename->text()); m_controller.startBuild(m_ui.outputFilename->text());
m_ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); m_ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
@ -235,14 +235,14 @@ void ForwarderView::updateProgress() {
if (m_needsForwarderKit) { if (m_needsForwarderKit) {
m_ui.progressBar->setValue(450 + m_downloadProgress * 50); m_ui.progressBar->setValue(450 + m_downloadProgress * 50);
} else { } else {
m_ui.progressBar->setValue(m_downloadProgress * 100); m_ui.progressBar->setValue(m_downloadProgress * 100);
} }
break; break;
case ForwarderController::BASE: case ForwarderController::BASE:
if (m_needsForwarderKit) { if (m_needsForwarderKit) {
m_ui.progressBar->setValue(500 + m_downloadProgress * 500); m_ui.progressBar->setValue(500 + m_downloadProgress * 500);
} else { } else {
m_ui.progressBar->setValue(100 + m_downloadProgress * 900); m_ui.progressBar->setValue(100 + m_downloadProgress * 900);
} }
break; break;
} }

View File

@ -21,7 +21,7 @@ MemorySearch::MemorySearch(std::shared_ptr<CoreController> controller, QWidget*
mCoreMemorySearchResultsInit(&m_results, 0); mCoreMemorySearchResultsInit(&m_results, 0);
connect(m_ui.search, &QPushButton::clicked, this, &MemorySearch::search); connect(m_ui.search, &QPushButton::clicked, this, &MemorySearch::search);
connect(m_ui.value, &QLineEdit::returnPressed, this, &MemorySearch::search); connect(m_ui.value, &QLineEdit::returnPressed, this, &MemorySearch::search);
connect(m_ui.searchWithin, &QPushButton::clicked, this, &MemorySearch::searchWithin); connect(m_ui.searchWithin, &QPushButton::clicked, this, &MemorySearch::searchWithin);
connect(m_ui.refresh, &QPushButton::clicked, this, &MemorySearch::refresh); connect(m_ui.refresh, &QPushButton::clicked, this, &MemorySearch::refresh);
connect(m_ui.numHex, &QPushButton::clicked, this, &MemorySearch::refresh); connect(m_ui.numHex, &QPushButton::clicked, this, &MemorySearch::refresh);

View File

@ -86,18 +86,18 @@ void SaveConverter::refreshInputTypes() {
m_validSaves.clear(); m_validSaves.clear();
m_ui.inputType->clear(); m_ui.inputType->clear();
if (m_ui.inputFile->text().isEmpty()) { if (m_ui.inputFile->text().isEmpty()) {
m_ui.inputType->addItem(tr("No file selected")); m_ui.inputType->addItem(tr("No file selected"));
m_ui.inputType->setEnabled(false); m_ui.inputType->setEnabled(false);
return; return;
} }
std::shared_ptr<VFileDevice> vf = std::make_shared<VFileDevice>(m_ui.inputFile->text(), QIODevice::ReadOnly); std::shared_ptr<VFileDevice> vf = std::make_shared<VFileDevice>(m_ui.inputFile->text(), QIODevice::ReadOnly);
if (!vf->isOpen()) { if (!vf->isOpen()) {
m_ui.inputType->addItem(tr("Could not open file")); m_ui.inputType->addItem(tr("Could not open file"));
m_ui.inputType->setEnabled(false); m_ui.inputType->setEnabled(false);
return; return;
} }
detectFromSavestate(*vf); detectFromSavestate(*vf);
detectFromSize(vf); detectFromSize(vf);
detectFromHeaders(vf); detectFromHeaders(vf);
@ -108,7 +108,7 @@ void SaveConverter::refreshInputTypes() {
if (m_validSaves.count()) { if (m_validSaves.count()) {
m_ui.inputType->setEnabled(true); m_ui.inputType->setEnabled(true);
} else { } else {
m_ui.inputType->addItem(tr("No valid formats found")); m_ui.inputType->addItem(tr("No valid formats found"));
m_ui.inputType->setEnabled(false); m_ui.inputType->setEnabled(false);
} }
} }
@ -127,7 +127,7 @@ void SaveConverter::refreshOutputTypes() {
if (m_validOutputs.count()) { if (m_validOutputs.count()) {
m_ui.outputType->setEnabled(true); m_ui.outputType->setEnabled(true);
} else { } else {
m_ui.outputType->addItem(tr("No valid conversions found")); m_ui.outputType->addItem(tr("No valid conversions found"));
m_ui.outputType->setEnabled(false); m_ui.outputType->setEnabled(false);
} }
checkCanConvert(); checkCanConvert();
@ -494,21 +494,21 @@ SaveConverter::AnnotatedSave::operator QString() const {
if (size & 0xFF) { if (size & 0xFF) {
typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "%1 SRAM + RTC"); typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "%1 SRAM + RTC");
} else { } else {
typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "%1 SRAM"); typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "%1 SRAM");
} }
break; break;
case GB_MBC2: case GB_MBC2:
if (size == 0x100) { if (size == 0x100) {
typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "packed MBC2"); typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "packed MBC2");
} else { } else {
typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "unpacked MBC2"); typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "unpacked MBC2");
} }
break; break;
case GB_MBC6: case GB_MBC6:
if (size == GB_SIZE_MBC6_FLASH) { if (size == GB_SIZE_MBC6_FLASH) {
typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "MBC6 flash"); typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "MBC6 flash");
} else if (size > GB_SIZE_MBC6_FLASH) { } else if (size > GB_SIZE_MBC6_FLASH) {
typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "MBC6 combined SRAM + flash"); typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "MBC6 combined SRAM + flash");
} else { } else {
typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "MBC6 SRAM"); typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "MBC6 SRAM");
} }

View File

@ -81,7 +81,7 @@ void TilePainter::setTileCount(int tiles) {
int w = width() / m_size; int w = width() / m_size;
int h = (tiles + w - 1) * m_size / w; int h = (tiles + w - 1) * m_size / w;
setMinimumSize(m_size, h - (h % m_size)); setMinimumSize(m_size, h - (h % m_size));
} else { } else {
int w = minimumSize().width() / m_size; int w = minimumSize().width() / m_size;
if (!w) { if (!w) {
w = 1; w = 1;

View File

@ -132,7 +132,7 @@ void TileView::updateTilesGBA(bool force) {
if (m_ui.tilesBg->isChecked()) { if (m_ui.tilesBg->isChecked()) {
m_ui.tiles->setTileCount(1024); m_ui.tiles->setTileCount(1024);
} else if (m_ui.tilesObj->isChecked()) { } else if (m_ui.tilesObj->isChecked()) {
m_ui.tiles->setTileCount(512); m_ui.tiles->setTileCount(512);
} else { } else {
m_ui.tiles->setTileCount(1536); m_ui.tiles->setTileCount(1536);
} }
@ -165,7 +165,7 @@ void TileView::updateTilesGBA(bool force) {
if (m_ui.tilesBg->isChecked()) { if (m_ui.tilesBg->isChecked()) {
m_ui.tiles->setTileCount(2048); m_ui.tiles->setTileCount(2048);
} else if (m_ui.tilesObj->isChecked()) { } else if (m_ui.tilesObj->isChecked()) {
m_ui.tiles->setTileCount(1024); m_ui.tiles->setTileCount(1024);
} else { } else {
m_ui.tiles->setTileCount(3072); m_ui.tiles->setTileCount(3072);
} }

View File

@ -127,7 +127,7 @@ Window::Window(CoreManager* manager, ConfigController* config, int playerId, QWi
if (value.toBool()) { if (value.toBool()) {
attachWidget(m_libraryView); attachWidget(m_libraryView);
} else { } else {
attachWidget(m_screenWidget); attachWidget(m_screenWidget);
} }
} }
}, this); }, this);
@ -136,8 +136,8 @@ Window::Window(CoreManager* manager, ConfigController* config, int playerId, QWi
ConfigOption* showFilenameInLibrary = m_config->addOption("showFilenameInLibrary"); ConfigOption* showFilenameInLibrary = m_config->addOption("showFilenameInLibrary");
showFilenameInLibrary->connect([this](const QVariant& value) { showFilenameInLibrary->connect([this](const QVariant& value) {
m_libraryView->setShowFilename(value.toBool()); m_libraryView->setShowFilename(value.toBool());
}, this); }, this);
m_config->updateOption("showFilenameInLibrary"); m_config->updateOption("showFilenameInLibrary");
ConfigOption* libraryStyle = m_config->addOption("libraryStyle"); ConfigOption* libraryStyle = m_config->addOption("libraryStyle");
libraryStyle->connect([this](const QVariant& value) { libraryStyle->connect([this](const QVariant& value) {
m_libraryView->setViewStyle(static_cast<LibraryStyle>(value.toInt())); m_libraryView->setViewStyle(static_cast<LibraryStyle>(value.toInt()));

View File

@ -181,7 +181,7 @@ void LibraryTree::rebuildTree() {
QHash<QString, QTreeWidgetItem*> pathNodes; QHash<QString, QTreeWidgetItem*> pathNodes;
if (m_currentStyle == LibraryStyle::STYLE_TREE) { if (m_currentStyle == LibraryStyle::STYLE_TREE) {
for (const QString& folder : m_pathNodes.keys()) { for (const QString& folder : m_pathNodes.keys()) {
QTreeWidgetItem* i = new LibraryTreeItem; QTreeWidgetItem* i = new LibraryTreeItem;
pathNodes.insert(folder, i); pathNodes.insert(folder, i);
i->setText(0, folder.section("/", -1)); i->setText(0, folder.section("/", -1));

View File

@ -107,7 +107,7 @@ void ScriptingTextBuffer::moveCursor(const QPoint& pos) {
m_shim.cursor.insertBlock(); m_shim.cursor.insertBlock();
} }
} else { } else {
m_shim.cursor.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, y); m_shim.cursor.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, y);
} }
int x = pos.x(); int x = pos.x();

View File

@ -1143,7 +1143,7 @@ bool _luaInvoke(struct mScriptEngineContextLua* luaContext, struct mScriptFrame*
if (ret == LUA_ERRRUN) { if (ret == LUA_ERRRUN) {
luaContext->lastError = strdup(lua_tostring(luaContext->lua, -1)); luaContext->lastError = strdup(lua_tostring(luaContext->lua, -1));
lua_pop(luaContext->lua, 1); lua_pop(luaContext->lua, 1);
_luaError(luaContext); _luaError(luaContext);
} }
mScriptContextDeactivate(luaContext->d.context); mScriptContextDeactivate(luaContext->d.context);

View File

@ -1443,7 +1443,7 @@ static struct mScriptClassMember* _findSetter(const struct mScriptTypeClass* cls
if (m) { if (m) {
return m; return m;
} }
switch (type->base) { switch (type->base) {
case mSCRIPT_TYPE_SINT: case mSCRIPT_TYPE_SINT:
if (type->size < 2) { if (type->size < 2) {

View File

@ -24,7 +24,7 @@ void createSdf(const struct mImage* src, struct mImage* dst, int x, int y, int w
if (mImageGetPixel(src, i, j) & 0xFFFFFF) { if (mImageGetPixel(src, i, j) & 0xFFFFFF) {
mImageSetPixelRaw(dst, i, j, 0xFF); mImageSetPixelRaw(dst, i, j, 0xFF);
} else { } else {
mImageSetPixelRaw(dst, i, j, 1); mImageSetPixelRaw(dst, i, j, 1);
} }
} }
} }

View File

@ -60,7 +60,7 @@ void mAudioResamplerSetSource(struct mAudioResampler* resampler, struct mAudioBu
void mAudioResamplerSetDestination(struct mAudioResampler* resampler, struct mAudioBuffer* destination, double rate) { void mAudioResamplerSetDestination(struct mAudioResampler* resampler, struct mAudioBuffer* destination, double rate) {
resampler->destination = destination; resampler->destination = destination;
resampler->destRate = rate; resampler->destRate = rate;
} }
size_t mAudioResamplerProcess(struct mAudioResampler* resampler) { size_t mAudioResamplerProcess(struct mAudioResampler* resampler) {

View File

@ -103,7 +103,7 @@ uint32_t doCrc32(const void* buf, size_t size) {
#ifndef HAVE_CRC32 #ifndef HAVE_CRC32
uint32_t crc32(uint32_t crc, const void* buf, size_t size) { uint32_t crc32(uint32_t crc, const void* buf, size_t size) {
const uint8_t* p = buf; const uint8_t* p = buf;
crc = ~crc; crc = ~crc;
for (size_t i = 0; i < size; ++i) { for (size_t i = 0; i < size; ++i) {
crc = crc32Table[(crc ^ p[i]) & 0xFF] ^ (crc >> 8); crc = crc32Table[(crc ^ p[i]) & 0xFF] ^ (crc >> 8);

View File

@ -69,9 +69,9 @@ uint32_t hash32(const void* key, size_t len, uint32_t seed) {
k1 *= c1; k1 *= c1;
k1 = ROTL32(k1, 15); k1 = ROTL32(k1, 15);
k1 *= c2; k1 *= c2;
h1 ^= k1; h1 ^= k1;
h1 = ROTL32(h1, 13); h1 = ROTL32(h1, 13);
h1 = h1 * 5 + 0xe6546b64; h1 = h1 * 5 + 0xe6546b64;
} }
@ -105,4 +105,4 @@ uint32_t hash32(const void* key, size_t len, uint32_t seed) {
h1 = fmix32(h1); h1 = fmix32(h1);
return h1; return h1;
} }

View File

@ -91,7 +91,7 @@ bool SfoAddStrValue(struct Table* sfo, const char* name, const char* value) {
HashTableInsert(sfo, name, entry); HashTableInsert(sfo, name, entry);
} }
entry->type = PSF_TYPE_STR; entry->type = PSF_TYPE_STR;
entry->data.str = value; entry->data.str = value;
return true; return true;
} }