diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-23 13:27:19 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-23 13:27:19 +0200 |
commit | b30fbd10720959bf16835891a2a802b38a1717bf (patch) | |
tree | 428814057c1a04bfabd2a7eb14483f6844c70f16 /proto-vjoystick | |
parent | 7df3e936e1db5a23aa0bef804eec0e0af5f4ab65 (diff) |
compat/util: move typical "clamp" function here
Diffstat (limited to 'proto-vjoystick')
-rw-r--r-- | proto-vjoystick/vjoystick.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/proto-vjoystick/vjoystick.cpp b/proto-vjoystick/vjoystick.cpp index ad582b6d..5a780222 100644 --- a/proto-vjoystick/vjoystick.cpp +++ b/proto-vjoystick/vjoystick.cpp @@ -1,5 +1,6 @@ #include "vjoystick.h" #include "api/plugin-api.hpp" +#include "compat/util.hpp" #include <cstring> #include <QDebug> @@ -18,16 +19,6 @@ #define OPENTRACK_VJOYSTICK_ID 1 -template<typename t, typename u, typename v> -static t clamp(t val, u min, v max) -{ - if (val < min) - return t(min); - if (val > max) - return t(max); - return val; -} - const unsigned char handle::axis_ids[6] = { HID_USAGE_X, |