Added static cast to force correct type

This commit is contained in:
2025-06-16 16:15:24 +02:00
parent 603b3e77af
commit 2f8ae23d57

View File

@ -474,8 +474,9 @@ asynStatus setAxisParam(A *axis, C *controller, const char *indexName,
typename std::remove_pointer<decltype(ctrlPtr)>::type; \
asynStatus setStatus = \
setAxisParam(axis, ctrlPtr, #indexSetterFunction, \
&ControllerType::indexSetterFunction, writeValue, \
__PRETTY_FUNCTION__, __LINE__); \
static_cast<int (ControllerType::*)()>( \
&ControllerType::indexSetterFunction), \
writeValue, __PRETTY_FUNCTION__, __LINE__); \
if (setStatus != asynSuccess) \
return setStatus; \
} while (0)
@ -540,8 +541,9 @@ asynStatus getAxisParam(A *axis, C *controller, const char *indexName,
typename std::remove_pointer<decltype(ctrlPtr)>::type; \
asynStatus getStatus = \
getAxisParam(axis, ctrlPtr, #indexGetterFunction, \
&ControllerType::indexGetterFunction, readValue, \
__PRETTY_FUNCTION__, __LINE__); \
static_cast<int (ControllerType::*)()>( \
&ControllerType::indexGetterFunction), \
readValue, __PRETTY_FUNCTION__, __LINE__); \
if (getStatus != asynSuccess) \
return getStatus; \
} while (0)