From dae9e5792a4f030ae9e748548a16a89790fbd311 Mon Sep 17 00:00:00 2001 From: tycho Date: Sun, 24 May 2015 12:56:56 +0100 Subject: Made -Weverything an error. --- src/LightingThread.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/LightingThread.cpp') diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index effde03d0..266744a24 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -43,8 +43,8 @@ class cReader : { // Copy the entire heightmap, distribute it into the 3x3 chunk blob: typedef struct {HEIGHTTYPE m_Row[16]; } ROW; - ROW * InputRows = (ROW *)a_Heightmap; - ROW * OutputRows = (ROW *)m_HeightMap; + const ROW * InputRows = reinterpret_cast(a_Heightmap); + ROW * OutputRows = reinterpret_cast(m_HeightMap); int InputIdx = 0; int OutputIdx = m_ReadingChunkX + m_ReadingChunkZ * cChunkDef::Width * 3; for (int z = 0; z < cChunkDef::Width; z++) @@ -217,7 +217,7 @@ void cLightingThread::Execute(void) { continue; } - Item = (cLightingChunkStay *)m_Queue.front(); + Item = static_cast(m_Queue.front()); m_Queue.pop_front(); if (m_Queue.empty()) { -- cgit v1.2.3 From 06a74e45e247a2d23c6b5a238a3c1b9b17b6c341 Mon Sep 17 00:00:00 2001 From: tycho Date: Sat, 30 May 2015 11:11:17 +0100 Subject: Made cLightingThread own its callbacks --- src/LightingThread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/LightingThread.cpp') diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index 266744a24..7f13a94fd 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -149,11 +149,11 @@ void cLightingThread::Stop(void) -void cLightingThread::QueueChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_CallbackAfter) +void cLightingThread::QueueChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr a_CallbackAfter) { ASSERT(m_World != nullptr); // Did you call Start() properly? - cChunkStay * ChunkStay = new cLightingChunkStay(*this, a_ChunkX, a_ChunkZ, a_CallbackAfter); + cChunkStay * ChunkStay = new cLightingChunkStay(*this, a_ChunkX, a_ChunkZ, std::move(a_CallbackAfter)); { // The ChunkStay will enqueue itself using the QueueChunkStay() once it is fully loaded // In the meantime, put it into the PendingQueue so that it can be removed when stopping the thread @@ -599,11 +599,11 @@ void cLightingThread::QueueChunkStay(cLightingChunkStay & a_ChunkStay) //////////////////////////////////////////////////////////////////////////////// // cLightingThread::cLightingChunkStay: -cLightingThread::cLightingChunkStay::cLightingChunkStay(cLightingThread & a_LightingThread, int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_CallbackAfter) : +cLightingThread::cLightingChunkStay::cLightingChunkStay(cLightingThread & a_LightingThread, int a_ChunkX, int a_ChunkZ, std::unique_ptr a_CallbackAfter) : m_LightingThread(a_LightingThread), m_ChunkX(a_ChunkX), m_ChunkZ(a_ChunkZ), - m_CallbackAfter(a_CallbackAfter) + m_CallbackAfter(std::move(a_CallbackAfter)) { Add(a_ChunkX + 1, a_ChunkZ + 1); Add(a_ChunkX + 1, a_ChunkZ); -- cgit v1.2.3