No real changes, just use const_cast<> instead of C casts.
Replace many comments indicating that the C cast used was really a const_cast<> with the proper cast itself. There is no reason to not use it any longer, all the supported compilers understand it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1180,28 +1180,28 @@ void wxThread::SetPriority(unsigned int prio)
|
||||
|
||||
unsigned int wxThread::GetPriority() const
|
||||
{
|
||||
wxCriticalSectionLocker lock((wxCriticalSection &)m_critsect); // const_cast
|
||||
wxCriticalSectionLocker lock(const_cast<wxCriticalSection &>(m_critsect));
|
||||
|
||||
return m_internal->GetPriority();
|
||||
}
|
||||
|
||||
unsigned long wxThread::GetId() const
|
||||
{
|
||||
wxCriticalSectionLocker lock((wxCriticalSection &)m_critsect); // const_cast
|
||||
wxCriticalSectionLocker lock(const_cast<wxCriticalSection &>(m_critsect));
|
||||
|
||||
return (unsigned long)m_internal->GetId();
|
||||
}
|
||||
|
||||
bool wxThread::IsRunning() const
|
||||
{
|
||||
wxCriticalSectionLocker lock((wxCriticalSection &)m_critsect); // const_cast
|
||||
wxCriticalSectionLocker lock(const_cast<wxCriticalSection &>(m_critsect));
|
||||
|
||||
return m_internal->GetState() == STATE_RUNNING;
|
||||
}
|
||||
|
||||
bool wxThread::IsAlive() const
|
||||
{
|
||||
wxCriticalSectionLocker lock((wxCriticalSection &)m_critsect); // const_cast
|
||||
wxCriticalSectionLocker lock(const_cast<wxCriticalSection &>(m_critsect));
|
||||
|
||||
return (m_internal->GetState() == STATE_RUNNING) ||
|
||||
(m_internal->GetState() == STATE_PAUSED);
|
||||
@@ -1209,14 +1209,14 @@ bool wxThread::IsAlive() const
|
||||
|
||||
bool wxThread::IsPaused() const
|
||||
{
|
||||
wxCriticalSectionLocker lock((wxCriticalSection &)m_critsect); // const_cast
|
||||
wxCriticalSectionLocker lock(const_cast<wxCriticalSection &>(m_critsect));
|
||||
|
||||
return m_internal->GetState() == STATE_PAUSED;
|
||||
}
|
||||
|
||||
bool wxThread::TestDestroy()
|
||||
{
|
||||
wxCriticalSectionLocker lock((wxCriticalSection &)m_critsect); // const_cast
|
||||
wxCriticalSectionLocker lock(const_cast<wxCriticalSection &>(m_critsect));
|
||||
|
||||
return m_internal->GetState() == STATE_CANCELED;
|
||||
}
|
||||
|
Reference in New Issue
Block a user