OSDN Git Service

Clean up the remnant USE_INPUT_API bits, as noted by Wolfram Sang
authorChris Larson <clarson@kergoth.com>
Thu, 20 Nov 2008 16:15:41 +0000 (16:15 +0000)
committerChris Larson <clarson@kergoth.com>
Thu, 20 Nov 2008 16:15:41 +0000 (16:15 +0000)
Signed-off-by: Chris Larson <clarson@kergoth.com>
src/ts_open.c
tests/ts_calibrate.c
tests/ts_harvest.c
tests/ts_print.c
tests/ts_print_raw.c
tests/ts_test.c

index d8a047b..b596197 100644 (file)
 #endif
 #include <sys/fcntl.h>
 
-#ifdef USE_INPUT_API
-#include <linux/input.h>
-#endif /* USE_INPUT_API */
-
 #include "tslib-private.h"
 
 extern struct tslib_module_info __ts_raw;
index 03c58fb..ad8f6db 100644 (file)
@@ -204,11 +204,8 @@ int main()
        if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
                ts = ts_open(tsdevice,0);
        } else {
-#ifdef USE_INPUT_API
-               ts = ts_open("/dev/input/event0", 0);
-#else
-               ts = ts_open("/dev/touchscreen/ucb1x00", 0);
-#endif /* USE_INPUT_API */
+               if (!(ts = ts_open("/dev/input/event0", 0)))
+                       ts = ts_open("/dev/touchscreen/ucb1x00", 0)
        }
 
        if (!ts) {
index 1d77810..2869670 100644 (file)
@@ -74,18 +74,15 @@ int main()
        signal(SIGINT, sig);
        signal(SIGTERM, sig);
 
-       if ((tsdevice = getenv("TSLIB_TSDEVICE")) == NULL) {
-#ifdef USE_INPUT_API
-               tsdevice = strdup ("/dev/input/event0");
-#else
-               tsdevice = strdup ("/dev/touchscreen/ucb1x00");
-#endif /* USE_INPUT_API */
-        }
-
-       ts = ts_open (tsdevice, 0);
+       if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
+               ts = ts_open(tsdevice,0);
+       } else {
+               if (!(ts = ts_open("/dev/input/event0", 0)))
+                       ts = ts_open("/dev/touchscreen/ucb1x00", 0)
+       }
 
        if (!ts) {
-               perror (tsdevice);
+               perror("ts_open");
                exit(1);
        }
 
index 8881cc9..06f6d52 100644 (file)
@@ -25,15 +25,12 @@ int main()
        struct tsdev *ts;
        char *tsdevice=NULL;
 
-        if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
-                ts = ts_open(tsdevice,0);
-        } else {
-#ifdef USE_INPUT_API
-                ts = ts_open("/dev/input/event0", 0);
-#else
-                ts = ts_open("/dev/touchscreen/ucb1x00", 0);
-#endif /* USE_INPUT_API */
-        }
+       if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
+               ts = ts_open(tsdevice,0);
+       } else {
+               if (!(ts = ts_open("/dev/input/event0", 0)))
+                       ts = ts_open("/dev/touchscreen/ucb1x00", 0)
+       }
 
        if (!ts) {
                perror("ts_open");
index 6fe063a..f32e73b 100644 (file)
@@ -25,15 +25,12 @@ int main()
        struct tsdev *ts;
        char *tsdevice=NULL;
 
-        if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
-                ts = ts_open(tsdevice,0);
-        } else {
-#ifdef USE_INPUT_API
-                ts = ts_open("/dev/input/event0", 0);
-#else
-                ts = ts_open("/dev/touchscreen/ucb1x00", 0);
-#endif /* USE_INPUT_API */
-        }
+       if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
+               ts = ts_open(tsdevice,0);
+       } else {
+               if (!(ts = ts_open("/dev/input/event0", 0)))
+                       ts = ts_open("/dev/touchscreen/ucb1x00", 0)
+       }
 
        if (!ts) {
                perror("ts_open");
index 5b3cf66..d023f96 100644 (file)
@@ -120,18 +120,15 @@ int main()
        signal(SIGINT, sig);
        signal(SIGTERM, sig);
 
-       if ((tsdevice = getenv("TSLIB_TSDEVICE")) == NULL) {
-#ifdef USE_INPUT_API
-               tsdevice = strdup ("/dev/input/event0");
-#else
-               tsdevice = strdup ("/dev/touchscreen/ucb1x00");
-#endif /* USE_INPUT_API */
-        }
-
-       ts = ts_open (tsdevice, 0);
+       if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
+               ts = ts_open(tsdevice,0);
+       } else {
+               if (!(ts = ts_open("/dev/input/event0", 0)))
+                       ts = ts_open("/dev/touchscreen/ucb1x00", 0)
+       }
 
        if (!ts) {
-               perror (tsdevice);
+               perror("ts_open");
                exit(1);
        }