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

@ -19,9 +19,9 @@ void VFS::Mount(const std::string& ps3_path, const std::string& local_path, vfsD
UnMount(ps3_path);
device->SetPath(ps3_path, local_path);
m_devices.Add(device);
m_devices.push_back(device);
if(m_devices.GetCount() > 1)
if(m_devices.size() > 1)
{
//std::qsort(m_devices.GetPtr(), m_devices.GetCount(), sizeof(vfsDevice*), sort_devices);
}
@ -29,12 +29,12 @@ void VFS::Mount(const std::string& ps3_path, const std::string& local_path, vfsD
void VFS::UnMount(const std::string& ps3_path)
{
for(u32 i=0; i<m_devices.GetCount(); ++i)
for(u32 i=0; i<m_devices.size(); ++i)
{
if(!m_devices[i].GetPs3Path().compare(ps3_path))
if(!m_devices[i]->GetPs3Path().compare(ps3_path))
{
delete &m_devices[i];
m_devices.RemoveFAt(i);
delete m_devices[i];
m_devices.erase(m_devices.begin() +i);
return;
}
@ -43,10 +43,10 @@ void VFS::UnMount(const std::string& ps3_path)
void VFS::UnMountAll()
{
for(u32 i=0; i<m_devices.GetCount(); ++i)
for(u32 i=0; i<m_devices.size(); ++i)
{
delete &m_devices[i];
m_devices.RemoveFAt(i);
delete m_devices[i];
m_devices.erase(m_devices.begin() +i);
}
}
@ -214,9 +214,9 @@ vfsDevice* VFS::GetDevice(const std::string& ps3_path, std::string& path) const
u32 max_eq;
s32 max_i=-1;
for(u32 i=0; i<m_devices.GetCount(); ++i)
for(u32 i=0; i<m_devices.size(); ++i)
{
const u32 eq = m_devices[i].CmpPs3Path(ps3_path);
const u32 eq = m_devices[i]->CmpPs3Path(ps3_path);
if(max_i < 0 || eq > max_eq)
{
@ -226,8 +226,8 @@ vfsDevice* VFS::GetDevice(const std::string& ps3_path, std::string& path) const
}
if(max_i < 0) return nullptr;
path = vfsDevice::GetWinPath(m_devices[max_i].GetLocalPath(), ps3_path.substr(max_eq, ps3_path.length() - max_eq));
return &m_devices[max_i];
path = vfsDevice::GetWinPath(m_devices[max_i]->GetLocalPath(), ps3_path.substr(max_eq, ps3_path.length() - max_eq));
return m_devices[max_i];
}
vfsDevice* VFS::GetDeviceLocal(const std::string& local_path, std::string& path) const
@ -239,9 +239,9 @@ vfsDevice* VFS::GetDeviceLocal(const std::string& local_path, std::string& path)
file_path.Normalize();
std::string mormalized_path = fmt::ToUTF8(file_path.GetFullPath());
for(u32 i=0; i<m_devices.GetCount(); ++i)
for(u32 i=0; i<m_devices.size(); ++i)
{
const u32 eq = m_devices[i].CmpLocalPath(mormalized_path);
const u32 eq = m_devices[i]->CmpLocalPath(mormalized_path);
if(max_i < 0 || eq > max_eq)
{
@ -252,8 +252,8 @@ vfsDevice* VFS::GetDeviceLocal(const std::string& local_path, std::string& path)
if(max_i < 0) return nullptr;
path = vfsDevice::GetPs3Path(m_devices[max_i].GetPs3Path(), local_path.substr(max_eq, local_path.length() - max_eq));
return &m_devices[max_i];
path = vfsDevice::GetPs3Path(m_devices[max_i]->GetPs3Path(), local_path.substr(max_eq, local_path.length() - max_eq));
return m_devices[max_i];
}
void VFS::Init(const std::string& path)