[gnome-games/wip/aplazas/781572-remove-vala-macro: 7/13] gamepad: Make GamepadDPad class a struct
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/781572-remove-vala-macro: 7/13] gamepad: Make GamepadDPad class a struct
- Date: Wed, 3 May 2017 07:07:28 +0000 (UTC)
commit 08447b1c3fa5fd3cfcd61c9904c33e551a11d45b
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri Apr 28 14:10:48 2017 +0200
gamepad: Make GamepadDPad class a struct
This better reflects the usage of this type.
src/gamepad/gamepad-dpad.vala | 13 ++++---------
src/gamepad/gamepad-mapping.vala | 2 +-
2 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/gamepad/gamepad-dpad.vala b/src/gamepad/gamepad-dpad.vala
index 87e7443..ae2355e 100644
--- a/src/gamepad/gamepad-dpad.vala
+++ b/src/gamepad/gamepad-dpad.vala
@@ -1,12 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
-private class Games.GamepadDPad : Object {
- public GamepadInputType types[4];
- public int values[4];
- public int axis_values[2];
-
- public GamepadDPad () {
- axis_values[0] = axis_values[1] = 0;
- types[0] = types[1] = types[2] = types[3] = GamepadInputType.INVALID;
- }
+private struct Games.GamepadDPad {
+ GamepadInputType types[4];
+ int values[4];
+ int axis_values[2];
}
diff --git a/src/gamepad/gamepad-mapping.vala b/src/gamepad/gamepad-mapping.vala
index 4526e1d..cba06fb 100644
--- a/src/gamepad/gamepad-mapping.vala
+++ b/src/gamepad/gamepad-mapping.vala
@@ -128,7 +128,7 @@ private class Games.GamepadMapping : Object {
dpad_position++;
}
while (dpads.length <= dpad_index)
- dpads += new GamepadDPad ();
+ dpads += GamepadDPad ();
dpads[dpad_index].types[dpad_position] = type;
dpads[dpad_index].values[dpad_position] = parsed_key;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]