From c100d527fc2f74ddc08fb8ad836f6504949a5d0b Mon Sep 17 00:00:00 2001 From: Johan Mattsson <39247600+mjunix@users.noreply.github.com> Date: Mon, 5 Dec 2022 10:03:48 +0100 Subject: [PATCH] Small fixes (#2314) * Assign the null pointer * Initialize variable * Fix while-conditions --- .../TextureEnhancer/TextureFilters_hq2x.cpp | 2 +- Source/Project64/UserInterface/ProjectSupport.cpp | 2 +- Source/nragev20/PakIO.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Project64-video/TextureEnhancer/TextureFilters_hq2x.cpp b/Source/Project64-video/TextureEnhancer/TextureFilters_hq2x.cpp index d113e1724..4e0d84c57 100644 --- a/Source/Project64-video/TextureEnhancer/TextureFilters_hq2x.cpp +++ b/Source/Project64-video/TextureEnhancer/TextureFilters_hq2x.cpp @@ -1115,7 +1115,7 @@ static void lq2xS_32_def(uint32* dst0, uint32* dst1, const uint32* src0, const u unsigned i; for (i = 0; i < count; ++i) { - unsigned char mask; + unsigned char mask = 0; uint32 c[9]; diff --git a/Source/Project64/UserInterface/ProjectSupport.cpp b/Source/Project64/UserInterface/ProjectSupport.cpp index 982e557ce..08165b4e6 100644 --- a/Source/Project64/UserInterface/ProjectSupport.cpp +++ b/Source/Project64/UserInterface/ProjectSupport.cpp @@ -258,7 +258,7 @@ void CProjectSupport::LoadSupportInfo(void) if (hKeyResults != nullptr) { RegCloseKey(hKeyResults); - nullptr; + hKeyResults = nullptr; } std::vector OutData; diff --git a/Source/nragev20/PakIO.cpp b/Source/nragev20/PakIO.cpp index 26d20ebd5..f3e4c3037 100644 --- a/Source/nragev20/PakIO.cpp +++ b/Source/nragev20/PakIO.cpp @@ -1329,19 +1329,19 @@ bool InsertNoteFile( LPBYTE aMemPak, LPCTSTR pszFileName ) int len = lstrlenA( szLine ); i = 16; - while(( szLine[i] != '}' ) && (i < len)) + while((i < len) && ( szLine[i] != '}' )) i++; szLine[i] = '\0'; i += ReverseNotesA( &szLine[16], &pBlock[12] ); - while(( szLine[i] != '{' ) && (i < len)) + while((i < len) && ( szLine[i] != '{' )) i++; if(i < len) { int start = i+1; - while(( szLine[i] != '}' ) && (i < len)) + while((i < len) && ( szLine[i] != '}' )) i++; if(i < len) { @@ -1350,7 +1350,7 @@ bool InsertNoteFile( LPBYTE aMemPak, LPCTSTR pszFileName ) } } - while(( szLine[i] != '}' ) && (i < len)) + while((i < len) && ( szLine[i] != '}' )) i++; szLine[i] = '\0';