In-progress work: refactoring PAL not to be instanced.

This removes a lot of useless passing around of the PAL object.
This commit is contained in:
Ben Vanik
2013-03-29 05:07:32 -07:00
parent c46093266e
commit 85bdbd24d1
45 changed files with 444 additions and 189 deletions

View File

@@ -74,9 +74,8 @@ private:
}
DiscImageDevice::DiscImageDevice(xe_pal_ref pal, const char* path,
const xechar_t* local_path) :
Device(pal, path) {
DiscImageDevice::DiscImageDevice(const char* path, const xechar_t* local_path) :
Device(path) {
local_path_ = xestrdup(local_path);
mmap_ = NULL;
gdfx_ = NULL;
@@ -89,7 +88,7 @@ DiscImageDevice::~DiscImageDevice() {
}
int DiscImageDevice::Init() {
mmap_ = xe_mmap_open(pal_, kXEFileModeRead, local_path_, 0, 0);
mmap_ = xe_mmap_open(kXEFileModeRead, local_path_, 0, 0);
if (!mmap_) {
XELOGE("Disc image could not be mapped");
return 1;

View File

@@ -26,7 +26,7 @@ class GDFX;
class DiscImageDevice : public Device {
public:
DiscImageDevice(xe_pal_ref pal, const char* path, const xechar_t* local_path);
DiscImageDevice(const char* path, const xechar_t* local_path);
virtual ~DiscImageDevice();
int Init();

View File

@@ -46,10 +46,7 @@ public:
virtual MemoryMapping* CreateMemoryMapping(
xe_file_mode file_mode, const size_t offset, const size_t length) {
xe_pal_ref pal = device()->pal();
xe_mmap_ref mmap = xe_mmap_open(pal, file_mode, local_path_,
offset, length);
xe_pal_release(pal);
xe_mmap_ref mmap = xe_mmap_open(file_mode, local_path_, offset, length);
if (!mmap) {
return NULL;
}
@@ -70,9 +67,9 @@ private:
}
LocalDirectoryDevice::LocalDirectoryDevice(xe_pal_ref pal, const char* path,
LocalDirectoryDevice::LocalDirectoryDevice(const char* path,
const xechar_t* local_path) :
Device(pal, path) {
Device(path) {
local_path_ = xestrdup(local_path);
}

View File

@@ -23,8 +23,7 @@ namespace fs {
class LocalDirectoryDevice : public Device {
public:
LocalDirectoryDevice(xe_pal_ref pal, const char* path,
const xechar_t* local_path);
LocalDirectoryDevice(const char* path, const xechar_t* local_path);
virtual ~LocalDirectoryDevice();
virtual Entry* ResolvePath(const char* path);