Tue Aug 16 06:29:28 2016 UTC ()
apply const from xorg-server 1.18


(mrg)
diff -r1.8 -r1.9 xsrc/external/mit/xf86-input-ws/dist/src/ws.c
diff -r1.1.1.2 -r1.2 xsrc/external/mit/xf86-input-ws/dist/src/ws.h

cvs diff -r1.8 -r1.9 xsrc/external/mit/xf86-input-ws/dist/src/ws.c (expand / switch to unified diff)

--- xsrc/external/mit/xf86-input-ws/dist/src/ws.c 2011/09/26 18:04:36 1.8
+++ xsrc/external/mit/xf86-input-ws/dist/src/ws.c 2016/08/16 06:29:28 1.9
@@ -122,26 +122,27 @@ SetupProc(pointer module, pointer option @@ -122,26 +122,27 @@ SetupProc(pointer module, pointer option
122static void 122static void
123TearDownProc(pointer p) 123TearDownProc(pointer p)
124{ 124{
125 DBG(1, ErrorF("WS TearDownProc called\n")); 125 DBG(1, ErrorF("WS TearDownProc called\n"));
126} 126}
127 127
128 128
129static int  129static int
130wsPreInit12(InputDriverPtr drv, InputInfoPtr pInfo, int flags) 130wsPreInit12(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
131{ 131{
132 WSDevicePtr priv; 132 WSDevicePtr priv;
133 MessageType buttons_from = X_CONFIG; 133 MessageType buttons_from = X_CONFIG;
134 char *s; 134 char *s;
 135 const char *cs;
135 int rc; 136 int rc;
136 137
137 priv = (WSDevicePtr)calloc(1, sizeof(WSDeviceRec)); 138 priv = (WSDevicePtr)calloc(1, sizeof(WSDeviceRec));
138 if (priv == NULL) { 139 if (priv == NULL) {
139 rc = BadAlloc; 140 rc = BadAlloc;
140 goto fail; 141 goto fail;
141 } 142 }
142 pInfo->private = priv; 143 pInfo->private = priv;
143 144
144#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 145#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
145 xf86CollectInputOptions(pInfo, NULL, NULL); 146 xf86CollectInputOptions(pInfo, NULL, NULL);
146 xf86ProcessCommonOptions(pInfo, pInfo->options); 147 xf86ProcessCommonOptions(pInfo, pInfo->options);
147#else 148#else
@@ -225,42 +226,42 @@ wsPreInit12(InputDriverPtr drv, InputInf @@ -225,42 +226,42 @@ wsPreInit12(InputDriverPtr drv, InputInf
225 priv->screen_no < 0) { 226 priv->screen_no < 0) {
226 priv->screen_no = 0; 227 priv->screen_no = 0;
227 } 228 }
228 229
229 230
230 priv->swap_axes = xf86SetBoolOption(pInfo->options, "SwapXY", 0); 231 priv->swap_axes = xf86SetBoolOption(pInfo->options, "SwapXY", 0);
231 if (priv->swap_axes) { 232 if (priv->swap_axes) {
232 xf86Msg(X_CONFIG, 233 xf86Msg(X_CONFIG,
233 "%s device will work with X and Y axes swapped\n", 234 "%s device will work with X and Y axes swapped\n",
234 pInfo->name); 235 pInfo->name);
235 } 236 }
236 priv->inv_x = 0; 237 priv->inv_x = 0;
237 priv->inv_y = 0; 238 priv->inv_y = 0;
238 s = xf86FindOptionValue(pInfo->options, "Rotate"); 239 cs = xf86FindOptionValue(pInfo->options, "Rotate");
239 if (s) { 240 if (cs) {
240 if (xf86NameCmp(s, "CW") == 0) { 241 if (xf86NameCmp(cs, "CW") == 0) {
241 priv->inv_x = 1; 242 priv->inv_x = 1;
242 priv->inv_y = 0; 243 priv->inv_y = 0;
243 priv->swap_axes = 1; 244 priv->swap_axes = 1;
244 } else if (xf86NameCmp(s, "CCW") == 0) { 245 } else if (xf86NameCmp(cs, "CCW") == 0) {
245 priv->inv_x = 0; 246 priv->inv_x = 0;
246 priv->inv_y = 1; 247 priv->inv_y = 1;
247 priv->swap_axes = 1; 248 priv->swap_axes = 1;
248 } else if (xf86NameCmp(s, "UD") == 0) { 249 } else if (xf86NameCmp(cs, "UD") == 0) {
249 priv->inv_x = 1; 250 priv->inv_x = 1;
250 priv->inv_y = 1; 251 priv->inv_y = 1;
251 } else { 252 } else {
252 xf86Msg(X_ERROR, "\"%s\" is not a valid value " 253 xf86Msg(X_ERROR, "\"%s\" is not a valid value "
253 "for Option \"Rotate\"\n", s); 254 "for Option \"Rotate\"\n", cs);
254 xf86Msg(X_ERROR, "Valid options are \"CW\", \"CCW\"," 255 xf86Msg(X_ERROR, "Valid options are \"CW\", \"CCW\","
255 " or \"UD\"\n"); 256 " or \"UD\"\n");
256 } 257 }
257 } 258 }
258 if (wsOpen(pInfo) != Success) { 259 if (wsOpen(pInfo) != Success) {
259 rc = BadValue; 260 rc = BadValue;
260 goto fail; 261 goto fail;
261 } 262 }
262 if (ioctl(pInfo->fd, WSMOUSEIO_GTYPE, &priv->type) != 0) { 263 if (ioctl(pInfo->fd, WSMOUSEIO_GTYPE, &priv->type) != 0) {
263 wsClose(pInfo); 264 wsClose(pInfo);
264 rc = BadValue; 265 rc = BadValue;
265 goto fail; 266 goto fail;
266 } 267 }

cvs diff -r1.1.1.2 -r1.2 xsrc/external/mit/xf86-input-ws/dist/src/ws.h (expand / switch to unified diff)

--- xsrc/external/mit/xf86-input-ws/dist/src/ws.h 2011/08/02 09:28:21 1.1.1.2
+++ xsrc/external/mit/xf86-input-ws/dist/src/ws.h 2016/08/16 06:29:28 1.2
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23extern int ws_debug_level; 23extern int ws_debug_level;
24#ifdef DEBUG 24#ifdef DEBUG
25# define DBG(lvl, f) { if ((lvl) <= ws_debug_level) f;} 25# define DBG(lvl, f) { if ((lvl) <= ws_debug_level) f;}
26#else 26#else
27# define DBG(lvl, f) 27# define DBG(lvl, f)
28#endif 28#endif
29 29
30#define NAXES 2 /* X and Y axes only */ 30#define NAXES 2 /* X and Y axes only */
31#define NBUTTONS 32 /* max theoretical buttons */ 31#define NBUTTONS 32 /* max theoretical buttons */
32#define DFLTBUTTONS 3 /* default number of buttons */ 32#define DFLTBUTTONS 3 /* default number of buttons */
33#define NUMEVENTS 16 /* max # of ws events to read at once */ 33#define NUMEVENTS 16 /* max # of ws events to read at once */
34 34
35typedef struct WSDevice { 35typedef struct WSDevice {
36 char *devName; /* device name */ 36 const char *devName; /* device name */
37 int type; /* ws device type */ 37 int type; /* ws device type */
38 unsigned int buttons; /* # of buttons */ 38 unsigned int buttons; /* # of buttons */
39 unsigned int lastButtons; /* last state of buttons */ 39 unsigned int lastButtons; /* last state of buttons */
40 int min_x, max_x, min_y, max_y; /* coord space */ 40 int min_x, max_x, min_y, max_y; /* coord space */
41 int swap_axes; 41 int swap_axes;
42 int raw; 42 int raw;
43 int inv_x, inv_y; 43 int inv_x, inv_y;
44 int screen_no; 44 int screen_no;
45 int num, den, threshold; /* relative accel params */ 45 int num, den, threshold; /* relative accel params */
46 pointer buffer; 46 pointer buffer;
47 int negativeZ, positiveZ; /* mappings for Z axis */ 47 int negativeZ, positiveZ; /* mappings for Z axis */
48 int negativeW, positiveW; /* mappings for W axis */ 48 int negativeW, positiveW; /* mappings for W axis */
49 struct wsmouse_calibcoords coords; /* mirror of the kernel values */ 49 struct wsmouse_calibcoords coords; /* mirror of the kernel values */