Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-02-15 11:35:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-15 11:35:48 +0400
commit6e54c87769afc88fec6eeb062403e2012e3de00a (patch)
treed3ddc3af2e30772d9faac72497b44bb2f8b16b4d /intern
parent004decc1d940a7d744ffcc63f4e53dd727dfea34 (diff)
Code cleanup: use const short for ndof axis args
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.cpp4
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.h4
-rw-r--r--intern/ghost/intern/GHOST_NDOFManagerCocoa.mm4
-rw-r--r--intern/ghost/intern/GHOST_NDOFManagerX11.cpp4
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp10
5 files changed, 13 insertions, 13 deletions
diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp b/intern/ghost/intern/GHOST_NDOFManager.cpp
index 52ee574c4b5..c99680641c3 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.cpp
+++ b/intern/ghost/intern/GHOST_NDOFManager.cpp
@@ -295,14 +295,14 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
return m_deviceType != NDOF_UnknownDevice;
}
-void GHOST_NDOFManager::updateTranslation(short t[3], GHOST_TUns64 time)
+void GHOST_NDOFManager::updateTranslation(const short t[3], GHOST_TUns64 time)
{
memcpy(m_translation, t, sizeof(m_translation));
m_motionTime = time;
m_motionEventPending = true;
}
-void GHOST_NDOFManager::updateRotation(short r[3], GHOST_TUns64 time)
+void GHOST_NDOFManager::updateRotation(const short r[3], GHOST_TUns64 time)
{
memcpy(m_rotation, r, sizeof(m_rotation));
m_motionTime = time;
diff --git a/intern/ghost/intern/GHOST_NDOFManager.h b/intern/ghost/intern/GHOST_NDOFManager.h
index 50f784d89c4..98aebfa4f30 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.h
+++ b/intern/ghost/intern/GHOST_NDOFManager.h
@@ -128,8 +128,8 @@ public:
// rotations are + when CCW, - when CW
// each platform is responsible for getting axis data into this form
// these values should not be scaled (just shuffled or flipped)
- void updateTranslation(short t[3], GHOST_TUns64 time);
- void updateRotation(short r[3], GHOST_TUns64 time);
+ void updateTranslation(const short t[3], GHOST_TUns64 time);
+ void updateRotation(const short r[3], GHOST_TUns64 time);
// the latest raw button data from the device
// use HID button encoding (not NDOF_ButtonT)
diff --git a/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm b/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm
index 0d620afd758..1a029257f09 100644
--- a/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm
+++ b/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm
@@ -79,8 +79,8 @@ static void NDOF_DeviceEvent(io_connect_t connection, natural_t messageType, voi
case kConnexionCmdHandleAxis:
{
// convert to blender view coordinates
- short t[3] = {s->axis[0], -(s->axis[2]), s->axis[1]};
- short r[3] = {-(s->axis[3]), s->axis[5], -(s->axis[4])};
+ const short t[3] = {s->axis[0], -(s->axis[2]), s->axis[1]};
+ const short r[3] = {-(s->axis[3]), s->axis[5], -(s->axis[4])};
ndof_manager->updateTranslation(t, now);
ndof_manager->updateRotation(r, now);
diff --git a/intern/ghost/intern/GHOST_NDOFManagerX11.cpp b/intern/ghost/intern/GHOST_NDOFManagerX11.cpp
index 947d8d74461..618c316a889 100644
--- a/intern/ghost/intern/GHOST_NDOFManagerX11.cpp
+++ b/intern/ghost/intern/GHOST_NDOFManagerX11.cpp
@@ -89,8 +89,8 @@ bool GHOST_NDOFManagerX11::processEvents()
{
/* convert to blender view coords */
GHOST_TUns64 now = m_system.getMilliSeconds();
- short t[3] = {(short)e.motion.x, (short)e.motion.y, (short)-e.motion.z};
- short r[3] = {(short)-e.motion.rx, (short)-e.motion.ry, (short)e.motion.rz};
+ const short t[3] = {(short)e.motion.x, (short)e.motion.y, (short)-e.motion.z};
+ const short r[3] = {(short)-e.motion.rx, (short)-e.motion.ry, (short)e.motion.rz};
updateTranslation(t, now);
updateRotation(r, now);
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 09d9fdfc493..b58dccf9fd3 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -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;
}