From f123908c33d846e484efaddc06b646cd73745cc6 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 27 Nov 2022 12:54:19 +0200 Subject: [PATCH] Rename ControlSrcType::NONE to NO_SOURCE NONE is too generic and can easily conflict with something else. --- source/input/bindings.h | 2 +- source/input/control.cpp | 8 ++++---- source/input/control.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/input/bindings.h b/source/input/bindings.h index f5a935d..01db810 100644 --- a/source/input/bindings.h +++ b/source/input/bindings.h @@ -70,7 +70,7 @@ public: std::string control; unsigned device = 0; - ControlSrcType type = NONE; + ControlSrcType type = NO_SOURCE; unsigned index = 0; }; diff --git a/source/input/control.cpp b/source/input/control.cpp index fb1d376..17436a8 100644 --- a/source/input/control.cpp +++ b/source/input/control.cpp @@ -23,7 +23,7 @@ std::string ControlSource::str() const return dev->get_axis_name(index)+" +"; else if(type==AXIS_NEG) return dev->get_axis_name(index)+" -"; - else if(type==NONE) + else if(type==NO_SOURCE) return "None"; return lexical_cast(index); @@ -87,7 +87,7 @@ void Control::connect_signals() { switch(src.type) { - case NONE: + case NO_SOURCE: break; case BUTTON: src.dev->signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &Control::button_press), false)); @@ -130,13 +130,13 @@ void Control::axis_motion(unsigned i, float v, float r) { if(capture_dev) { - ControlSrcType type = NONE; + ControlSrcType type = NO_SOURCE; if(v<-0.9) type = AXIS_NEG; else if(v>0.9) type = AXIS_POS; - if(type!=NONE) + if(type!=NO_SOURCE) { src.dev = capture_dev; src.type = type; diff --git a/source/input/control.h b/source/input/control.h index dcf7bf3..b71c818 100644 --- a/source/input/control.h +++ b/source/input/control.h @@ -13,7 +13,7 @@ class Device; enum ControlSrcType { - NONE, + NO_SOURCE, BUTTON, AXIS_POS, AXIS_NEG @@ -26,7 +26,7 @@ different types of controls in a uniform way. struct ControlSource { Device *dev = 0; - ControlSrcType type = NONE; + ControlSrcType type = NO_SOURCE; unsigned index = 0; ControlSource() = default; -- 2.45.2