const/void changes in thread, tabctrl and wave files; wxTabCtrl::InsertItem

now returns bool not int.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@93 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-06-14 12:15:13 +00:00
parent eaaa6a06a2
commit ee4f8c2af9
13 changed files with 187 additions and 183 deletions

View File

@@ -14,38 +14,38 @@
#include "wx/wx.h"
wxMutex::wxMutex(void)
wxMutex::wxMutex()
{
m_locked = FALSE;
}
wxMutex::~wxMutex(void)
wxMutex::~wxMutex()
{
}
MutexError wxMutex::Lock(void)
MutexError wxMutex::Lock()
{
m_locked = TRUE;
return NO_ERROR;
}
MutexError wxMutex::TryLock(void)
MutexError wxMutex::TryLock()
{
m_locked = TRUE;
return NO_ERROR;
}
MutexError wxMutex::Unlock(void)
MutexError wxMutex::Unlock()
{
m_locked = FALSE;
return NO_ERROR;
}
wxCondition::wxCondition(void)
wxCondition::wxCondition()
{
}
wxCondition::~wxCondition(void)
wxCondition::~wxCondition()
{
}
@@ -59,11 +59,11 @@ bool wxCondition::Wait(wxMutex& WXUNUSED(mutex), unsigned long WXUNUSED(sec),
return FALSE;
}
void wxCondition::Signal(void)
void wxCondition::Signal()
{
}
void wxCondition::Broadcast(void)
void wxCondition::Broadcast()
{
}
@@ -72,23 +72,23 @@ struct wxThreadPrivate {
void* exit_status;
};
ThreadError wxThread::Create(void)
ThreadError wxThread::Create()
{
p_internal->exit_status = Entry();
OnExit();
return NO_ERROR;
}
ThreadError wxThread::Destroy(void)
ThreadError wxThread::Destroy()
{
return RUNNING;
}
void wxThread::DifferDestroy(void)
void wxThread::DeferDestroy()
{
}
void wxThread::TestDestroy(void)
void wxThread::TestDestroy()
{
}
@@ -97,23 +97,23 @@ void *wxThread::Join()
return p_internal->exit_status;
}
unsigned long wxThread::GetID()
unsigned long wxThread::GetID() const
{
return 0;
}
bool wxThread::IsMain(void)
bool wxThread::IsMain()
{
return TRUE;
}
bool wxThread::IsAlive(void)
bool wxThread::IsAlive() const
{
return FALSE;
}
void wxThread::SetPriority(int WXUNUSED(prio)) { }
int wxThread::GetPriority(void) { }
int wxThread::GetPriority() const { }
wxMutex wxMainMutex; // controls access to all GUI functions

View File

@@ -47,14 +47,14 @@ public:
pthread_mutex_t p_mutex;
};
wxMutex::wxMutex(void)
wxMutex::wxMutex()
{
p_internal = new wxMutexInternal;
pthread_mutex_init(&(p_internal->p_mutex), NULL);
m_locked = false;
}
wxMutex::~wxMutex(void)
wxMutex::~wxMutex()
{
if (m_locked)
pthread_mutex_unlock(&(p_internal->p_mutex));
@@ -62,7 +62,7 @@ wxMutex::~wxMutex(void)
delete p_internal;
}
wxMutexError wxMutex::Lock(void)
wxMutexError wxMutex::Lock()
{
int err;
@@ -74,7 +74,7 @@ wxMutexError wxMutex::Lock(void)
return MUTEX_NO_ERROR;
}
wxMutexError wxMutex::TryLock(void)
wxMutexError wxMutex::TryLock()
{
int err;
@@ -88,7 +88,7 @@ wxMutexError wxMutex::TryLock(void)
return MUTEX_NO_ERROR;
}
wxMutexError wxMutex::Unlock(void)
wxMutexError wxMutex::Unlock()
{
if (m_locked > 0) m_locked--;
pthread_mutex_unlock(&(p_internal->p_mutex));
@@ -104,13 +104,13 @@ public:
pthread_cond_t p_condition;
};
wxCondition::wxCondition(void)
wxCondition::wxCondition()
{
p_internal = new wxConditionInternal;
pthread_cond_init(&(p_internal->p_condition), NULL);
}
wxCondition::~wxCondition(void)
wxCondition::~wxCondition()
{
pthread_cond_destroy(&(p_internal->p_condition));
delete p_internal;
@@ -130,12 +130,12 @@ bool wxCondition::Wait(wxMutex& mutex, unsigned long sec, unsigned long nsec)
return (pthread_cond_timedwait(&(p_internal->p_condition), &(mutex.p_internal->p_mutex), &tspec) != ETIMEDOUT);
}
void wxCondition::Signal(void)
void wxCondition::Signal()
{
pthread_cond_signal(&(p_internal->p_condition));
}
void wxCondition::Broadcast(void)
void wxCondition::Broadcast()
{
pthread_cond_broadcast(&(p_internal->p_condition));
}
@@ -210,7 +210,7 @@ void wxThread::SetPriority(int prio)
p_internal->prio = prio;
}
int wxThread::GetPriority(void)
int wxThread::GetPriority() const
{
return p_internal->prio;
}
@@ -223,7 +223,7 @@ void wxThread::DeferDestroy(bool on)
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
}
wxThreadError wxThread::Destroy(void)
wxThreadError wxThread::Destroy()
{
int res = 0;
@@ -255,7 +255,7 @@ void *wxThread::Join()
return status;
}
unsigned long wxThread::GetID()
unsigned long wxThread::GetID() const
{
return (unsigned long)p_internal->thread_id;
}
@@ -274,7 +274,7 @@ void wxThread::TestDestroy()
pthread_testcancel();
}
bool wxThread::IsMain(void)
bool wxThread::IsMain() const
{
return (bool)pthread_equal(pthread_self(), p_mainid);
}
@@ -300,7 +300,7 @@ void wxThread::OnExit()
class wxThreadModule : public wxModule {
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit(void) {
virtual bool OnInit() {
wxThreadGuiInit();
p_mainid = pthread_self();
wxMainMutex.Lock();
@@ -308,7 +308,7 @@ public:
return TRUE;
}
virtual void OnExit(void) {
virtual void OnExit() {
wxMainMutex.Unlock();
wxThreadGuiExit();
}

View File

@@ -54,20 +54,20 @@ wxMutex::~wxMutex()
{
}
wxMutex::MutexError wxMutex::Lock(void)
wxMutex::MutexError wxMutex::Lock()
{
spin_lock(&(p_internal->p_mutex));
return NO_ERROR;
}
wxMutex::MutexError wxMutex::TryLock(void)
wxMutex::MutexError wxMutex::TryLock()
{
if (acquire_lock(&(p_internal->p_mutex)) != 0)
return BUSY;
return NO_ERROR;
}
wxMutex::MutexError wxMutex::Unlock(void)
wxMutex::MutexError wxMutex::Unlock()
{
release_lock(&(p_internal->p_mutex));
return NO_ERROR;
@@ -75,13 +75,13 @@ wxMutex::MutexError wxMutex::Unlock(void)
// GLH: Don't now how it works on SGI. Wolfram ?
wxCondition::wxCondition(void) {}
wxCondition::~wxCondition(void) {}
wxCondition::wxCondition() {}
wxCondition::~wxCondition() {}
int wxCondition::Wait(wxMutex& WXUNUSED(mutex)) { return 0;}
int wxCondition::Wait(wxMutex& WXUNUSED(mutex), unsigned long WXUNUSED(sec),
unsigned long WXUNUSED(nsec)) { return 0; }
int wxCondition::Signal(void) { return 0; }
int wxCondition::Broadcast(void) { return 0; }
int wxCondition::Signal() { return 0; }
int wxCondition::Broadcast() { return 0; }
class
wxThreadPrivate {
@@ -153,7 +153,7 @@ void *wxThread::Join()
return 0;
}
unsigned long wxThread::GetID()
unsigned long wxThread::GetID() const
{
return (unsigned long)p_internal->thread_id;
}
@@ -170,8 +170,9 @@ void wxThread::SetPriority(int prio)
{
}
int wxThread::GetPriority(void)
int wxThread::GetPriority() const
{
return 0;
}
bool wxThreadIsMain()
@@ -201,13 +202,13 @@ void wxThread::OnExit()
class wxThreadModule : public wxModule {
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit(void) {
virtual bool OnInit() {
wxThreadGuiInit();
p_mainid = (int)getpid();
wxMainMutex.Lock();
}
virtual void OnExit(void) {
virtual void OnExit() {
wxMainMutex.Unlock();
wxThreadGuiExit();
}