diff options
| author | Matthew Parlane <parlane@gmail.com> | 2014-03-10 09:24:09 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2014-03-10 09:24:09 +1300 |
| commit | 633dc75e857d649ffab7c4398e92536bccc9e1de (patch) | |
| tree | f9aa8831a0731ea246bd921d979f4bffa7f07bd0 /Source/Core/VideoBackends/Software | |
| parent | f4012638672472afdbd9956229f273a18a77fd77 (diff) | |
| parent | d802d392811be44d34ae9cd23f616db93e54c50f (diff) | |
Merge pull request #142 from Tilka/clang-modernize
Run clang-modernize and manually fix the result
Diffstat (limited to 'Source/Core/VideoBackends/Software')
10 files changed, 35 insertions, 27 deletions
diff --git a/Source/Core/VideoBackends/Software/BPMemLoader.cpp b/Source/Core/VideoBackends/Software/BPMemLoader.cpp index 738b909fc0..7672e233ac 100644 --- a/Source/Core/VideoBackends/Software/BPMemLoader.cpp +++ b/Source/Core/VideoBackends/Software/BPMemLoader.cpp @@ -100,7 +100,7 @@ void SWBPWritten(int address, int newvalue) u32 tlutTMemAddr = (newvalue & 0x3FF) << 9; u32 tlutXferCount = (newvalue & 0x1FFC00) >> 5; - u8 *ptr = 0; + u8 *ptr = nullptr; // TODO - figure out a cleaner way. if (Core::g_CoreStartupParameter.bWii) diff --git a/Source/Core/VideoBackends/Software/DebugUtil.cpp b/Source/Core/VideoBackends/Software/DebugUtil.cpp index 6b5b1f7c7d..e6995b5068 100644 --- a/Source/Core/VideoBackends/Software/DebugUtil.cpp +++ b/Source/Core/VideoBackends/Software/DebugUtil.cpp @@ -39,7 +39,7 @@ void Init() { memset(ObjectBuffer[i], 0, sizeof(ObjectBuffer[i])); DrawnToBuffer[i] = false; - ObjectBufferName[i] = 0; + ObjectBufferName[i] = nullptr; BufferBase[i] = 0; } } diff --git a/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp b/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp index 069876741d..ff2b4f0bb8 100644 --- a/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp +++ b/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp @@ -19,7 +19,7 @@ typedef void (*DecodingFunction)(u32); namespace OpcodeDecoder { -static DecodingFunction currentFunction = NULL; +static DecodingFunction currentFunction = nullptr; static u32 minCommandSize; static u16 streamSize; static u16 streamAddress; diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp index 13f1d89642..80be2adada 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.cpp +++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp @@ -54,12 +54,12 @@ void DoState(PointerWrap &p) { ZSlope.DoState(p); WSlope.DoState(p); - for (auto& ColorSlope : ColorSlopes) - for (int n=0; n<4; ++n) - ColorSlope[n].DoState(p); - for (auto& TexSlope : TexSlopes) - for (int n=0; n<3; ++n) - TexSlope[n].DoState(p); + for (auto& color_slopes_1d : ColorSlopes) + for (Slope& color_slope : color_slopes_1d) + color_slope.DoState(p); + for (auto& tex_slopes_1d : TexSlopes) + for (Slope& tex_slope : tex_slopes_1d) + tex_slope.DoState(p); p.Do(vertex0X); p.Do(vertex0Y); p.Do(vertexOffsetX); diff --git a/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp b/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp index d8288adc1a..8329024e3a 100644 --- a/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp +++ b/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp @@ -101,7 +101,7 @@ void Init() interruptSet = false; interruptWaiting = false; - g_pVideoData = 0; + g_pVideoData = nullptr; g_bSkipCurrentFrame = false; } diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index c56390ba90..deb934ee2f 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -28,7 +28,7 @@ static std::string s_sScreenshotName; // Rasterfont isn't compatible with GLES // degasus: I think it does, but I can't test it -RasterFont* s_pfont = NULL; +RasterFont* s_pfont = nullptr; void SWRenderer::Init() { @@ -44,7 +44,7 @@ void SWRenderer::Shutdown() if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL) { delete s_pfont; - s_pfont = 0; + s_pfont = nullptr; } } diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index fbecdaeb79..63d96dcd2c 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -40,7 +40,7 @@ SWVertexLoader::SWVertexLoader() : SWVertexLoader::~SWVertexLoader() { delete m_SetupUnit; - m_SetupUnit = NULL; + m_SetupUnit = nullptr; } void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) @@ -89,8 +89,8 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) m_VertexSize = 0; // Reset pipeline - m_positionLoader = NULL; - m_normalLoader = NULL; + m_positionLoader = nullptr; + m_normalLoader = nullptr; m_NumAttributeLoaders = 0; // Reset vertex @@ -164,7 +164,7 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) m_normalLoader = VertexLoader_Normal::GetFunction(g_VtxDesc.Normal, m_CurrentVat->g0.NormalFormat, m_CurrentVat->g0.NormalElements, m_CurrentVat->g0.NormalIndex3); - if (m_normalLoader == 0) + if (m_normalLoader == nullptr) { ERROR_LOG(VIDEO, "VertexLoader_Normal::GetFunction returned zero!"); } @@ -176,7 +176,7 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) switch (colDesc[i]) { case NOT_PRESENT: - m_colorLoader[i] = NULL; + m_colorLoader[i] = nullptr; break; case DIRECT: switch (colComp[i]) diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index c5178f682c..4651e444a4 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -60,7 +60,7 @@ std::string VideoSoftware::GetName() void *DllDebugger(void *_hParent, bool Show) { - return NULL; + return nullptr; } void VideoSoftware::ShowConfig(void *_hParent) diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp index 5ebdcd714c..dc4c4904cf 100644 --- a/Source/Core/VideoBackends/Software/Tev.cpp +++ b/Source/Core/VideoBackends/Software/Tev.cpp @@ -33,8 +33,10 @@ void Tev::Init() FixedConstants[7] = 223; FixedConstants[8] = 255; - for (int i = 0; i < 4; i++) - Zero16[i] = 0; + for (s16& comp : Zero16) + { + comp = 0; + } m_ColorInputLUT[0][RED_INP] = &Reg[0][RED_C]; m_ColorInputLUT[0][GRN_INP] = &Reg[0][GRN_C]; m_ColorInputLUT[0][BLU_INP] = &Reg[0][BLU_C]; // prev.rgb m_ColorInputLUT[1][RED_INP] = &Reg[0][ALP_C]; m_ColorInputLUT[1][GRN_INP] = &Reg[0][ALP_C]; m_ColorInputLUT[1][BLU_INP] = &Reg[0][ALP_C]; // prev.aaa @@ -148,21 +150,27 @@ void Tev::SetRasColor(int colorChan, int swaptable) break; case 5: // alpha bump { - for(int i = 0; i < 4; i++) - RasColor[i] = AlphaBump; + for (s16& comp : RasColor) + { + comp = AlphaBump; + } } break; case 6: // alpha bump normalized { u8 normalized = AlphaBump | AlphaBump >> 5; - for(int i = 0; i < 4; i++) - RasColor[i] = normalized; + for (s16& comp : RasColor) + { + comp = normalized; + } } break; default: // zero { - for(int i = 0; i < 4; i++) - RasColor[i] = 0; + for (s16& comp : RasColor) + { + comp = 0; + } } break; } diff --git a/Source/Core/VideoBackends/Software/TextureSampler.cpp b/Source/Core/VideoBackends/Software/TextureSampler.cpp index 87ac79563b..b77248ff9d 100644 --- a/Source/Core/VideoBackends/Software/TextureSampler.cpp +++ b/Source/Core/VideoBackends/Software/TextureSampler.cpp @@ -106,7 +106,7 @@ void SampleMip(s32 s, s32 t, s32 mip, bool linear, u8 texmap, u8 *sample) TexImage0& ti0 = texUnit.texImage0[subTexmap]; TexTLUT& texTlut = texUnit.texTlut[subTexmap]; - u8 *imageSrc, *imageSrcOdd = NULL; + u8 *imageSrc, *imageSrcOdd = nullptr; if (texUnit.texImage1[subTexmap].image_type) { imageSrc = &texMem[texUnit.texImage1[subTexmap].tmem_even * TMEM_LINE_SIZE]; |
