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
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-10-19 04:58:36 +0300
committerCampbell Barton <campbell@blender.org>2022-10-19 04:58:36 +0300
commitab28abcb6baaa728d8e2c30c4c98fef3655aa4dd (patch)
tree6a48b80892cb094d96fa7ff80c916ecb9b334d7c
parentecda118be407163096641db36b6ee8bf1d88ee55 (diff)
Cleanup: remove the last button from NDOF button enum values
This is only used for comparison, no need to make it part of the enum.
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.cpp4
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.h3
2 files changed, 2 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp b/intern/ghost/intern/GHOST_NDOFManager.cpp
index 2754b9c8a6f..555e22dadbb 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.cpp
+++ b/intern/ghost/intern/GHOST_NDOFManager.cpp
@@ -81,8 +81,6 @@ static const char *ndof_button_names[] = {
"NDOF_BUTTON_ALT",
"NDOF_BUTTON_SHIFT",
"NDOF_BUTTON_CTRL",
- /* the end */
- "NDOF_BUTTON_LAST",
};
/* Shared by the latest 3Dconnexion hardware
@@ -389,7 +387,7 @@ void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT button,
uint64_t time,
GHOST_IWindow *window)
{
- GHOST_ASSERT(button > NDOF_BUTTON_NONE && button < NDOF_BUTTON_LAST,
+ GHOST_ASSERT(button > NDOF_BUTTON_NONE && button < NDOF_BUTTON_NUM,
"rogue button trying to escape NDOF manager");
GHOST_EventNDOFButton *event = new GHOST_EventNDOFButton(time, window);
diff --git a/intern/ghost/intern/GHOST_NDOFManager.h b/intern/ghost/intern/GHOST_NDOFManager.h
index 58371826527..c883c2dce65 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.h
+++ b/intern/ghost/intern/GHOST_NDOFManager.h
@@ -87,8 +87,7 @@ typedef enum {
NDOF_BUTTON_ALT,
NDOF_BUTTON_SHIFT,
NDOF_BUTTON_CTRL,
- /* The end. */
- NDOF_BUTTON_LAST
+#define NDOF_BUTTON_NUM (NDOF_BUTTON_CTRL + 1)
} NDOF_ButtonT;
class GHOST_NDOFManager {