diff options
author | Matthias Kortstiege <mkortstiege@users.noreply.github.com> | 2015-11-02 08:24:48 +0100 |
---|---|---|
committer | Matthias Kortstiege <mkortstiege@users.noreply.github.com> | 2015-11-02 08:24:48 +0100 |
commit | 9a5ddf5225b08bbbd618b548ae92b6c86f60b39a (patch) | |
tree | 7e8a3ebedc8bf8c9bd3b66f6fb7e4d7f1a822a59 | |
parent | 4ebcc8dba99962733d7a583ca59990e1c9b63817 (diff) | |
parent | d6c5fa0f9467e1ab7f17962b373563f384dee3a7 (diff) |
Merge pull request #7441 from Jalle19/vs-code-analysis
Fix various VS code analysis complaints (and bugs)
-rw-r--r-- | xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/DllLoader/Win32DllLoader.cpp | 4 | ||||
-rw-r--r-- | xbmc/cores/DllLoader/exports/emu_kernel32.cpp | 4 | ||||
-rw-r--r-- | xbmc/cores/VideoRenderers/DXVAHD.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/VideoRenderers/WinRenderer.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp | 12 | ||||
-rw-r--r-- | xbmc/rendering/dx/RenderSystemDX.cpp | 2 | ||||
-rw-r--r-- | xbmc/video/Teletext.cpp | 2 | ||||
-rw-r--r-- | xbmc/video/TeletextDefines.h | 5 |
9 files changed, 18 insertions, 17 deletions
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp index 452a96f59a..a8ee8293ae 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp @@ -192,7 +192,7 @@ bool CAESinkDirectSound::Initialize(AEAudioFormat &format, std::string &device) else tmp_hWnd = g_hWnd; - CLog::Log(LOGDEBUG, __FUNCTION__": Using Window handle: %d", tmp_hWnd); + CLog::Log(LOGDEBUG, __FUNCTION__": Using Window handle: %p", tmp_hWnd); hr = m_pDSound->SetCooperativeLevel(tmp_hWnd, DSSCL_PRIORITY); diff --git a/xbmc/cores/DllLoader/Win32DllLoader.cpp b/xbmc/cores/DllLoader/Win32DllLoader.cpp index e9b25a39f1..13b21c5e91 100644 --- a/xbmc/cores/DllLoader/Win32DllLoader.cpp +++ b/xbmc/cores/DllLoader/Win32DllLoader.cpp @@ -249,7 +249,7 @@ void Win32DllLoader::OverrideImports(const std::string &dll) if (!image_base) { - CLog::Log(LOGERROR, "%s - unable to GetModuleHandle for dll %s", dll.c_str()); + CLog::Log(LOGERROR, "%s - unable to GetModuleHandle for dll %s", __FUNCTION__, dll.c_str()); return; } @@ -261,7 +261,7 @@ void Win32DllLoader::OverrideImports(const std::string &dll) if (!imp_desc) { - CLog::Log(LOGERROR, "%s - unable to get import directory for dll %s", dll.c_str()); + CLog::Log(LOGERROR, "%s - unable to get import directory for dll %s", __FUNCTION__, dll.c_str()); return; } diff --git a/xbmc/cores/DllLoader/exports/emu_kernel32.cpp b/xbmc/cores/DllLoader/exports/emu_kernel32.cpp index 0ab0c309f3..aad5fb0def 100644 --- a/xbmc/cores/DllLoader/exports/emu_kernel32.cpp +++ b/xbmc/cores/DllLoader/exports/emu_kernel32.cpp @@ -272,8 +272,8 @@ static void DumpSystemInfo(const SYSTEM_INFO* si) { CLog::Log(LOGDEBUG, " Processor architecture %d\n", si->wProcessorArchitecture); CLog::Log(LOGDEBUG, " Page size: %d\n", si->dwPageSize); - CLog::Log(LOGDEBUG, " Minimum app address: %d\n", si->lpMinimumApplicationAddress); - CLog::Log(LOGDEBUG, " Maximum app address: %d\n", si->lpMaximumApplicationAddress); + CLog::Log(LOGDEBUG, " Minimum app address: %p\n", si->lpMinimumApplicationAddress); + CLog::Log(LOGDEBUG, " Maximum app address: %p\n", si->lpMaximumApplicationAddress); CLog::Log(LOGDEBUG, " Active processor mask: 0x%x\n", si->dwActiveProcessorMask); CLog::Log(LOGDEBUG, " Number of processors: %d\n", si->dwNumberOfProcessors); CLog::Log(LOGDEBUG, " Processor type: 0x%x\n", si->dwProcessorType); diff --git a/xbmc/cores/VideoRenderers/DXVAHD.cpp b/xbmc/cores/VideoRenderers/DXVAHD.cpp index fa5559b7e8..c8fd6717ee 100644 --- a/xbmc/cores/VideoRenderers/DXVAHD.cpp +++ b/xbmc/cores/VideoRenderers/DXVAHD.cpp @@ -176,7 +176,7 @@ bool CProcessorHD::InitProcessor() m_bStereoEnabled = true; if (0 != (m_vcaps.FeatureCaps & D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_LEGACY)) - CLog::Log(LOGWARNING, "%s - The video driver does not support full video processing capabilities.", __FUNCTION__, m_vcaps.RateConversionCapsCount); + CLog::Log(LOGWARNING, "%s - The video driver does not support full video processing capabilities.", __FUNCTION__); m_max_back_refs = 0; m_max_fwd_refs = 0; diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp index f16ce04c11..e7e82a2009 100644 --- a/xbmc/cores/VideoRenderers/WinRenderer.cpp +++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp @@ -510,7 +510,7 @@ bool CWinRenderer::CreateIntermediateRenderTarget(unsigned int width, unsigned i if(!m_IntermediateTarget.Create(width, height, 1, D3D11_USAGE_DEFAULT, format)) { - CLog::Log(LOGERROR, __FUNCTION__": intermediate render target creation failed.", format); + CLog::Log(LOGERROR, __FUNCTION__": intermediate render target creation failed."); return false; } return true; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp index 85bca2ae7b..1fc5061ef8 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp @@ -235,10 +235,10 @@ STDMETHODIMP_(ULONG) CDXVADecoderWrapper::AddRef(void) STDMETHODIMP_(ULONG) CDXVADecoderWrapper::Release(void) { - AtomicDecrement(&m_refs); - assert(m_refs >= 0); - if (m_refs == 0) delete this; - return m_refs; + long refs = AtomicDecrement(&m_refs); + assert(refs >= 0); + if (refs == 0) delete this; + return refs; }; STDMETHODIMP CDXVADecoderWrapper::GetBuffer(UINT BufferType, void **ppBuffer, UINT *pBufferSize) @@ -770,7 +770,7 @@ CDecoder::CDecoder() CDecoder::~CDecoder() { - CLog::Log(LOGDEBUG, "%s - destructing decoder, %ld", __FUNCTION__, this); + CLog::Log(LOGDEBUG, "%s - destructing decoder, %p", __FUNCTION__, this); g_Windowing.Unregister(this); Close(); free(m_context->surface); @@ -1167,7 +1167,7 @@ int CDecoder::GetBuffer(AVCodecContext *avctx, AVFrame *pic, int flags) view = m_surface_context->GetFree(view != nullptr ? view : nullptr); if (view == nullptr) { - CLog::Log(LOGERROR, "%s - no surface available - dec: %d, render: %d", __FUNCTION__); + CLog::Log(LOGERROR, "%s - no surface available", __FUNCTION__); m_state = DXVA_LOST; return -1; } diff --git a/xbmc/rendering/dx/RenderSystemDX.cpp b/xbmc/rendering/dx/RenderSystemDX.cpp index 52daea7664..ff35d9bc3c 100644 --- a/xbmc/rendering/dx/RenderSystemDX.cpp +++ b/xbmc/rendering/dx/RenderSystemDX.cpp @@ -158,7 +158,7 @@ void CRenderSystemDX::SetMonitor(HMONITOR monitor) { pAdapter->GetDesc(&m_adapterDesc); - CLog::Log(LOGDEBUG, __FUNCTION__" - Selected %S adapter. ", m_adapterDesc.Description, outputDesc.DeviceName); + CLog::Log(LOGDEBUG, __FUNCTION__" - Selected %S adapter. ", m_adapterDesc.Description); SAFE_RELEASE(m_adapter); m_adapter = pAdapter; diff --git a/xbmc/video/Teletext.cpp b/xbmc/video/Teletext.cpp index 765c75b98e..c5230d22ff 100644 --- a/xbmc/video/Teletext.cpp +++ b/xbmc/video/Teletext.cpp @@ -2854,7 +2854,7 @@ TextPageinfo_t* CTeletextDecoder::DecodePage(bool showl25, // 1=deco PageAtrb[i] = atr; /* decode parity/hamming */ - for (unsigned int i = 40; i < sizeof(PageChar); i++) + for (unsigned int i = 40; i < TELETEXT_PAGE_SIZE; i++) { PageAtrb[i] = atr; p = PageChar + i; diff --git a/xbmc/video/TeletextDefines.h b/xbmc/video/TeletextDefines.h index 74e674ed73..2a519f59b5 100644 --- a/xbmc/video/TeletextDefines.h +++ b/xbmc/video/TeletextDefines.h @@ -24,6 +24,7 @@ #define FLOFSIZE 4 #define SUBTITLE_CACHESIZE 50 +#define TELETEXT_PAGE_SIZE (40 * 25) #define number2char(c) ((c) + (((c) <= 9) ? '0' : ('A' - 10))) @@ -393,8 +394,8 @@ typedef struct { bool Valid; long Timestamp; - unsigned char PageChar[40 * 25]; - TextPageAttr_t PageAtrb[40 * 25]; + unsigned char PageChar[TELETEXT_PAGE_SIZE]; + TextPageAttr_t PageAtrb[TELETEXT_PAGE_SIZE]; } TextSubtitleCache_t; /* main data structure */ |