]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/control.h
Use default member initializers and defaulted default constructors
[libs/gui.git] / source / input / control.h
index 7a4fd0e0a4ddbf6bd384b317f35e475b9719d6f9..dcf7bf341047e71249440ba6114738cce367af96 100644 (file)
@@ -25,11 +25,11 @@ different types of controls in a uniform way.
 */
 struct ControlSource
 {
-       Device *dev;
-       ControlSrcType type;
-       unsigned index;
+       Device *dev = 0;
+       ControlSrcType type = NONE;
+       unsigned index = 0;
 
-       ControlSource();
+       ControlSource() = default;
        ControlSource(Device &, ControlSrcType, unsigned);
        std::string str() const;
 };
@@ -55,13 +55,13 @@ public:
 
 protected:
        ControlSource src;
-       Device *capture_dev;
-       BinaryControl *activator;
-       float origin;
-       bool rising_edge;
-       bool falling_edge;
+       Device *capture_dev = 0;
+       BinaryControl *activator = 0;
+       float origin = 0.0f;
+       bool rising_edge = false;
+       bool falling_edge = false;
 
-       Control();
+       Control() = default;
        Control(const ControlSource &);
        Control(Device &, ControlSrcType, unsigned);
 public: