From ad64336137013a823c212e4e491dbb435aa11e5f Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Sun, 15 Mar 2015 19:28:47 -0700 Subject: [PATCH] quiet some warnings which appear on vs2015. quieted warnings include shadowed variable names and integer extensions. --- Externals/soundtouch/SoundTouch.vcxproj | 4 ++-- .../wxWidgets3/build/msw/wx_base.vcxproj | 1 + Externals/wxWidgets3/include/wx/app.h | 2 +- Externals/wxWidgets3/include/wx/msw/app.h | 2 +- Source/Core/Core/PowerPC/Jit64/Jit.h | 2 +- .../Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 2 +- Source/Core/Core/PowerPC/Jit64IL/JitIL.h | 2 +- Source/Core/DolphinWX/GameListCtrl.cpp | 2 +- Source/Core/VideoBackends/D3D/D3DBase.cpp | 24 +++++++++---------- Source/Core/VideoBackends/D3D/D3DUtil.cpp | 6 ++--- Source/Core/VideoBackends/D3D/Render.cpp | 8 +++---- .../Core/VideoBackends/D3D/TextureCache.cpp | 6 ++--- .../OGL/GLExtensions/GLExtensions.cpp | 2 +- Source/Core/VideoCommon/TextureCacheBase.h | 2 +- Source/VSProps/WXWOverrides.props | 1 - 15 files changed, 32 insertions(+), 34 deletions(-) diff --git a/Externals/soundtouch/SoundTouch.vcxproj b/Externals/soundtouch/SoundTouch.vcxproj index a25a720870..ebcaba69f1 100644 --- a/Externals/soundtouch/SoundTouch.vcxproj +++ b/Externals/soundtouch/SoundTouch.vcxproj @@ -42,7 +42,7 @@ - + @@ -59,7 +59,7 @@ - + diff --git a/Externals/wxWidgets3/build/msw/wx_base.vcxproj b/Externals/wxWidgets3/build/msw/wx_base.vcxproj index 79f52dba8c..a8e473b01a 100644 --- a/Externals/wxWidgets3/build/msw/wx_base.vcxproj +++ b/Externals/wxWidgets3/build/msw/wx_base.vcxproj @@ -1271,6 +1271,7 @@ + diff --git a/Externals/wxWidgets3/include/wx/app.h b/Externals/wxWidgets3/include/wx/app.h index 60e02b35cc..a886dce955 100644 --- a/Externals/wxWidgets3/include/wx/app.h +++ b/Externals/wxWidgets3/include/wx/app.h @@ -541,7 +541,7 @@ public: // very first initialization function // // Override: very rarely - virtual bool Initialize(int& argc, wxChar **argv); + virtual bool Initialize(int& _argc, wxChar **_argv); // a platform-dependent version of OnInit(): the code here is likely to // depend on the toolkit. default version does nothing. diff --git a/Externals/wxWidgets3/include/wx/msw/app.h b/Externals/wxWidgets3/include/wx/msw/app.h index b1b65da13e..fa108cc125 100644 --- a/Externals/wxWidgets3/include/wx/msw/app.h +++ b/Externals/wxWidgets3/include/wx/msw/app.h @@ -29,7 +29,7 @@ public: virtual ~wxApp(); // override base class (pure) virtuals - virtual bool Initialize(int& argc, wxChar **argv); + virtual bool Initialize(int& _argc, wxChar **_argv); virtual void CleanUp(); virtual void WakeUpIdle(); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.h b/Source/Core/Core/PowerPC/Jit64/Jit.h index 323358bacb..0dcfd0b684 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.h +++ b/Source/Core/Core/PowerPC/Jit64/Jit.h @@ -71,7 +71,7 @@ public: // Jit! void Jit(u32 em_address) override; - const u8* DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buffer, JitBlock *b, u32 nextPC); + const u8* DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBlock *b, u32 nextPC); BitSet32 CallerSavedRegistersInUse(); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 014cd133eb..1cc0782980 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -1525,7 +1525,7 @@ void Jit64::rlwimix(UGeckoInstruction inst) bool isRightShift = mask == (1U << inst.SH) - 1; if (gpr.R(a).IsImm()) { - u32 maskA = gpr.R(a).offset & ~mask; + u32 maskA = (u32)gpr.R(a).offset & ~mask; gpr.BindToRegister(a, false, true); MOV(32, gpr.R(a), gpr.R(s)); if (isLeftShift) diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL.h b/Source/Core/Core/PowerPC/Jit64IL/JitIL.h index 27b048727a..7f833d6167 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL.h +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL.h @@ -54,7 +54,7 @@ public: // Jit! void Jit(u32 em_address) override; - const u8* DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buffer, JitBlock *b, u32 nextPC); + const u8* DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBlock *b, u32 nextPC); void Trace(); diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index 0d6cfbf71d..a66b3e7a66 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -402,7 +402,7 @@ static wxString NiceSizeFormat(u64 _size) // div 10 to get largest named unit less than _size // 10 == log2(1024) (number of B in a KiB, KiB in a MiB, etc) const u64 unit = IntLog2(std::max(_size, 1)) / 10; - const u64 unit_size = (1 << (unit * 10)); + const u64 unit_size = (1ull << (unit * 10)); // mul 1000 for 3 decimal places, add 5 to round up, div 10 for 2 decimal places std::string value = std::to_string((_size * 1000 / unit_size + 5) / 10); diff --git a/Source/Core/VideoBackends/D3D/D3DBase.cpp b/Source/Core/VideoBackends/D3D/D3DBase.cpp index 62ce37da76..c3978ad137 100644 --- a/Source/Core/VideoBackends/D3D/D3DBase.cpp +++ b/Source/Core/VideoBackends/D3D/D3DBase.cpp @@ -154,41 +154,41 @@ void UnloadD3DCompiler() std::vector EnumAAModes(IDXGIAdapter* adapter) { - std::vector aa_modes; + std::vector _aa_modes; // NOTE: D3D 10.0 doesn't support multisampled resources which are bound as depth buffers AND shader resources. // Thus, we can't have MSAA with 10.0 level hardware. - ID3D11Device* device; - ID3D11DeviceContext* context; + ID3D11Device* _device; + ID3D11DeviceContext* _context; D3D_FEATURE_LEVEL feat_level; - HRESULT hr = PD3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr, D3D11_CREATE_DEVICE_SINGLETHREADED, supported_feature_levels, NUM_SUPPORTED_FEATURE_LEVELS, D3D11_SDK_VERSION, &device, &feat_level, &context); + HRESULT hr = PD3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr, D3D11_CREATE_DEVICE_SINGLETHREADED, supported_feature_levels, NUM_SUPPORTED_FEATURE_LEVELS, D3D11_SDK_VERSION, &_device, &feat_level, &_context); if (FAILED(hr) || feat_level == D3D_FEATURE_LEVEL_10_0) { DXGI_SAMPLE_DESC desc; desc.Count = 1; desc.Quality = 0; - aa_modes.push_back(desc); - SAFE_RELEASE(context); - SAFE_RELEASE(device); + _aa_modes.push_back(desc); + SAFE_RELEASE(_context); + SAFE_RELEASE(_device); } else { for (int samples = 0; samples < D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT; ++samples) { UINT quality_levels = 0; - device->CheckMultisampleQualityLevels(DXGI_FORMAT_R8G8B8A8_UNORM, samples, &quality_levels); + _device->CheckMultisampleQualityLevels(DXGI_FORMAT_R8G8B8A8_UNORM, samples, &quality_levels); if (quality_levels > 0) { DXGI_SAMPLE_DESC desc; desc.Count = samples; for (desc.Quality = 0; desc.Quality < quality_levels; ++desc.Quality) - aa_modes.push_back(desc); + _aa_modes.push_back(desc); } } - context->Release(); - device->Release(); + _context->Release(); + _device->Release(); } - return aa_modes; + return _aa_modes; } D3D_FEATURE_LEVEL GetFeatureLevel(IDXGIAdapter* adapter) diff --git a/Source/Core/VideoBackends/D3D/D3DUtil.cpp b/Source/Core/VideoBackends/D3D/D3DUtil.cpp index dd54756be1..581b028ac1 100644 --- a/Source/Core/VideoBackends/D3D/D3DUtil.cpp +++ b/Source/Core/VideoBackends/D3D/D3DUtil.cpp @@ -399,10 +399,10 @@ int CD3DFont::DrawTextScaled(float x, float y, float size, float spacing, u32 dw D3D::context->Draw(3 * dwNumTriangles, 0); dwNumTriangles = 0; - D3D11_MAPPED_SUBRESOURCE vbmap; - hr = context->Map(m_pVB, 0, D3D11_MAP_WRITE_DISCARD, 0, &vbmap); + D3D11_MAPPED_SUBRESOURCE _vbmap; + hr = context->Map(m_pVB, 0, D3D11_MAP_WRITE_DISCARD, 0, &_vbmap); if (FAILED(hr)) PanicAlert("Mapping vertex buffer failed, %s %d\n", __FILE__, __LINE__); - pVertices = (D3D::FONT2DVERTEX*)vbmap.pData; + pVertices = (D3D::FONT2DVERTEX*)_vbmap.pData; } sx += w + spacing * scalex * size; } diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index c7204257bd..ec73313476 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -872,10 +872,10 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co if (FramebufferManagerBase::LastXfbWidth() != fbStride || FramebufferManagerBase::LastXfbHeight() != fbHeight) { xfbchanged = true; - unsigned int w = (fbStride < 1 || fbStride > MAX_XFB_WIDTH) ? MAX_XFB_WIDTH : fbStride; - unsigned int h = (fbHeight < 1 || fbHeight > MAX_XFB_HEIGHT) ? MAX_XFB_HEIGHT : fbHeight; - FramebufferManagerBase::SetLastXfbWidth(w); - FramebufferManagerBase::SetLastXfbHeight(h); + unsigned int xfb_w = (fbStride < 1 || fbStride > MAX_XFB_WIDTH) ? MAX_XFB_WIDTH : fbStride; + unsigned int xfb_h = (fbHeight < 1 || fbHeight > MAX_XFB_HEIGHT) ? MAX_XFB_HEIGHT : fbHeight; + FramebufferManagerBase::SetLastXfbWidth(xfb_w); + FramebufferManagerBase::SetLastXfbHeight(xfb_h); } // Flip/present backbuffer to frontbuffer here diff --git a/Source/Core/VideoBackends/D3D/TextureCache.cpp b/Source/Core/VideoBackends/D3D/TextureCache.cpp index b13397be38..92293bdac9 100644 --- a/Source/Core/VideoBackends/D3D/TextureCache.cpp +++ b/Source/Core/VideoBackends/D3D/TextureCache.cpp @@ -65,7 +65,7 @@ bool TextureCache::TCacheEntry::Save(const std::string& filename, unsigned int l D3D::context->CopyResource(pNewTexture, pSurface); D3D11_MAPPED_SUBRESOURCE map; - HRESULT hr = D3D::context->Map(pNewTexture, 0, D3D11_MAP_READ_WRITE, 0, &map); + hr = D3D::context->Map(pNewTexture, 0, D3D11_MAP_READ_WRITE, 0, &map); if (SUCCEEDED(hr)) { saved_png = TextureToPng((u8*)map.pData, map.RowPitch, filename, desc.Width, desc.Height); @@ -177,13 +177,11 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo u8* dst = Memory::GetPointer(dstAddr); size_t encoded_size = g_encoder->Encode(dst, dstFormat, srcFormat, srcRect, isIntensity, scaleByHalf); - u64 hash = GetHash64(dst, (int)encoded_size, g_ActiveConfig.iSafeTextureCache_ColorSamples); - size_in_bytes = (u32)encoded_size; TextureCache::MakeRangeDynamic(dstAddr, (u32)encoded_size); - this->hash = hash; + this->hash = GetHash64(dst, (int)encoded_size, g_ActiveConfig.iSafeTextureCache_ColorSamples); } } diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp index 296cbfc3cb..393cb0d404 100644 --- a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp +++ b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp @@ -1912,7 +1912,7 @@ namespace GLExtensions *func = dlsym(RTLD_NEXT, name.c_str()); #endif if (*func == nullptr && _isES) - *func = (void*)0xFFFFFFFF; // Easy to determine invalid function, just so we continue on + *func = (void*)(uintptr_t)0xFFFFFFFF; // Easy to determine invalid function, just so we continue on if (*func == nullptr) ERROR_LOG(VIDEO, "Couldn't load function %s", name.c_str()); } diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index e048a3ff3c..b76883173b 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -104,7 +104,7 @@ public: // Removes textures which aren't used for more than TEXTURE_KILL_THRESHOLD frames, // frameCount is the current frame number. - static void Cleanup(int frameCount); + static void Cleanup(int _frameCount); static void Invalidate(); static void MakeRangeDynamic(u32 start_address, u32 size); diff --git a/Source/VSProps/WXWOverrides.props b/Source/VSProps/WXWOverrides.props index 7b7c253709..a4617484bc 100644 --- a/Source/VSProps/WXWOverrides.props +++ b/Source/VSProps/WXWOverrides.props @@ -8,7 +8,6 @@ Use wx/wxprec.h Async - 4267;%(DisableSpecificWarnings) __WXMSW__;WXBUILDING;%(PreprocessorDefinitions) ..\..\;..\..\include;..\..\..\xxhash;..\..\..\zlib;..\..\..\libpng