[SCM] jinput - Java Game Controller API branch, master, updated. debian/20100502+dfsg-5-1-g166fb6f
Niels Thykier
niels at thykier.net
Thu Jan 26 15:41:57 UTC 2012
The following commit has been merged in the master branch:
commit 166fb6f980cd398769c389ef707761bffa80ba42
Author: Niels Thykier <niels at thykier.net>
Date: Thu Jan 26 16:38:14 2012 +0100
Patch out undefined symbol EVIOCGUSAGE
Signed-off-by: Niels Thykier <niels at thykier.net>
diff --git a/debian/changelog b/debian/changelog
index 6343569..01465b5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+jinput (20100502+dfsg-6) unstable; urgency=low
+
+ * Team upload.
+ * Applied patch from Geoffrey Thomas to remove use of an undefined
+ macro (or C-function). (Closes: #633501)
+
+ -- Niels Thykier <niels at thykier.net> Thu, 26 Jan 2012 16:37:00 +0100
+
jinput (20100502+dfsg-5) unstable; urgency=low
* Add jutils to manifest classpath (Closes: #626002).
diff --git a/debian/patches/04jinput-remove-getDeviceUsageBits.patch b/debian/patches/04jinput-remove-getDeviceUsageBits.patch
new file mode 100644
index 0000000..819bf2c
--- /dev/null
+++ b/debian/patches/04jinput-remove-getDeviceUsageBits.patch
@@ -0,0 +1,74 @@
+Index: trunk/plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java
+===================================================================
+--- trunk/plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java (revision 247)
++++ trunk/plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java (working copy)
+@@ -94,28 +94,6 @@
+ }
+
+ private final Controller.Type guessType() throws IOException {
+- Controller.Type type_from_usages = guessTypeFromUsages();
+- if (type_from_usages == Controller.Type.UNKNOWN)
+- return guessTypeFromComponents();
+- else
+- return type_from_usages;
+- }
+-
+- private final Controller.Type guessTypeFromUsages() throws IOException {
+- byte[] usage_bits = getDeviceUsageBits();
+- if (isBitSet(usage_bits, NativeDefinitions.USAGE_MOUSE))
+- return Controller.Type.MOUSE;
+- else if (isBitSet(usage_bits, NativeDefinitions.USAGE_KEYBOARD))
+- return Controller.Type.KEYBOARD;
+- else if (isBitSet(usage_bits, NativeDefinitions.USAGE_GAMEPAD))
+- return Controller.Type.GAMEPAD;
+- else if (isBitSet(usage_bits, NativeDefinitions.USAGE_JOYSTICK))
+- return Controller.Type.STICK;
+- else
+- return Controller.Type.UNKNOWN;
+- }
+-
+- private final Controller.Type guessTypeFromComponents() throws IOException {
+ List components = getComponents();
+ if (components.size() == 0)
+ return Controller.Type.UNKNOWN;
+@@ -342,15 +320,6 @@
+ }
+ private final static native void nGetBits(long fd, int ev_type, byte[] evtype_bits) throws IOException;
+
+- private final byte[] getDeviceUsageBits() throws IOException {
+- byte[] bits = new byte[NativeDefinitions.USAGE_MAX/8 + 1];
+- if (getVersion() >= 0x010001) {
+- nGetDeviceUsageBits(fd, bits);
+- }
+- return bits;
+- }
+- private final static native void nGetDeviceUsageBits(long fd, byte[] type_bits) throws IOException;
+-
+ public final synchronized void pollKeyStates() throws IOException {
+ nGetKeyStates(fd, key_states);
+ }
+Index: trunk/plugins/linux/src/native/net_java_games_input_LinuxEventDevice.c
+===================================================================
+--- trunk/plugins/linux/src/native/net_java_games_input_LinuxEventDevice.c (revision 247)
++++ trunk/plugins/linux/src/native/net_java_games_input_LinuxEventDevice.c (working copy)
+@@ -112,20 +112,6 @@
+ return num_effects;
+ }
+
+-JNIEXPORT void JNICALL Java_net_java_games_input_LinuxEventDevice_nGetDeviceUsageBits(JNIEnv *env, jclass unused, jlong fd_address, jbyteArray usages_array) {
+-#if EV_VERSION >= 0x010001
+- int fd = (int)fd_address;
+- jsize len = (*env)->GetArrayLength(env, usages_array);
+- jbyte *usages = (*env)->GetByteArrayElements(env, usages_array, NULL);
+- if (usages == NULL)
+- return;
+- int res = ioctl(fd, EVIOCGUSAGE(len), usages);
+- (*env)->ReleaseByteArrayElements(env, usages_array, usages, 0);
+- if (res == -1)
+- throwIOException(env, "Failed to get device usages (%d)\n", errno);
+-#endif
+-}
+-
+ JNIEXPORT void JNICALL Java_net_java_games_input_LinuxEventDevice_nGetBits(JNIEnv *env, jclass unused, jlong fd_address, jint evtype, jbyteArray bits_array) {
+ int fd = (int)fd_address;
+ jsize len = (*env)->GetArrayLength(env, bits_array);
diff --git a/debian/patches/series b/debian/patches/series
index 4874ed0..b2ce8c6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
01build.xml.jni
02build.xml.nonfree
03javadoc
+04jinput-remove-getDeviceUsageBits.patch
--
jinput - Java Game Controller API
More information about the pkg-java-commits
mailing list