Commit graph

849 commits

Author SHA1 Message Date
Peter Seiderer
bc428e0211 Disable test-static-link in case of shared only build.
Fixes the following buildroot compile failure:

libtool: link: [..]/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc -std=gnu99 -I.. -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static -o test-static-link test_static_link-test-link.o  ../libevdev/.libs/libevdev.so -Wl,-rpath -Wl,[...]/build/libevdev-1.4/libevdev/.libs
[...]/arm-buildroot-linux-uclibcgnueabi/bin/ld: attempted static link of dynamic object `../libevdev/.libs/libevdev.so'
collect2: error: ld returned 1 exit status
Makefile:719: recipe for target 'test-static-link' failed

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-16 08:57:42 +10:00
Peter Hutterer
6c87163a2a libevdev 1.4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-04 08:50:43 +10:00
Peter Hutterer
4160d94baf cosmetic: fix a couple of duplicate/missing empty lines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-04 08:41:33 +10:00
Peter Hutterer
4ba296cf90 test: use -std=c89 instead of c90 for the build test
They're identical, but RHEL6 doesn't support -std=c90

https://gcc.gnu.org/onlinedocs/gcc/Standards.html
https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#C-Dialect-Options

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-09 12:54:36 +10:00
Peter Hutterer
3bf7d50230 tools: add a tool to change kernel devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-04 11:02:02 +10:00
Peter Hutterer
def17850d1 test: always build the build-tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-04 10:42:42 +10:00
Peter Hutterer
a669ac1faf configure: rename BUILD_TESTS to ENABLE_RUNTIME_TESTS
Avoids confusion when we build tests in the future even though BUILD_TESTS is
disabled.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-04 10:42:41 +10:00
Thilo Schulz
7571dc49e5 Use memcpy/memmove instead of loop operations
Signed-off-by: Thilo Schulz <thilo@tjps.eu>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-02 11:42:57 +10:00
Owen W. Taylor
867a237c55 libevdev_uinput_destroy: don't close non-open FD
The returned errno from libevdev_input_create_from_device was returned
incorrectly because libevdev_uinput_destroy() would try to close the
unset value of ->fd, overwriting errno.

That was fixed in debe9b030c, this patch avoids
the ioctl/close calls if the fd isn't set.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-21 08:48:50 +10:00
Peter Hutterer
f4cc76d96f tools: note that the mouse frequency measured is the highest frequency
Some devices scale the frequency based on the input and will provide
recordings with different frequencies each time. Recommend to measure multiple
times since we can only know what the highest frequency is.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-07 13:39:55 +10:00
Peter Hutterer
59c824ebc0 tools: fix clang compiler warning
mouse-dpi-tool.c:213:39: warning: missing field 'frequency' initializer
[-Wmissing-field-initializers]
        struct measurements measurements = {0};

Annoying, but a low-cost fix.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-07 08:33:10 +10:00
Peter Hutterer
3a2f4ba2f3 Shut up clang compiler warnings
clang looks at GCC pragmas, but doesn't understand -Woverride-init. Instead,
it uses -Winitializer-overrides.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2015-01-07 08:33:10 +10:00
Peter Hutterer
e897f6f821 tools: print the formula to calculate resolutions
And encourage users to move at least 25cm, makes it a lot easier to pick the
resolution.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-12 08:37:24 +10:00
Peter Hutterer
7e8a2eaa30 include: update to 3.18 header
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-08 10:39:53 +10:00
Peter Hutterer
7ac00d7e92 libevdev 1.3.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-05 14:27:19 +10:00
Peter Hutterer
9923b06e71 tools: zero-pad PID/VID in the dpi tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-05 14:17:27 +10:00
Peter Hutterer
6ce23c6d79 tools: print the hwdb match line from the dpi tool
Let's make this as easy as possible

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-02 09:39:14 +10:00
Peter Hutterer
bb406fe411 tools: add a tool to estimate the resolution of a mouse
Relative devices don't provide a physical resolution to the host. For things
like pointer acceleration, the physical amount of movement is better as
baseline than the movement in device units.

Alas, many devices don't come with any information at all, so the users have
to guess. Help that guesswork by providing a tool that does the calculations
for them.

This tool measures the device units covered, then prints the frequency and an
lookup table for various resolutions (in dpi) to match to the physical
movement of the device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2014-11-21 09:42:12 +10:00
Peter Hutterer
3320407c12 doc: add the prefixing * to all @code doxygen sections
These were removed in (7da329b) because for some reason they got copied into
the output. That was either a buggy doxygen or just some other problem. Add
them again, makes it much easier to read the header file.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-18 09:05:16 +10:00
Peter Hutterer
cc3b81f15a test: add test for clock id setting on an invalid device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-18 09:05:14 +10:00
Peter Hutterer
1fc31fba92 test: add test for setting absinfo on invalid devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-18 09:04:29 +10:00
Peter Hutterer
cf4adee09b test: add test case for grab calls on invalid devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-18 09:04:03 +10:00
Peter Hutterer
d68eb35378 test: add missing tests for invalid calls on next_event/has_event_pending
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-18 09:03:35 +10:00
Peter Hutterer
318b0a5b11 Remove superfluous linebreak in an error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-18 08:17:56 +10:00
Peter Hutterer
0bf6d29ceb doc: fix uinput example code
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-18 08:17:55 +10:00
Peter Hutterer
45670fa6db Fix a confusing comment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-17 11:26:29 +10:00
Peter Hutterer
9a3f2ced4e libevdev 1.3.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-13 11:06:08 +10:00
Peter Hutterer
c8882c31c4 doc: update doxygen.in for current doxygen
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-13 11:06:08 +10:00
Peter Hutterer
e4bb610cda include: update to 3.17 header
Adds INPUT_PROP_POINTING_STICK

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-13 09:40:42 +10:00
Peter Hutterer
74c3ed6504 libevdev 1.3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-09-09 11:29:15 +10:00
Ran Benita
f92f4027d1 doc: fix slightly confusing code/type comments
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-28 07:54:22 +10:00
Peter Hutterer
825644803c configure.ac: print prefix and libdir
When building for multiple prefixes from the same repo it's nice to see a
reminder for what the current prefix is.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-27 15:48:06 +10:00
Peter Hutterer
592caa6106 libevdev 1.3RC2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-25 10:29:05 +10:00
Peter Hutterer
69b77b896a test: fix EVIOCREVOKE test on non-supporting kernels
The ioctl-returned errno is positive.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-25 10:28:09 +10:00
Peter Hutterer
0ceee5ec65 Add some minimal documentation about static linking
I can't recommend it, but I can't stop people from doing it, so at least
document the ground rules.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-25 10:12:37 +10:00
Peter Hutterer
31113e6038 Hook up nm to check for leaking symbols in the static library
We ignore anything that starts with an underscore, anything that starts with
libevdev and main (since we test the test-static-link binary) and a couple of
gcov-related functions. This should catch any functions we accidentally
export.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-25 10:06:48 +10:00
Peter Hutterer
6d3c994694 test: handle the GCOV_LDFLAGS in all tests
We rebuild the libevdev object files with the gcov flags for the tests, so we
need to make sure those flags are present on all binaries.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-25 10:06:48 +10:00
Peter Hutterer
1e264b6e94 test: override check-local instead of check
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-25 10:06:48 +10:00
Peter Hutterer
f46737726b test: add basic static link test
Same as the dynamic link test, just with the -static flag

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-25 10:06:48 +10:00
Peter Hutterer
6247e5c12a uinput: explicitly ignore the UI_DEV_DESTROY return value
This can't fail in the kernel anyway, so cast it to shut up Coverity.
Error message:
"Calling function "ioctl(int, unsigned long, ...)" without checking return
 value (as is done elsewhere 35 out of 36 times)."

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-25 09:54:28 +10:00
Peter Hutterer
400e52c6a2 tools: pass -rc to strerror, not rc
rc is a negative errno

Found by Coverity.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-22 11:50:15 +10:00
Peter Hutterer
53958c56cd uinput: close the managed fd on error
Using LIBEVDEV_UINPUT_OPEN_MANAGED can leak the fd if an error occurs after
opening it.

Found by Coverity.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-22 11:50:13 +10:00
Peter Hutterer
e4c315fc16 Rename symbols leaking from static library to avoid name clashes
The static library currently leaks log_msg and log_priority. Both are too
generic, so rename them, with a leading underscore to hint they're supposed to
be private.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-20 16:43:58 +10:00
Peter Hutterer
8742e1e346 Add libevdev_property_from_name()
12717d79 "Add libevdev_event_type/code_from_name() resolvers" added the
lookup functions for types and codes, this commit adds the missing ones for
input properties.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2014-08-20 08:43:15 +10:00
Peter Hutterer
87c1cd05ec configure: move the python check down to re-unite the gcov check outputs
The python check was inserted between "checking whether to build with gcov"
and the answering "yes", causing a lonely "yes" or "no" to wander around the
config.log in vain, haunted by solitude and wondering about the binary
simplicity of its life.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-19 09:41:57 +10:00
Peter Hutterer
d856a85cda test: drop include of libevdev-int.h
Not needed, and shouldn't be used in a test anyway

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-18 10:36:08 +10:00
Peter Hutterer
c0248818e6 test: use ck_assert_int_eq() where comparing integers
A simple ck_assert() just fails, a ck_assert_int_eq() also shows the two
values. Makes failures a bit easier to debug.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-18 10:36:08 +10:00
Peter Hutterer
debe9b030c uinput: preserve the errno before cleaning up
libevdev_uinput_destroy() may/will botch the errno, make sure we save it
before use.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-15 08:37:30 +10:00
Peter Hutterer
09529a6a65 uinput: check errno against the positive value
We use the negative errno internally, but the proper errno is always positive.

Fixes device creation failures on kernels that don't support UI_SET_PROPBIT.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2014-08-15 08:37:26 +10:00
Peter Hutterer
a5f150ef57 libevdev 1.3RC1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-08 11:39:58 +10:00