diff options
author | Max Horn | 2010-11-05 01:20:34 +0000 |
---|---|---|
committer | Max Horn | 2010-11-05 01:20:34 +0000 |
commit | 7ace85e63646d3fd4843e7f45595bc04f3b2c7dc (patch) | |
tree | 31fb058c695dab2969f5bf6a4f33db6973c20a33 /backends/plugins/wii/wii-provider.cpp | |
parent | 102e7ee88cf04fa470ec372a1ac38846d278d463 (diff) | |
download | scummvm-rg350-7ace85e63646d3fd4843e7f45595bc04f3b2c7dc.tar.gz scummvm-rg350-7ace85e63646d3fd4843e7f45595bc04f3b2c7dc.tar.bz2 scummvm-rg350-7ace85e63646d3fd4843e7f45595bc04f3b2c7dc.zip |
PLUGINS: Simplify ELF plugin providers & DLObject subclasses
* Remove DLObject virtual methods allocSegment and freeSegment.
As long as all DLObject implementations use memalign + free to
allocate/release segments, there is no point in wrapping those.
This enables further simplifications.
* Add TemplatedELFPlugin template class. Use this instead of explicit
ELFPlugin subclasses.
* Rename DLObject::discard_symtab to discardSymtab
svn-id: r54082
Diffstat (limited to 'backends/plugins/wii/wii-provider.cpp')
-rw-r--r-- | backends/plugins/wii/wii-provider.cpp | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/backends/plugins/wii/wii-provider.cpp b/backends/plugins/wii/wii-provider.cpp index 25f54f02de..b05bc59432 100644 --- a/backends/plugins/wii/wii-provider.cpp +++ b/backends/plugins/wii/wii-provider.cpp @@ -32,43 +32,15 @@ #include "backends/plugins/elf/ppc-loader.h" class WiiDLObject : public PPCDLObject { -public: - WiiDLObject() : - PPCDLObject() { - } - - virtual ~WiiDLObject() { - unload(); - } - protected: - virtual void *allocSegment(size_t boundary, size_t size) const { - return memalign(boundary, size); - } - - virtual void freeSegment(void *segment) const { - free(segment); - } - virtual void flushDataCache(void *ptr, uint32 len) const { DCFlushRange(ptr, len); ICInvalidateRange(ptr, len); } }; -class WiiPlugin : public ELFPlugin { -public: - WiiPlugin(const Common::String &filename) : - ELFPlugin(filename) { - } - - virtual DLObject *makeDLObject() { - return new WiiDLObject(); - } -}; - Plugin *WiiPluginProvider::createPlugin(const Common::FSNode &node) const { - return new WiiPlugin(node.getPath()); + return new TemplatedELFPlugin<WiiDLObject>(node.getPath()); } #endif // defined(DYNAMIC_MODULES) && defined(__WII__) |