summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-05-05 09:30:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-05-19 13:02:12 +1000
commit4a694b3f4f5c92d62526ea1c5461c59df86c13db (patch)
tree59d47983f22336d70e55817c60e084990d296b75
parentfd680f025b1db22b1069aed2f142f670181574e5 (diff)
Silence compiler warning due to differnent event conversion procs
XExtInt.c:161:5: warning: initialization from incompatible pointer type XSndExEv.c: In function 'XSendExtensionEvent': XSndExEv.c:84:8: warning: assignment from incompatible pointer type Xlib and libXi differ in the conversion functions. libXi takes an xEvent** and a num_events parameter since it may split an event into multiple xEvents. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/XExtInt.c4
-rw-r--r--src/XSndExEv.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c
index 55144c6..32df6f9 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -149,6 +149,8 @@ wireToPropertyEvent(xXIPropertyEvent *in, XGenericEventCookie *cookie);
static /* const */ XEvent emptyevent;
+typedef Status (*core_event_to_wire)(Display*, XEvent*, xEvent*);
+
static /* const */ XExtensionHooks xinput_extension_hooks = {
NULL, /* create_gc */
NULL, /* copy_gc */
@@ -158,7 +160,7 @@ static /* const */ XExtensionHooks xinput_extension_hooks = {
NULL, /* free_font */
XInputClose, /* close_display */
XInputWireToEvent, /* wire_to_event */
- _XiEventToWire, /* event_to_wire */
+ (core_event_to_wire)_XiEventToWire, /* event_to_wire */
NULL, /* error */
XInputError, /* error_string */
};
diff --git a/src/XSndExEv.c b/src/XSndExEv.c
index ebaab33..e21f8f7 100644
--- a/src/XSndExEv.c
+++ b/src/XSndExEv.c
@@ -57,6 +57,11 @@ SOFTWARE.
#include <X11/extensions/extutil.h>
#include "XIint.h"
+/* Xlib's wire_vec is defined for a single event only, libXi may return
+ * multiple events.
+ */
+typedef Status (*ext_event_to_wire)(Display*, XEvent*, xEvent**, int*);
+
Status
XSendExtensionEvent(
register Display *dpy,
@@ -71,7 +76,7 @@ XSendExtensionEvent(
int ev_size;
xSendExtensionEventReq *req;
xEvent *ev;
- register Status(**fp) (Display *, XEvent*, xEvent **, int *);
+ ext_event_to_wire *fp;
Status status;
XExtDisplayInfo *info = XInput_find_display(dpy);
@@ -81,10 +86,10 @@ XSendExtensionEvent(
/* call through display to find proper conversion routine */
- fp = &dpy->wire_vec[event->type & 0177];
+ fp = (ext_event_to_wire*)&dpy->wire_vec[event->type & 0177];
if (*fp == NULL)
*fp = _XiEventToWire;
- status = (**fp) (dpy, event, &ev, &num_events);
+ status = (*fp) (dpy, event, &ev, &num_events);
if (status) {
GetReq(SendExtensionEvent, req);