Code cleanup: use const short for ndof axis args
This commit is contained in:
@@ -854,14 +854,14 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw)
|
||||
{
|
||||
case 1: // translation
|
||||
{
|
||||
short *axis = (short *)(data + 1);
|
||||
const short *axis = (short *)(data + 1);
|
||||
// massage into blender view coords (same goes for rotation)
|
||||
short t[3] = {axis[0], -axis[2], axis[1]};
|
||||
const short t[3] = {axis[0], -axis[2], axis[1]};
|
||||
m_ndofManager->updateTranslation(t, now);
|
||||
|
||||
if (raw.data.hid.dwSizeHid == 13)
|
||||
{ // this report also includes rotation
|
||||
short r[3] = {-axis[3], axis[5], -axis[4]};
|
||||
const short r[3] = {-axis[3], axis[5], -axis[4]};
|
||||
m_ndofManager->updateRotation(r, now);
|
||||
|
||||
// I've never gotten one of these, has anyone else?
|
||||
@@ -871,8 +871,8 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw)
|
||||
}
|
||||
case 2: // rotation
|
||||
{
|
||||
short *axis = (short *)(data + 1);
|
||||
short r[3] = {-axis[0], axis[2], -axis[1]};
|
||||
const short *axis = (short *)(data + 1);
|
||||
const short r[3] = {-axis[0], axis[2], -axis[1]};
|
||||
m_ndofManager->updateRotation(r, now);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user