diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-12-08 15:53:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 15:53:42 +0100 |
commit | 90bdba576af2d5f0a8ecdbef065d6ef0075bc2f2 (patch) | |
tree | 22e25092f8a56af0c467442baa763f7a2db1c7cb /platform/osx | |
parent | edb3686ee2379ad28d1273797db8bd9ded38ff1e (diff) | |
parent | e1811b689b6854668ca690831df8603820b68573 (diff) |
Merge pull request #43742 from qarmin/editor_modules_default_values
Initialize class/struct variables with default values in platform/ and editor/
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/display_server_osx.h | 14 | ||||
-rw-r--r-- | platform/osx/export/export.cpp | 2 | ||||
-rw-r--r-- | platform/osx/joypad_osx.cpp | 8 | ||||
-rw-r--r-- | platform/osx/joypad_osx.h | 18 |
4 files changed, 17 insertions, 25 deletions
diff --git a/platform/osx/display_server_osx.h b/platform/osx/display_server_osx.h index 073d35008b..ea55a3ff28 100644 --- a/platform/osx/display_server_osx.h +++ b/platform/osx/display_server_osx.h @@ -77,13 +77,13 @@ public: struct KeyEvent { WindowID window_id; - unsigned int osx_state; - bool pressed; - bool echo; - bool raw; - uint32_t keycode; - uint32_t physical_keycode; - uint32_t unicode; + unsigned int osx_state = false; + bool pressed = false; + bool echo = false; + bool raw = false; + uint32_t keycode = 0; + uint32_t physical_keycode = 0; + uint32_t unicode = 0; }; struct WarpEvent { diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index f5aad91946..eecd2ed641 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -48,7 +48,7 @@ class EditorExportPlatformOSX : public EditorExportPlatform { GDCLASS(EditorExportPlatformOSX, EditorExportPlatform); - int version_code; + int version_code = 0; Ref<ImageTexture> logo; diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp index cfc371710b..b2871b261e 100644 --- a/platform/osx/joypad_osx.cpp +++ b/platform/osx/joypad_osx.cpp @@ -37,14 +37,6 @@ static JoypadOSX *self = nullptr; joypad::joypad() { - device_ref = nullptr; - ff_device = nullptr; - ff_axes = nullptr; - ff_directions = nullptr; - ffservice = 0; - ff_timestamp = 0; - id = 0; - ff_constant_force.lMagnitude = 10000; ff_effect.dwDuration = 0; ff_effect.dwSamplePeriod = 0; diff --git a/platform/osx/joypad_osx.h b/platform/osx/joypad_osx.h index dc238e68e4..6c2a1ea70b 100644 --- a/platform/osx/joypad_osx.h +++ b/platform/osx/joypad_osx.h @@ -46,10 +46,10 @@ struct rec_element { IOHIDElementRef ref; IOHIDElementCookie cookie; - uint32_t usage; + uint32_t usage = 0; - int min; - int max; + int min = 0; + int max = 0; struct Comparator { bool operator()(const rec_element p_a, const rec_element p_b) const { return p_a.usage < p_b.usage; } @@ -57,22 +57,22 @@ struct rec_element { }; struct joypad { - IOHIDDeviceRef device_ref; + IOHIDDeviceRef device_ref = nullptr; Vector<rec_element> axis_elements; Vector<rec_element> button_elements; Vector<rec_element> hat_elements; - int id; + int id = 0; - io_service_t ffservice; /* Interface for force feedback, 0 = no ff */ + io_service_t ffservice = 0; /* Interface for force feedback, 0 = no ff */ FFCONSTANTFORCE ff_constant_force; FFDeviceObjectReference ff_device; FFEffectObjectReference ff_object; - uint64_t ff_timestamp; - LONG *ff_directions; + uint64_t ff_timestamp = 0; + LONG *ff_directions = nullptr; FFEFFECT ff_effect; - DWORD *ff_axes; + DWORD *ff_axes = nullptr; void add_hid_elements(CFArrayRef p_array); void add_hid_element(IOHIDElementRef p_element); |