From: Peter Hutterer Date: Thu, 20 Dec 2007 01:36:33 +0000 (+1030) Subject: Remove leftover trailing whitespaces. X-Git-Url: https://diplodocus.org/git/xorg-xinput/commitdiff_plain/82dfa529165657edc4e66e072d1515638e1edc66?ds=inline;hp=-c Remove leftover trailing whitespaces. --- 82dfa529165657edc4e66e072d1515638e1edc66 diff --git a/src/feedback.c b/src/feedback.c index e374be2..7f4da57 100644 --- a/src/feedback.c +++ b/src/feedback.c @@ -1,6 +1,6 @@ /* * Copyright 1996 by Frederic Lepied, France. - * + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Frederic Lepied makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -37,21 +37,21 @@ set_ptr_feedback(Display *display, int num_feedbacks; int loop; int id; - + if (argc != 4) { fprintf(stderr, "usage: xinput %s %s\n", name, desc); return 1; } - + info = find_device_info(display, argv[0], True); - + if (!info) { fprintf(stderr, "unable to find device %s\n", argv[0]); return 1; } - + device = XOpenDevice(display, info->id); - + if (!device) { fprintf(stderr, "unable to open device %s\n", argv[0]); return 1; @@ -71,12 +71,12 @@ set_ptr_feedback(Display *display, fprintf(stderr, "unable to find PtrFeedbackClass for %s\n", argv[0]); return 1; } - - feedback.class = PtrFeedbackClass; - feedback.length = sizeof(XPtrFeedbackControl); - feedback.id = id; + + feedback.class = PtrFeedbackClass; + feedback.length = sizeof(XPtrFeedbackControl); + feedback.id = id; feedback.threshold = atoi(argv[1]); - feedback.accelNum = atoi(argv[2]); + feedback.accelNum = atoi(argv[2]); feedback.accelDenom = atoi(argv[3]); XChangeFeedbackControl(display, device, DvAccelNum|DvAccelDenom|DvThreshold, @@ -103,31 +103,31 @@ get_feedbacks(Display *display, XLedFeedbackState *l; XIntegerFeedbackState *i; XStringFeedbackState *s; - + if (argc != 1) { fprintf(stderr, "usage: xinput %s %s\n", name, desc); return 1; } - + info = find_device_info(display, argv[0], True); - + if (!info) { fprintf(stderr, "unable to find device %s\n", argv[0]); return 1; } - + device = XOpenDevice(display, info->id); - + if (!device) { fprintf(stderr, "unable to open device %s\n", argv[0]); return 1; } - + state = XGetFeedbackControl(display, device, &num_feedbacks); printf("%d feedback class%s\n", num_feedbacks, (num_feedbacks > 1) ? "es" : ""); - + for(loop=0; loopclass) { case KbdFeedbackClass: @@ -140,13 +140,13 @@ get_feedbacks(Display *display, printf("\tled_mask is %d\n", k->led_mask); printf("\tglobal_auto_repeat is %d\n", k->global_auto_repeat); break; - + case PtrFeedbackClass: p = (XPtrFeedbackState*) state; printf("PtrFeedbackClass id=%ld\n", state->id); printf("\taccelNum is %d\n", p->accelNum); printf("\taccelDenom is %d\n", p->accelDenom); - printf("\tthreshold is %d\n", p->threshold); + printf("\tthreshold is %d\n", p->threshold); break; case StringFeedbackClass: @@ -175,7 +175,7 @@ get_feedbacks(Display *display, printf("XBellFeedbackControl id=%ld\n", state->id); printf("\tpercent is %d\n", b->percent); printf("\tpitch is %d\n", b->pitch); - printf("\tduration is %d\n", b->duration); + printf("\tduration is %d\n", b->duration); break; } state = (XFeedbackState*) ((char*) state + state->length); diff --git a/src/list.c b/src/list.c index a023610..9ef3d61 100644 --- a/src/list.c +++ b/src/list.c @@ -1,6 +1,6 @@ /* * Copyright 1996 by Frederic Lepied, France. - * + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Frederic Lepied makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -22,6 +22,7 @@ */ #include "xinput.h" +#include static void print_info(XDeviceInfo *info, Bool shortformat) @@ -78,7 +79,7 @@ print_info(XDeviceInfo *info, Bool shortformat) case ValuatorClass: v = (XValuatorInfoPtr) any; - a = (XAxisInfoPtr) ((char *) v + + a = (XAxisInfoPtr) ((char *) v + sizeof (XValuatorInfo)); printf("\tNum_axes is %d\n", v->num_axes); printf("\tMode is %s\n", (v->mode == Absolute) ? "Absolute" : "Relative"); @@ -90,7 +91,7 @@ print_info(XDeviceInfo *info, Bool shortformat) printf ("\t\tResolution is %d\n", a->resolution); } break; - + default: printf ("unknown class\n"); } @@ -112,11 +113,11 @@ list(Display *display, shortformat = (argc == 1 && strcmp(argv[0], "--short") == 0); - if (argc == 0) { + if (argc == 0 || shortformat) { int num_devices; - + info = XListInputDevices(display, &num_devices); - + for(loop=0; loop - * + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Frederic Lepied makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -39,21 +39,21 @@ query_state(Display *display, XValuatorState *val_state; XKeyState *key_state; XButtonState *but_state; - + if (argc != 1) { fprintf(stderr, "usage: xinput %s %s\n", name, desc); return 1; } - + info = find_device_info(display, argv[0], True); - + if (!info) { fprintf(stderr, "unable to find device %s\n", argv[0]); return 1; } - + device = XOpenDevice(display, info->id); - + if (!device) { fprintf(stderr, "unable to open device %s\n", argv[0]); return 1; @@ -76,7 +76,7 @@ query_state(Display *display, printf("\tvaluator[%d]=%d\n", loop2, val_state->valuators[loop2]); } break; - + case ButtonClass: but_state = (XButtonState *) cls; printf("ButtonClass\n"); @@ -93,7 +93,7 @@ query_state(Display *display, printf("\tkey[%d]=%s\n", loop2, (key_state->keys[loop2 / 8] & (1 << (loop2 % 8))) ? "down" : "up" ); } - + break; } diff --git a/src/test.c b/src/test.c index 5d54364..be6b119 100644 --- a/src/test.c +++ b/src/test.c @@ -1,6 +1,6 @@ /* * Copyright 1996 by Frederic Lepied, France. - * + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Frederic Lepied makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -57,7 +57,7 @@ register_events(Display *dpy, fprintf(stderr, "unable to open device %s\n", dev_name); return 0; } - + if (device->num_classes > 0) { for (ip = device->classes, i=0; inum_classes; ip++, i++) { switch (ip->input_class) { @@ -78,7 +78,7 @@ register_events(Display *dpy, ProximityOut(device, proximity_out_type, event_list[number]); number++; } break; - + default: fprintf(stderr, "unknown class\n"); break; @@ -94,19 +94,19 @@ register_events(Display *dpy, } static void -print_events(Display *dpy) +print_events(Display *dpy) { XEvent Event; - + while(1) { XNextEvent(dpy, &Event); - + if (Event.type == motion_type) { - int loop; + int loop; XDeviceMotionEvent *motion = (XDeviceMotionEvent *) &Event; printf("motion "); - + for(loop=0; loopaxes_count; loop++) { printf("a[%d]=%d ", motion->first_axis + loop, motion->axis_data[loop]); } @@ -115,10 +115,10 @@ print_events(Display *dpy) (Event.type == button_release_type)) { int loop; XDeviceButtonEvent *button = (XDeviceButtonEvent *) &Event; - + printf("button %s %d ", (Event.type == button_release_type) ? "release" : "press ", button->button); - + for(loop=0; loopaxes_count; loop++) { printf("a[%d]=%d ", button->first_axis + loop, button->axis_data[loop]); } @@ -127,10 +127,10 @@ print_events(Display *dpy) (Event.type == key_release_type)) { int loop; XDeviceKeyEvent *key = (XDeviceKeyEvent *) &Event; - + printf("key %s %d ", (Event.type == key_release_type) ? "release" : "press ", key->keycode); - + for(loop=0; loopaxes_count; loop++) { printf("a[%d]=%d ", key->first_axis + loop, key->axis_data[loop]); } @@ -139,9 +139,9 @@ print_events(Display *dpy) (Event.type == proximity_in_type)) { int loop; XProximityNotifyEvent *prox = (XProximityNotifyEvent *) &Event; - + printf("proximity %s ", (Event.type == proximity_in_type) ? "in " : "out"); - + for(loop=0; loopaxes_count; loop++) { printf("a[%d]=%d ", prox->first_axis + loop, prox->axis_data[loop]); } @@ -168,18 +168,18 @@ test(Display *display, } else { Bool handle_proximity = False; int idx = 0; - + if (argc == 2) { if (strcmp("-proximity", argv[0]) != 0) { - fprintf(stderr, "usage: xinput %s %s\n", name, desc); + fprintf(stderr, "usage: xinput %s %s\n", name, desc); return EXIT_FAILURE; } handle_proximity = 1; idx = 1; } - + info = find_device_info(display, argv[idx], True); - + if (!info) { fprintf(stderr, "unable to find device %s\n", argv[idx]); return EXIT_FAILURE; diff --git a/src/version.c b/src/version.c index 906ab6a..be35d43 100644 --- a/src/version.c +++ b/src/version.c @@ -1,6 +1,6 @@ /* * Copyright 1996-1997 by Frederic Lepied, France. - * + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Frederic Lepied makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR diff --git a/src/xinput.c b/src/xinput.c index 6bafb2a..f74dee5 100644 --- a/src/xinput.c +++ b/src/xinput.c @@ -113,7 +113,7 @@ find_device_info(Display *display, int len = strlen(name); Bool is_id = True; XID id; - + for(loop=0; loopfunc_name) { fprintf(stderr, "\txinput %s %s\n", pdriver->func_name, pdriver->arg_desc); @@ -157,14 +157,14 @@ main(int argc, char * argv[]) Display *display; entry *driver = drivers; char *func; - + if (argc < 2) { usage(); return EXIT_FAILURE; } - + display = XOpenDisplay(NULL); - + if (display == NULL) { fprintf(stderr, "Unable to connect to X server\n"); return EXIT_FAILURE; @@ -177,7 +177,7 @@ main(int argc, char * argv[]) fprintf(stderr, "%s extension not available\n", INAME); return EXIT_FAILURE; } - + while(driver->func_name) { if (strcmp(driver->func_name, func) == 0) { int r = (*driver->func)(display, argc-2, argv+2, @@ -187,9 +187,9 @@ main(int argc, char * argv[]) } driver++; } - + usage(); - + return EXIT_FAILURE; } diff --git a/src/xinput.h b/src/xinput.h index 02058a2..a43ab73 100644 --- a/src/xinput.h +++ b/src/xinput.h @@ -1,6 +1,6 @@ /* * Copyright 1996 by Frederic Lepied, France. - * + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Frederic Lepied makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR