Skip to content

Commit

Permalink
Merge pull request #8304 from Vbif/static-analysis
Browse files Browse the repository at this point in the history
Fixed some errors from PVS-Studio in Common project
  • Loading branch information
hrydgard committed Dec 26, 2015
2 parents 7eb662f + dff476c commit 5c18902
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Common/CPUDetect.cpp
Expand Up @@ -280,7 +280,7 @@ std::string CPUInfo::Summarize()
if (bSSE4_2) sum += ", SSE4.2";
if (HTT) sum += ", HTT";
if (bAVX) sum += ", AVX";
if (bAVX) sum += ", FMA";
if (bFMA) sum += ", FMA";
if (bAES) sum += ", AES";
if (bLongMode) sum += ", 64-bit support";
return sum;
Expand Down
2 changes: 1 addition & 1 deletion Common/ColorConv.cpp
Expand Up @@ -408,7 +408,7 @@ void ConvertRGBA4444ToRGBA8888(u32 *dst32, const u16 *src, const u32 numPixels)
__m128i b = _mm_and_si128(_mm_srli_epi16(c, 8), mask4);
// And lastly 00A0 00A0. No mask needed, we have a wall.
__m128i a = _mm_srli_epi16(c, 12);
a = _mm_slli_epi16(g, 8);
a = _mm_slli_epi16(a, 8);

// We swizzle after combining - R0G0 R0G0 and B0A0 B0A0 -> RRGG RRGG and BBAA BBAA.
__m128i rg = _mm_or_si128(r, g);
Expand Down
11 changes: 3 additions & 8 deletions Common/ConsoleListener.cpp
Expand Up @@ -121,10 +121,10 @@ void ConsoleListener::Open()
{
// Open the console window and create the window handle for GetStdHandle()
AllocConsole();
HWND hConWnd = GetConsoleWindow();
ShowWindow(hConWnd, SW_SHOWDEFAULT);
hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_SHOWDEFAULT);
// disable console close button
HMENU hMenu=GetSystemMenu(hConWnd,false);
HMENU hMenu=GetSystemMenu(hWnd, false);
EnableMenuItem(hMenu,SC_CLOSE,MF_GRAYED|MF_BYCOMMAND);
// Save the window handle that AllocConsole() created
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
Expand Down Expand Up @@ -513,9 +513,6 @@ void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool
bool DAft = true;
std::string SLog = "";

const HWND hWnd = GetConsoleWindow();
const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

// Get console info
CONSOLE_SCREEN_BUFFER_INFO ConInfo;
GetConsoleScreenBufferInfo(hConsole, &ConInfo);
Expand Down Expand Up @@ -632,8 +629,6 @@ void ConsoleListener::ClearScreen(bool Cursor)
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwConSize;

HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

GetConsoleScreenBufferInfo(hConsole, &csbi);
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
// Write space to the entire console
Expand Down
2 changes: 1 addition & 1 deletion Common/ConsoleListener.h
Expand Up @@ -46,7 +46,7 @@ class ConsoleListener : public LogListener {
bool Hidden() const { return bHidden; }
private:
#if defined(_WIN32) && !defined(_XBOX)
HWND GetHwnd(void);
HWND hWnd;
HANDLE hConsole;

static unsigned int WINAPI RunThread(void *lpParam);
Expand Down
1 change: 1 addition & 0 deletions Common/FileUtil.h
Expand Up @@ -187,6 +187,7 @@ class IOFile : NonCopyable {

private:
IOFile& operator=(const IOFile&) /*= delete*/;
IOFile(const IOFile&) /*= delete*/;

std::FILE* m_file;
bool m_good;
Expand Down
1 change: 1 addition & 0 deletions ext/native/base/mutex.h
Expand Up @@ -125,6 +125,7 @@ class recursive_mutex {
private:
mutexType mut_;
recursive_mutex(const recursive_mutex &other);
recursive_mutex& operator=(const recursive_mutex& other);
};

class lock_guard {
Expand Down

0 comments on commit 5c18902

Please sign in to comment.