Use correct function type pointers in wxQTMediaBackend code

This avoids gcc 8 -Wcast-function-type warnings while not being
obviously less (nor more...) correct than the old version.
This commit is contained in:
Vadim Zeitlin
2018-05-29 13:34:57 +02:00
parent ef26c969cb
commit f75bee21ec

View File

@@ -160,6 +160,11 @@ enum
mcWithFrame = 16
};
typedef void (*PPRMProcType)(Movie theMovie, OSErr theErr, void* theRefCon);
typedef Boolean (*MCFilterProcType)(MovieController theController,
short action, void *params,
LONG_PTR refCon);
//---------------------------------------------------------------------------
// QT Library
//---------------------------------------------------------------------------
@@ -246,7 +251,7 @@ public:
wxDL_VOIDMETHOD_DEFINE(DisposeMovieController, (ComponentInstance ci), (ci))
wxDL_METHOD_DEFINE(int, MCSetVisible, (ComponentInstance m, int b), (m, b), 0)
wxDL_VOIDMETHOD_DEFINE(PrePrerollMovie, (Movie m, long t, Fixed r, WXFARPROC p1, void* p2), (m,t,r,p1,p2) )
wxDL_VOIDMETHOD_DEFINE(PrePrerollMovie, (Movie m, long t, Fixed r, PPRMProcType p1, void* p2), (m,t,r,p1,p2) )
wxDL_VOIDMETHOD_DEFINE(PrerollMovie, (Movie m, long t, Fixed r), (m,t,r) )
wxDL_METHOD_DEFINE(Fixed, GetMoviePreferredRate, (Movie m), (m), 0)
wxDL_METHOD_DEFINE(long, GetMovieLoadState, (Movie m), (m), 0)
@@ -263,7 +268,7 @@ public:
wxDL_VOIDMETHOD_DEFINE(MCPositionController,
(ComponentInstance ci, Rect* r, void* junk, void* morejunk), (ci,r,junk,morejunk))
wxDL_VOIDMETHOD_DEFINE(MCSetActionFilterWithRefCon,
(ComponentInstance ci, WXFARPROC cb, void* ref), (ci,cb,ref))
(ComponentInstance ci, MCFilterProcType cb, void* ref), (ci,cb,ref))
wxDL_VOIDMETHOD_DEFINE(MCGetControllerInfo, (MovieController mc, long* flags), (mc,flags))
wxDL_VOIDMETHOD_DEFINE(BeginUpdate, (CGrafPtr port), (port))
wxDL_VOIDMETHOD_DEFINE(UpdateMovie, (Movie m), (m))
@@ -805,8 +810,8 @@ bool wxQTMediaBackend::Load(const wxURI& location)
// which we don't by default.
//
m_lib.PrePrerollMovie(m_movie, timeNow, playRate,
(WXFARPROC)wxQTMediaBackend::PPRMProc,
(void*)this);
wxQTMediaBackend::PPRMProc,
this);
return true;
}
@@ -1120,7 +1125,7 @@ bool wxQTMediaBackend::ShowPlayerControls(wxMediaCtrlPlayerControls flags)
mcWithFrame);
m_lib.MCDoAction(m_pMC, 32, (void*)true); // mcActionSetKeysEnabled
m_lib.MCSetActionFilterWithRefCon(m_pMC,
(WXFARPROC)wxQTMediaBackend::MCFilterProc, (void*)this);
wxQTMediaBackend::MCFilterProc, this);
m_bestSize.y += 16; // movie controller height
// By default the movie controller uses its own colour palette