From: <sv...@ww...> - 2004-10-17 08:58:09
|
Author: delta Date: 2004-06-19 13:20:27 -0700 (Sat, 19 Jun 2004) New Revision: 1290 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/AtomicCounter.h trunk/CSP/SimData/Include/SimData/CircularBuffer.h trunk/CSP/SimData/Include/SimData/Thread.h Log: * Fix a few asserts making vs angry (Thread.h). * Fix a few cast warnings under vs. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1290 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-10-09 21:38:07 UTC (rev 1289) +++ trunk/CSP/SimData/CHANGES.current 2004-06-19 20:20:27 UTC (rev 1290) @@ -1,8 +1,13 @@ Version 0.4.0 (in progress) =========================== +2004-10-17: delta + * Fix a few asserts making vs angry (Thread.h). + + * Fix a few cast warnings under vs. + 2004-10-09: onsight - * Fix Timer::reset() + * Fix Timer::reset(). * Move TaggedRecordRegistry methods to .cpp file, add a factory lookup method. @@ -28,13 +33,13 @@ * Used Interlocked* instead of _Interlocked* in AtomicCounter.h. - * Removed ospath namespace in front of stripFileExtension. + * Removed ospath namespace in front of stripFileExtension (FileUtility.h). * Added #define NOMINMAX in FileUtility.cpp to avoid usual conflicts - including windows.h. + when including windows.h. * Changed "contents" into "entries" in getDirectoryContents (_WIN32) from - FileUtility.cpp. Changed FileClosed into FindClose. + FileUtility.cpp. Changed FileClose into FindClose. * Exported _log_reference_count_error & _log_reference_conversion_error from LogStream.cpp. Modified: trunk/CSP/SimData/Include/SimData/AtomicCounter.h =================================================================== --- trunk/CSP/SimData/Include/SimData/AtomicCounter.h 2004-10-09 21:38:07 UTC (rev 1289) +++ trunk/CSP/SimData/Include/SimData/AtomicCounter.h 2004-06-19 20:20:27 UTC (rev 1290) @@ -68,6 +68,7 @@ # define SIMDATA_ATOMIC_INC(x) InterlockedIncrement(&x) ? false : true; # define SIMDATA_ATOMIC_GET(x) x # define SIMDATA_ATOMIC_TYPE volatile LONG +// XXX: eventually, rewrite it with intrinsic functions. //# pragma intrinsic (_InterlockedExchange) //# pragma intrinsic (_InterlockedDecrement) //# pragma intrinsic (_InterlockedIncrement) Modified: trunk/CSP/SimData/Include/SimData/CircularBuffer.h =================================================================== --- trunk/CSP/SimData/Include/SimData/CircularBuffer.h 2004-10-09 21:38:07 UTC (rev 1289) +++ trunk/CSP/SimData/Include/SimData/CircularBuffer.h 2004-06-19 20:20:27 UTC (rev 1290) @@ -277,7 +277,7 @@ if (read - m_write <= RESERVE) return 0; return read - m_write - RESERVE - 1; } - uint32 space = std::max(read, m_size - m_write); + uint32 space = std::max<uint32>(read, m_size - m_write); if (space > RESERVE) return space - RESERVE - 1; return 0; } Modified: trunk/CSP/SimData/Include/SimData/Thread.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Thread.h 2004-10-09 21:38:07 UTC (rev 1289) +++ trunk/CSP/SimData/Include/SimData/Thread.h 2004-06-19 20:20:27 UTC (rev 1290) @@ -199,11 +199,11 @@ */ static void *_start(void *param) { Ref<Task> *task_ptr = static_cast<Ref<Task>*>(param); - assert(task_ptr); + assert(task_ptr != 0); Ref<Task> task = *task_ptr; // delete param (we own it and it has served its purpose) delete task_ptr; - assert(task); + assert(task.valid()); // execute the task task->_execute(); // drop our reference to the task |