fixes to get llvm to compile (excepti for utils.cpp, that'll get fixed

later)

Eradicate the Array almost everywhere, some usages like Stack still
remains
This commit is contained in:
Bigpet 2014-04-10 00:54:32 +02:00 committed by Peter Tissen
parent d65968b41d
commit 25c3aa8e19
92 changed files with 931 additions and 1305 deletions

View file

@ -18,7 +18,7 @@ CPUThreadManager::~CPUThreadManager()
void CPUThreadManager::Close()
{
m_raw_spu_num = 0;
while(m_threads.GetCount()) RemoveThread(m_threads[0].GetId());
while(m_threads.size()) RemoveThread(m_threads[0]->GetId());
}
CPUThread& CPUThreadManager::AddThread(CPUThreadType type)
@ -38,7 +38,7 @@ CPUThread& CPUThreadManager::AddThread(CPUThreadType type)
new_thread->SetId(Emu.GetIdManager().GetNewID(fmt::Format("%s Thread", new_thread->GetTypeString().c_str()), new_thread));
m_threads.Add(new_thread);
m_threads.push_back(new_thread);
#ifndef QT_UI
wxGetApp().SendDbgCommand(DID_CREATE_THREAD, new_thread);
#endif
@ -50,23 +50,23 @@ void CPUThreadManager::RemoveThread(const u32 id)
{
std::lock_guard<std::mutex> lock(m_mtx_thread);
for(u32 i=0; i<m_threads.GetCount(); ++i)
for(u32 i=0; i<m_threads.size(); ++i)
{
if(m_threads[i].m_wait_thread_id == id)
if(m_threads[i]->m_wait_thread_id == id)
{
m_threads[i].Wait(false);
m_threads[i].m_wait_thread_id = -1;
m_threads[i]->Wait(false);
m_threads[i]->m_wait_thread_id = -1;
}
if(m_threads[i].GetId() != id) continue;
if(m_threads[i]->GetId() != id) continue;
CPUThread* thr = &m_threads[i];
CPUThread* thr = m_threads[i];
#ifndef QT_UI
wxGetApp().SendDbgCommand(DID_REMOVE_THREAD, thr);
#endif
thr->Close();
m_threads.RemoveFAt(i);
m_threads.erase(m_threads.begin()+ i);
break;
}
@ -80,10 +80,10 @@ s32 CPUThreadManager::GetThreadNumById(CPUThreadType type, u32 id)
s32 num = 0;
for(u32 i=0; i<m_threads.GetCount(); ++i)
for(u32 i=0; i<m_threads.size(); ++i)
{
if(m_threads[i].GetId() == id) return num;
if(m_threads[i].GetType() == type) num++;
if(m_threads[i]->GetId() == id) return num;
if(m_threads[i]->GetType() == type) num++;
}
return -1;
@ -104,8 +104,8 @@ void CPUThreadManager::Exec()
{
std::lock_guard<std::mutex> lock(m_mtx_thread);
for(u32 i=0; i<m_threads.GetCount(); ++i)
for(u32 i=0; i<m_threads.size(); ++i)
{
m_threads[i].Exec();
m_threads[i]->Exec();
}
}