mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Using safer casts.
This commit is contained in:
@@ -6,7 +6,7 @@ XPCAircraft::XPCAircraft(
|
|||||||
const char * inLivery)
|
const char * inLivery)
|
||||||
{
|
{
|
||||||
mPlane = XPMPCreatePlane(inICAOCode, inAirline, inLivery, AircraftCB,
|
mPlane = XPMPCreatePlane(inICAOCode, inAirline, inLivery, AircraftCB,
|
||||||
reinterpret_cast<void *>(this));
|
static_cast<void *>(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
XPCAircraft::~XPCAircraft()
|
XPCAircraft::~XPCAircraft()
|
||||||
@@ -20,7 +20,7 @@ XPMPPlaneCallbackResult XPCAircraft::AircraftCB(
|
|||||||
void * ioData,
|
void * ioData,
|
||||||
void * inRefcon)
|
void * inRefcon)
|
||||||
{
|
{
|
||||||
XPCAircraft * me = reinterpret_cast<XPCAircraft *>(inRefcon);
|
XPCAircraft * me = static_cast<XPCAircraft *>(inRefcon);
|
||||||
switch(inDataType) {
|
switch(inDataType) {
|
||||||
case xpmpDataType_Position:
|
case xpmpDataType_Position:
|
||||||
return me->GetPlanePosition((XPMPPlanePosition_t *) ioData);
|
return me->GetPlanePosition((XPMPPlanePosition_t *) ioData);
|
||||||
|
|||||||
Reference in New Issue
Block a user