scummvm/engines
Colin Snover d087c9605f BASE: Remove bad casts between incompatible Plugin types
Previously, a C-style cast was used to convert a
Common::Array<Plugin *>, populated with pointers to StaticPlugin
and DynamicPlugin instances, to a
Common::Array<PluginSubclass<T> *>, but PluginSubclass<T> is a
*sibling* class to StaticPlugin/DynamicPlugin, so this cast was
invalid and the results undefined. The methods for retrieving
subclasses of plugins can't be easily changed to just generate an
array of temporary wrapper objects that expose an identical API
which dereferences to the preferred PluginObject subclass because
pointers to these objects are retained by other parts of ScummVM,
so the wrappers would needed to be persisted or they would need to
just re-expose the underlying Plugin object again. This indicated
that a way to solve this problem is to have the callers receive
Plugin objects and get the PluginObject from the Plugin by
explicitly stating their desired type, in a similar manner to
std::get(std::variant), so that the pattern used by this patch to
solve the problem.

Closes gh-1051.
2017-12-03 20:26:38 -06:00
..
access
adl
agi
agos
avalanche
bbvs
bladerunner
cge
cge2
chewy
cine
composer JANITORIAL: Remove trailing whitespaces 2017-11-26 11:16:31 +01:00
cruise
cryo
director
dm
draci
drascula
dreamweb
fullpipe FULLPIPE: Renames in ExCommand 2017-12-03 23:04:58 +01:00
gnap
gob
groovie
hopkins
hugo
kyra
lab
lastexpress
lure
macventure
made
mads
mohawk MOHAWK: RIVEN: Ignore key repeat events 2017-11-26 15:11:22 +01:00
mortevielle
neverhood BASE: Remove bad casts between incompatible Plugin types 2017-12-03 20:26:38 -06:00
parallaction
pegasus BASE: Remove bad casts between incompatible Plugin types 2017-12-03 20:26:38 -06:00
plumbers PLUMBERS: Remove unstable flag and enable by default 2017-11-26 01:56:48 +00:00
prince
queen
saga
sci SCI: Avoid buffer overflow in amigamac sound driver 2017-12-03 12:49:11 +01:00
scumm SCUMM: Fix array overflow writing var when no current script is set 2017-12-01 19:39:30 -06:00
sherlock
sky
sludge
sword1
sword2
sword25
teenagent
testbed
tinsel
titanic
toltecs
tony
toon
touche
tsage
tucker
voyeur
wage
wintermute
xeen XEEN: Fix drawing outer frame for automap dialog 2017-12-03 20:57:56 -05:00
zvision
advancedDetector.cpp
advancedDetector.h
dialogs.cpp
dialogs.h
engine.cpp
engine.h
game.cpp
game.h
logo_data.h
metaengine.h BASE: Remove bad casts between incompatible Plugin types 2017-12-03 20:26:38 -06:00
module.mk
obsolete.cpp
obsolete.h
savestate.cpp
savestate.h
util.h