diff --git a/include/mgba-util/geometry.h b/include/mgba-util/geometry.h index aa7d65e94..5164b0b8d 100644 --- a/include/mgba-util/geometry.h +++ b/include/mgba-util/geometry.h @@ -11,15 +11,15 @@ CXX_GUARD_START struct mSize { - int width; - int height; + int width; + int height; }; struct mRectangle { - int x; - int y; - int width; - int height; + int x; + int y; + int width; + int height; }; void mRectangleUnion(struct mRectangle* dst, const struct mRectangle* add); diff --git a/include/mgba/feature/proxy-backend.h b/include/mgba/feature/proxy-backend.h index ffd38eb47..0851b3a68 100644 --- a/include/mgba/feature/proxy-backend.h +++ b/include/mgba/feature/proxy-backend.h @@ -57,7 +57,7 @@ struct mVideoBackendCommand { struct mVideoProxyBackend { struct VideoBackend d; struct VideoBackend* backend; - + struct RingFIFO in; struct RingFIFO out; diff --git a/include/mgba/internal/defines.h b/include/mgba/internal/defines.h index 8af603736..67b8ec8fd 100644 --- a/include/mgba/internal/defines.h +++ b/include/mgba/internal/defines.h @@ -9,23 +9,23 @@ #define mSAVEDATA_CLEANUP_THRESHOLD 15 enum { - mSAVEDATA_DIRT_NONE = 0, + mSAVEDATA_DIRT_NONE = 0, mSAVEDATA_DIRT_NEW = 1, mSAVEDATA_DIRT_SEEN = 2, }; static inline bool mSavedataClean(int* dirty, uint32_t* dirtAge, uint32_t frameCount) { - if (*dirty & mSAVEDATA_DIRT_NEW) { - *dirtAge = frameCount; - *dirty &= ~mSAVEDATA_DIRT_NEW; - if (!(*dirty & mSAVEDATA_DIRT_SEEN)) { - *dirty |= mSAVEDATA_DIRT_SEEN; - } - } else if ((*dirty & mSAVEDATA_DIRT_SEEN) && frameCount - *dirtAge > mSAVEDATA_CLEANUP_THRESHOLD) { - *dirty = 0; - return true; - } - return false; + if (*dirty & mSAVEDATA_DIRT_NEW) { + *dirtAge = frameCount; + *dirty &= ~mSAVEDATA_DIRT_NEW; + if (!(*dirty & mSAVEDATA_DIRT_SEEN)) { + *dirty |= mSAVEDATA_DIRT_SEEN; + } + } else if ((*dirty & mSAVEDATA_DIRT_SEEN) && frameCount - *dirtAge > mSAVEDATA_CLEANUP_THRESHOLD) { + *dirty = 0; + return true; + } + return false; } #endif diff --git a/src/arm/isa-thumb.c b/src/arm/isa-thumb.c index 0bc8fcb12..30fcfde9d 100644 --- a/src/arm/isa-thumb.c +++ b/src/arm/isa-thumb.c @@ -88,7 +88,7 @@ DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(LSR1, } THUMB_NEUTRAL_S( , , cpu->gprs[rd]);) -DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(ASR1, +DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(ASR1, if (!immediate) { cpu->cpsr.c = ARM_SIGN(cpu->gprs[rm]); if (cpu->cpsr.c) { diff --git a/src/core/cheats.c b/src/core/cheats.c index 53f71e907..1ffe91adf 100644 --- a/src/core/cheats.c +++ b/src/core/cheats.c @@ -37,7 +37,7 @@ static uint32_t _patchMakeKey(struct mCheatPatch* patch) { patchKey >>= 2; break; default: - break; + break; } // TODO: More than one segment if (patch->segment > 0) { diff --git a/src/core/thread.c b/src/core/thread.c index 2462407cc..2b16a03c7 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -656,7 +656,7 @@ void mCoreThreadContinue(struct mCoreThread* threadContext) { if (threadContext->impl->requested) { threadContext->impl->state = mTHREAD_REQUEST; } else { - threadContext->impl->state = mTHREAD_RUNNING; + threadContext->impl->state = mTHREAD_RUNNING; } ConditionWake(&threadContext->impl->stateOnThreadCond); } diff --git a/src/feature/ffmpeg/ffmpeg-decoder.c b/src/feature/ffmpeg/ffmpeg-decoder.c index 09539ca61..189fb312f 100644 --- a/src/feature/ffmpeg/ffmpeg-decoder.c +++ b/src/feature/ffmpeg/ffmpeg-decoder.c @@ -71,7 +71,7 @@ bool FFmpegDecoderOpen(struct FFmpegDecoder* decoder, const char* infile) { codec = avcodec_find_decoder(context->codec_id); if (!codec) { FFmpegDecoderClose(decoder); - return false; + return false; } if (avcodec_open2(context, codec, NULL) < 0) { FFmpegDecoderClose(decoder); diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c index 5ee54a5e8..6202e0fcd 100644 --- a/src/feature/ffmpeg/ffmpeg-encoder.c +++ b/src/feature/ffmpeg/ffmpeg-encoder.c @@ -893,7 +893,7 @@ void FFmpegEncoderSetInputFrameRate(struct FFmpegEncoder* encoder, int numerator void FFmpegEncoderSetInputSampleRate(struct FFmpegEncoder* encoder, int sampleRate) { encoder->isampleRate = sampleRate; - if (encoder->resampleContext) { + if (encoder->resampleContext) { av_freep(&encoder->audioBuffer); #ifdef USE_LIBAVRESAMPLE avresample_close(encoder->resampleContext); diff --git a/src/feature/gui/gui-config.c b/src/feature/gui/gui-config.c index e110ef768..6214abc15 100644 --- a/src/feature/gui/gui-config.c +++ b/src/feature/gui/gui-config.c @@ -295,7 +295,7 @@ void mGUIShowConfig(struct mGUIRunner* runner, struct GUIMenuItem* extra, size_t test.v.s = mCoreConfigGetValue(&runner->config, item->data.v.s); if (test.v.s && strcmp(test.v.s, v->v.s) == 0) { item->state = j; - break; + break; } break; case GUI_VARIANT_POINTER: diff --git a/src/feature/updater.c b/src/feature/updater.c index e50ed0fa2..ea9cea3c1 100644 --- a/src/feature/updater.c +++ b/src/feature/updater.c @@ -46,7 +46,7 @@ static void _updateList(const char* key, const char* value, void* user) { if (strncmp("medusa.", key, 7) == 0) { dotLoc = strchr(&key[7], '.'); } else { - dotLoc = strchr(key, '.'); + dotLoc = strchr(key, '.'); } if (!dotLoc) { return; diff --git a/src/feature/video-logger.c b/src/feature/video-logger.c index 4044a4928..ac5ef1777 100644 --- a/src/feature/video-logger.c +++ b/src/feature/video-logger.c @@ -339,17 +339,17 @@ bool mVideoLoggerRendererRunInjected(struct mVideoLogger* logger) { channel->injecting = true; bool res = mVideoLoggerRendererRun(logger, false); channel->injecting = false; - return res; + return res; } void mVideoLoggerInjectionPoint(struct mVideoLogger* logger, enum mVideoLoggerInjectionPoint injectionPoint) { struct mVideoLogChannel* channel = logger->dataContext; - channel->injectionPoint = injectionPoint; + channel->injectionPoint = injectionPoint; } void mVideoLoggerIgnoreAfterInjection(struct mVideoLogger* logger, uint32_t mask) { struct mVideoLogChannel* channel = logger->dataContext; - channel->ignorePackets = mask; + channel->ignorePackets = mask; } static bool _writeData(struct mVideoLogger* logger, const void* data, size_t length) { diff --git a/src/gb/core.c b/src/gb/core.c index 2bfea28ef..e67fe4232 100644 --- a/src/gb/core.c +++ b/src/gb/core.c @@ -152,7 +152,7 @@ static bool _GBCoreInit(struct mCore* core) { #ifdef ENABLE_VFS mDirectorySetInit(&core->dirs); #endif - + return true; } diff --git a/src/gb/extra/proxy.c b/src/gb/extra/proxy.c index ba36c0090..c0c386f4c 100644 --- a/src/gb/extra/proxy.c +++ b/src/gb/extra/proxy.c @@ -267,7 +267,7 @@ void GBVideoProxyRendererDrawRange(struct GBVideoRenderer* renderer, int startX, _copyExtraState(proxyRenderer); 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) { diff --git a/src/gb/gb.c b/src/gb/gb.c index 67dea55b8..fa0d6482f 100644 --- a/src/gb/gb.c +++ b/src/gb/gb.c @@ -152,7 +152,7 @@ bool GBLoadGBX(struct GBXMetadata* metadata, struct VFile* vf) { if (memcmp(footer, "MBC1", 4) == 0) { metadata->mapperVars.u8[0] = 5; } else if (memcmp(footer, "MB1M", 4) == 0) { - metadata->mapperVars.u8[0] = 4; + metadata->mapperVars.u8[0] = 4; } return true; } @@ -894,7 +894,7 @@ int GBValidModels(const uint8_t* bank0) { } else if (cart->cgb == 0xC0) { models = GB_MODEL_CGB; } else { - models = GB_MODEL_MGB; + models = GB_MODEL_MGB; } if (cart->sgb == 0x03 && cart->oldLicensee == 0x33) { models |= GB_MODEL_SGB; diff --git a/src/gb/mbc.c b/src/gb/mbc.c index c9ebed546..397b50088 100644 --- a/src/gb/mbc.c +++ b/src/gb/mbc.c @@ -163,7 +163,7 @@ static bool _isMulticart(const uint8_t* mem) { success = GBIsROM(vf); vf->close(vf); } - + return success; } diff --git a/src/gb/mbc/tama5.c b/src/gb/mbc/tama5.c index 505a35ed8..c4f0a1517 100644 --- a/src/gb/mbc/tama5.c +++ b/src/gb/mbc/tama5.c @@ -131,7 +131,7 @@ static void _latchTAMA6Rtc(struct mRTCSource* rtc, struct GBTAMA5State* tama5, t timerRegs[GBTAMA6_RTC_PA0_HOUR_10] = (diff % 24) / 10; } else { 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 += diff / 24; diff --git a/src/gb/mbc/unlicensed.c b/src/gb/mbc/unlicensed.c index 950ddf074..844c0d0cd 100644 --- a/src/gb/mbc/unlicensed.c +++ b/src/gb/mbc/unlicensed.c @@ -349,7 +349,7 @@ void _GBHitek(struct GB* gb, uint16_t address, uint8_t value) { break; case 0x300: // See hhugboy src/memory/mbc/MbcUnlHitek.cpp for commentary on this return - return; + return; } _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) { - if (address > 0x2100 && address < 0x3000) { - return; - } - _GBMBC5(gb, address, value); + if (address > 0x2100 && address < 0x3000) { + return; + } + _GBMBC5(gb, address, value); } void _GBSachen(struct GB* gb, uint16_t address, uint8_t value) { diff --git a/src/gb/video.c b/src/gb/video.c index 38be72a5a..d52e43dee 100644 --- a/src/gb/video.c +++ b/src/gb/video.c @@ -755,7 +755,7 @@ void GBVideoWriteLCDC(struct GBVideo* video, GBRegisterLCDC value) { video->ly = 0; video->p->memory.io[GB_REG_LY] = 0; video->renderer->writePalette(video->renderer, 0, video->dmgPalette[0]); - + mTimingDeschedule(&video->p->timing, &video->modeEvent); mTimingDeschedule(&video->p->timing, &video->frameEvent); mTimingSchedule(&video->p->timing, &video->frameEvent, GB_VIDEO_TOTAL_LENGTH << 1); diff --git a/src/gba/extra/proxy.c b/src/gba/extra/proxy.c index ee611247b..e33c7b568 100644 --- a/src/gba/extra/proxy.c +++ b/src/gba/extra/proxy.c @@ -324,7 +324,7 @@ void GBAVideoProxyRendererSaveState(struct GBAVideoRenderer* renderer, void** st proxyRenderer->logger->stateSize = 0; } else { proxyRenderer->backend->saveState(proxyRenderer->backend, state, size); - } + } } void GBAVideoProxyRendererWriteVRAM(struct GBAVideoRenderer* renderer, uint32_t address) { diff --git a/src/gba/serialize.c b/src/gba/serialize.c index 1669eca3d..5eabaedea 100644 --- a/src/gba/serialize.c +++ b/src/gba/serialize.c @@ -195,7 +195,7 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) { if (GBASerializedMiscFlagsIsIrqPending(miscFlags)) { int32_t when; LOAD_32(when, 0, &state->nextIrq); - mTimingSchedule(&gba->timing, &gba->irqEvent, when); + mTimingSchedule(&gba->timing, &gba->irqEvent, when); } gba->cpuBlocked = GBASerializedMiscFlagsGetBlocked(miscFlags); gba->keysLast = GBASerializedMiscFlagsGetKeyIRQKeys(miscFlags); diff --git a/src/platform/3ds/ctr-gpu.c b/src/platform/3ds/ctr-gpu.c index 4a95c4640..d153f84a0 100644 --- a/src/platform/3ds/ctr-gpu.c +++ b/src/platform/3ds/ctr-gpu.c @@ -160,7 +160,7 @@ void ctrActivateTexture(const C3D_Tex* texture) { .m = { // 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, 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); diff --git a/src/platform/example/client-server/server.c b/src/platform/example/client-server/server.c index 0dcec9b15..71472a05c 100644 --- a/src/platform/example/client-server/server.c +++ b/src/platform/example/client-server/server.c @@ -53,7 +53,7 @@ int main(int argc, char** argv) { SocketClose(sock); SocketSubsystemDeinit(); didFail = true; - goto cleanup; + goto cleanup; } // Run the server diff --git a/src/platform/opengl/gl.c b/src/platform/opengl/gl.c index b0cef1f0d..de8354c1c 100644 --- a/src/platform/opengl/gl.c +++ b/src/platform/opengl/gl.c @@ -253,7 +253,7 @@ static void mGLContextImageSize(struct VideoBackend* v, enum VideoLayer layer, i *height = context->layerDims[layer].height; } else { *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; glBindTexture(GL_TEXTURE_2D, context->tex[context->activeTex]); } else { - glBindTexture(GL_TEXTURE_2D, context->layers[layer]); + glBindTexture(GL_TEXTURE_2D, context->layers[layer]); } int width = context->imageSizes[layer].width; diff --git a/src/platform/opengl/gles2.c b/src/platform/opengl/gles2.c index fa6716be9..e5ee98767 100644 --- a/src/platform/opengl/gles2.c +++ b/src/platform/opengl/gles2.c @@ -529,7 +529,7 @@ static void mGLES2ContextImageSize(struct VideoBackend* v, enum VideoLayer layer *height = context->layerDims[layer].height; } else { *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) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, shader->width, shader->height, 0, GL_RGB, GL_UNSIGNED_BYTE, 0); } 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); diff --git a/src/platform/psp2/psp2-common.h b/src/platform/psp2/psp2-common.h index 7f34d1d10..dcb67b700 100644 --- a/src/platform/psp2/psp2-common.h +++ b/src/platform/psp2/psp2-common.h @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef PSP2_COMMON_H #define PSP2_COMMON_H - + #include #define PSP2_HORIZONTAL_PIXELS 960 diff --git a/src/platform/qt/BattleChipView.cpp b/src/platform/qt/BattleChipView.cpp index f7d6eb4c7..46b24e927 100644 --- a/src/platform/qt/BattleChipView.cpp +++ b/src/platform/qt/BattleChipView.cpp @@ -216,7 +216,7 @@ void BattleChipView::loadDeck() { error->show(); return; } - + QList newDeck; QStringList deck = ini.value("deck").toString().split(','); for (const auto& item : deck) { diff --git a/src/platform/qt/ConfigController.h b/src/platform/qt/ConfigController.h index 4c71c3943..4325a46ba 100644 --- a/src/platform/qt/ConfigController.h +++ b/src/platform/qt/ConfigController.h @@ -130,7 +130,7 @@ private: mGraphicsOpts m_graphicsOpts{}; std::array m_subparsers; bool m_parsed = false; - + QHash m_argvOptions; QHash m_optionSet; std::unique_ptr m_settings; diff --git a/src/platform/qt/DebuggerConsoleController.cpp b/src/platform/qt/DebuggerConsoleController.cpp index dffd71bcf..716c31639 100644 --- a/src/platform/qt/DebuggerConsoleController.cpp +++ b/src/platform/qt/DebuggerConsoleController.cpp @@ -162,7 +162,7 @@ void DebuggerConsoleController::historyLoad() { if (line.endsWith("\r\n")) { line.chop(2); } else if (line.endsWith("\n")) { - line.chop(1); + line.chop(1); } history.append(QString::fromUtf8(line)); } diff --git a/src/platform/qt/Display.h b/src/platform/qt/Display.h index bb16b268e..3cc2fc61f 100644 --- a/src/platform/qt/Display.h +++ b/src/platform/qt/Display.h @@ -62,7 +62,7 @@ public: virtual void setVideoProxy(std::shared_ptr proxy) { m_videoProxy = std::move(proxy); } std::shared_ptr videoProxy() { return m_videoProxy; } virtual VideoBackend* videoBackend(); - + signals: void drawingStarted(); void showCursor(); diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index 5b60eb46e..ad4969943 100644 --- a/src/platform/qt/DisplayGL.cpp +++ b/src/platform/qt/DisplayGL.cpp @@ -314,7 +314,7 @@ bool DisplayGL::highestCompatible(QSurfaceFormat& format) { if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { format.setVersion(1, 4); } else { - format.setVersion(1, 1); + format.setVersion(1, 1); } format.setOption(QSurfaceFormat::DeprecatedFunctions); if (DisplayGL::supportsFormat(format)) { diff --git a/src/platform/qt/ForwarderController.cpp b/src/platform/qt/ForwarderController.cpp index 0934f1c69..abf2d27d0 100644 --- a/src/platform/qt/ForwarderController.cpp +++ b/src/platform/qt/ForwarderController.cpp @@ -160,7 +160,7 @@ void ForwarderController::gotManifest(QNetworkReply* reply) { mUpdaterGetUpdateForChannel(&context, platform.toUtf8().constData(), m_channel.toUtf8().constData(), &update); downloadBuild({bucket + update.path}); - mUpdaterDeinit(&context); + mUpdaterDeinit(&context); } void ForwarderController::downloadBuild(const QUrl& url) { @@ -174,7 +174,7 @@ void ForwarderController::downloadBuild(const QUrl& url) { .arg(extension)); if (!m_sourceFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { emit buildFailed(); - return; + return; } QNetworkReply* reply = GBAApp::app()->httpGet(url); diff --git a/src/platform/qt/ForwarderView.cpp b/src/platform/qt/ForwarderView.cpp index 922ef7c16..7261c0941 100644 --- a/src/platform/qt/ForwarderView.cpp +++ b/src/platform/qt/ForwarderView.cpp @@ -97,7 +97,7 @@ void ForwarderView::build() { if (m_ui.baseType->currentIndex() == 2) { m_controller.setBaseFilename(m_ui.baseFilename->text()); } else { - m_controller.clearBaseFilename(); + m_controller.clearBaseFilename(); } m_controller.startBuild(m_ui.outputFilename->text()); m_ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); @@ -235,14 +235,14 @@ void ForwarderView::updateProgress() { if (m_needsForwarderKit) { m_ui.progressBar->setValue(450 + m_downloadProgress * 50); } else { - m_ui.progressBar->setValue(m_downloadProgress * 100); + m_ui.progressBar->setValue(m_downloadProgress * 100); } break; case ForwarderController::BASE: if (m_needsForwarderKit) { m_ui.progressBar->setValue(500 + m_downloadProgress * 500); } else { - m_ui.progressBar->setValue(100 + m_downloadProgress * 900); + m_ui.progressBar->setValue(100 + m_downloadProgress * 900); } break; } diff --git a/src/platform/qt/MemorySearch.cpp b/src/platform/qt/MemorySearch.cpp index 34f87fe14..7a8446887 100644 --- a/src/platform/qt/MemorySearch.cpp +++ b/src/platform/qt/MemorySearch.cpp @@ -21,7 +21,7 @@ MemorySearch::MemorySearch(std::shared_ptr controller, QWidget* mCoreMemorySearchResultsInit(&m_results, 0); 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.refresh, &QPushButton::clicked, this, &MemorySearch::refresh); connect(m_ui.numHex, &QPushButton::clicked, this, &MemorySearch::refresh); diff --git a/src/platform/qt/SaveConverter.cpp b/src/platform/qt/SaveConverter.cpp index 974f31af0..205a7563d 100644 --- a/src/platform/qt/SaveConverter.cpp +++ b/src/platform/qt/SaveConverter.cpp @@ -86,18 +86,18 @@ void SaveConverter::refreshInputTypes() { m_validSaves.clear(); m_ui.inputType->clear(); 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); return; } std::shared_ptr vf = std::make_shared(m_ui.inputFile->text(), QIODevice::ReadOnly); 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); return; } - + detectFromSavestate(*vf); detectFromSize(vf); detectFromHeaders(vf); @@ -108,7 +108,7 @@ void SaveConverter::refreshInputTypes() { if (m_validSaves.count()) { m_ui.inputType->setEnabled(true); } else { - m_ui.inputType->addItem(tr("No valid formats found")); + m_ui.inputType->addItem(tr("No valid formats found")); m_ui.inputType->setEnabled(false); } } @@ -127,7 +127,7 @@ void SaveConverter::refreshOutputTypes() { if (m_validOutputs.count()) { m_ui.outputType->setEnabled(true); } else { - m_ui.outputType->addItem(tr("No valid conversions found")); + m_ui.outputType->addItem(tr("No valid conversions found")); m_ui.outputType->setEnabled(false); } checkCanConvert(); @@ -494,21 +494,21 @@ SaveConverter::AnnotatedSave::operator QString() const { if (size & 0xFF) { typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "%1 SRAM + RTC"); } else { - typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "%1 SRAM"); + typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "%1 SRAM"); } break; case GB_MBC2: if (size == 0x100) { typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "packed MBC2"); } else { - typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "unpacked MBC2"); + typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "unpacked MBC2"); } break; case GB_MBC6: if (size == GB_SIZE_MBC6_FLASH) { typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "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 { typeFormat = QCoreApplication::translate("QGBA::SaveConverter", "MBC6 SRAM"); } diff --git a/src/platform/qt/TilePainter.cpp b/src/platform/qt/TilePainter.cpp index b8c8075e6..88f7b51b1 100644 --- a/src/platform/qt/TilePainter.cpp +++ b/src/platform/qt/TilePainter.cpp @@ -81,7 +81,7 @@ void TilePainter::setTileCount(int tiles) { int w = width() / m_size; int h = (tiles + w - 1) * m_size / w; setMinimumSize(m_size, h - (h % m_size)); - } else { + } else { int w = minimumSize().width() / m_size; if (!w) { w = 1; diff --git a/src/platform/qt/TileView.cpp b/src/platform/qt/TileView.cpp index dbfc15531..6ba409a0a 100644 --- a/src/platform/qt/TileView.cpp +++ b/src/platform/qt/TileView.cpp @@ -132,7 +132,7 @@ void TileView::updateTilesGBA(bool force) { if (m_ui.tilesBg->isChecked()) { m_ui.tiles->setTileCount(1024); } else if (m_ui.tilesObj->isChecked()) { - m_ui.tiles->setTileCount(512); + m_ui.tiles->setTileCount(512); } else { m_ui.tiles->setTileCount(1536); } @@ -165,7 +165,7 @@ void TileView::updateTilesGBA(bool force) { if (m_ui.tilesBg->isChecked()) { m_ui.tiles->setTileCount(2048); } else if (m_ui.tilesObj->isChecked()) { - m_ui.tiles->setTileCount(1024); + m_ui.tiles->setTileCount(1024); } else { m_ui.tiles->setTileCount(3072); } diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 0e3d73b00..77c7695fb 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -127,7 +127,7 @@ Window::Window(CoreManager* manager, ConfigController* config, int playerId, QWi if (value.toBool()) { attachWidget(m_libraryView); } else { - attachWidget(m_screenWidget); + attachWidget(m_screenWidget); } } }, this); @@ -136,8 +136,8 @@ Window::Window(CoreManager* manager, ConfigController* config, int playerId, QWi ConfigOption* showFilenameInLibrary = m_config->addOption("showFilenameInLibrary"); showFilenameInLibrary->connect([this](const QVariant& value) { m_libraryView->setShowFilename(value.toBool()); - }, this); - m_config->updateOption("showFilenameInLibrary"); + }, this); + m_config->updateOption("showFilenameInLibrary"); ConfigOption* libraryStyle = m_config->addOption("libraryStyle"); libraryStyle->connect([this](const QVariant& value) { m_libraryView->setViewStyle(static_cast(value.toInt())); diff --git a/src/platform/qt/library/LibraryTree.cpp b/src/platform/qt/library/LibraryTree.cpp index 37d07e3e7..c9029e963 100644 --- a/src/platform/qt/library/LibraryTree.cpp +++ b/src/platform/qt/library/LibraryTree.cpp @@ -181,7 +181,7 @@ void LibraryTree::rebuildTree() { QHash pathNodes; if (m_currentStyle == LibraryStyle::STYLE_TREE) { - for (const QString& folder : m_pathNodes.keys()) { + for (const QString& folder : m_pathNodes.keys()) { QTreeWidgetItem* i = new LibraryTreeItem; pathNodes.insert(folder, i); i->setText(0, folder.section("/", -1)); diff --git a/src/platform/qt/scripting/ScriptingTextBuffer.cpp b/src/platform/qt/scripting/ScriptingTextBuffer.cpp index fe85eda0e..9a5de818d 100644 --- a/src/platform/qt/scripting/ScriptingTextBuffer.cpp +++ b/src/platform/qt/scripting/ScriptingTextBuffer.cpp @@ -107,7 +107,7 @@ void ScriptingTextBuffer::moveCursor(const QPoint& pos) { m_shim.cursor.insertBlock(); } } else { - m_shim.cursor.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, y); + m_shim.cursor.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, y); } int x = pos.x(); diff --git a/src/script/engines/lua.c b/src/script/engines/lua.c index f6bdabea2..732d54e99 100644 --- a/src/script/engines/lua.c +++ b/src/script/engines/lua.c @@ -1143,7 +1143,7 @@ bool _luaInvoke(struct mScriptEngineContextLua* luaContext, struct mScriptFrame* if (ret == LUA_ERRRUN) { luaContext->lastError = strdup(lua_tostring(luaContext->lua, -1)); lua_pop(luaContext->lua, 1); - + _luaError(luaContext); } mScriptContextDeactivate(luaContext->d.context); diff --git a/src/script/types.c b/src/script/types.c index be58a43bf..00422d20c 100644 --- a/src/script/types.c +++ b/src/script/types.c @@ -1443,7 +1443,7 @@ static struct mScriptClassMember* _findSetter(const struct mScriptTypeClass* cls if (m) { return m; } - + switch (type->base) { case mSCRIPT_TYPE_SINT: if (type->size < 2) { diff --git a/src/tools/font-sdf.c b/src/tools/font-sdf.c index e28c34eaf..0ddcdc645 100644 --- a/src/tools/font-sdf.c +++ b/src/tools/font-sdf.c @@ -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) { mImageSetPixelRaw(dst, i, j, 0xFF); } else { - mImageSetPixelRaw(dst, i, j, 1); + mImageSetPixelRaw(dst, i, j, 1); } } } diff --git a/src/util/audio-resampler.c b/src/util/audio-resampler.c index 3b1848190..554f4744b 100644 --- a/src/util/audio-resampler.c +++ b/src/util/audio-resampler.c @@ -60,7 +60,7 @@ void mAudioResamplerSetSource(struct mAudioResampler* resampler, struct mAudioBu void mAudioResamplerSetDestination(struct mAudioResampler* resampler, struct mAudioBuffer* destination, double rate) { resampler->destination = destination; - resampler->destRate = rate; + resampler->destRate = rate; } size_t mAudioResamplerProcess(struct mAudioResampler* resampler) { diff --git a/src/util/crc32.c b/src/util/crc32.c index 24f611111..7c1fcda55 100644 --- a/src/util/crc32.c +++ b/src/util/crc32.c @@ -103,7 +103,7 @@ uint32_t doCrc32(const void* buf, size_t size) { #ifndef HAVE_CRC32 uint32_t crc32(uint32_t crc, const void* buf, size_t size) { const uint8_t* p = buf; - + crc = ~crc; for (size_t i = 0; i < size; ++i) { crc = crc32Table[(crc ^ p[i]) & 0xFF] ^ (crc >> 8); diff --git a/src/util/hash.c b/src/util/hash.c index ed070e86c..1ac0b56e2 100644 --- a/src/util/hash.c +++ b/src/util/hash.c @@ -69,9 +69,9 @@ uint32_t hash32(const void* key, size_t len, uint32_t seed) { k1 *= c1; k1 = ROTL32(k1, 15); k1 *= c2; - + h1 ^= k1; - h1 = ROTL32(h1, 13); + h1 = ROTL32(h1, 13); h1 = h1 * 5 + 0xe6546b64; } @@ -105,4 +105,4 @@ uint32_t hash32(const void* key, size_t len, uint32_t seed) { h1 = fmix32(h1); return h1; -} +} diff --git a/src/util/sfo.c b/src/util/sfo.c index 97c4e3853..47d5f2702 100644 --- a/src/util/sfo.c +++ b/src/util/sfo.c @@ -91,7 +91,7 @@ bool SfoAddStrValue(struct Table* sfo, const char* name, const char* value) { HashTableInsert(sfo, name, entry); } entry->type = PSF_TYPE_STR; - entry->data.str = value; + entry->data.str = value; return true; }