Commit 145947ed authored by Paulo Cesar Pereira de Andrade's avatar Paulo Cesar Pereira de Andrade Committed by Peter Hutterer

libXi ansification.

Thre are still two remaining compiler warnings, because of non matching
function prototypes and function pointer arguments prototypes:

src/XSndExEv.c:XSendExtensionEvent()
  variable register Status(**fp) (Display *, XEvent*, xEvent **, int *)
  doesn't match struct _XDisplay's:
  Status (*wire_vec[128])( /* vector for event to wire */
                Display *       /* dpy */,
                XEvent *        /* re */,
                xEvent *        /* event */
                );

and

src/XExtInt.c:xinput_extension_hooks field event_to_wire of type
  XExtensionHooks that has the prototype     Status (*event_to_wire)(
	      Display*			/* display */,
              XEvent*			/* re */,
              xEvent*			/* event */
  );
  does not match Status
  _XiEventToWire(
    register Display	 *dpy,		/* pointer to display structure */
    register XEvent	 *re,		/* pointer to client event */
    register xEvent	**event,	/* wire protocol event */
    register int	 *count);
Signed-off-by: default avatarPeter Hutterer <peter@cs.unisa.edu.au>
parent 3e99cc28
......@@ -61,11 +61,11 @@ SOFTWARE.
#include "XIint.h"
int
XAllowDeviceEvents(dpy, dev, event_mode, time)
register Display *dpy;
XDevice *dev;
int event_mode;
Time time;
XAllowDeviceEvents(
register Display *dpy,
XDevice *dev,
int event_mode,
Time time)
{
xAllowDeviceEventsReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
......
......@@ -62,11 +62,11 @@ SOFTWARE.
#include "XIint.h"
int
XChangeDeviceControl(dpy, dev, control, d)
register Display *dpy;
XDevice *dev;
int control;
XDeviceControl *d;
XChangeDeviceControl(
register Display *dpy,
XDevice *dev,
int control,
XDeviceControl *d)
{
int length;
xChangeDeviceControlReq *req;
......
......@@ -62,11 +62,11 @@ SOFTWARE.
#include "XIint.h"
int
XChangeFeedbackControl(dpy, dev, mask, f)
register Display *dpy;
XDevice *dev;
unsigned long mask;
XFeedbackControl *f;
XChangeFeedbackControl(
register Display *dpy,
XDevice *dev,
unsigned long mask,
XFeedbackControl *f)
{
int length;
xChangeFeedbackControlReq *req;
......
......@@ -61,13 +61,13 @@ SOFTWARE.
#include "XIint.h"
int
XChangeDeviceKeyMapping(dpy, dev, first, syms_per_code, keysyms, count)
register Display *dpy;
XDevice *dev;
int first;
int syms_per_code;
KeySym *keysyms;
int count;
XChangeDeviceKeyMapping(
register Display *dpy,
XDevice *dev,
int first,
int syms_per_code,
KeySym *keysyms,
int count)
{
register long nbytes;
xChangeDeviceKeyMappingReq *req;
......
......@@ -61,9 +61,9 @@ SOFTWARE.
#include "XIint.h"
int
XChangeKeyboardDevice(dpy, dev)
register Display *dpy;
XDevice *dev;
XChangeKeyboardDevice(
register Display *dpy,
XDevice *dev)
{
xChangeKeyboardDeviceReq *req;
xChangeKeyboardDeviceReply rep;
......
......@@ -61,11 +61,11 @@ SOFTWARE.
#include "XIint.h"
int
XChangePointerDevice(dpy, dev, xaxis, yaxis)
register Display *dpy;
XDevice *dev;
int xaxis;
int yaxis;
XChangePointerDevice(
register Display *dpy,
XDevice *dev,
int xaxis,
int yaxis)
{
xChangePointerDeviceReq *req;
xChangePointerDeviceReply rep;
......
......@@ -62,12 +62,12 @@ SOFTWARE.
#include "XIint.h"
int
XChangeDeviceDontPropagateList(dpy, window, count, events, mode)
register Display *dpy;
Window window;
int count;
XEventClass *events;
int mode;
XChangeDeviceDontPropagateList(
register Display *dpy,
Window window,
int count,
XEventClass *events,
int mode)
{
xChangeDeviceDontPropagateListReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
......
......@@ -61,9 +61,9 @@ SOFTWARE.
#include "XIint.h"
int
XCloseDevice(dpy, dev)
register Display *dpy;
register XDevice *dev;
XCloseDevice(
register Display *dpy,
register XDevice *dev)
{
xCloseDeviceReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
......
......@@ -61,11 +61,12 @@ SOFTWARE.
#include "XIint.h"
int
XDeviceBell(dpy, dev, feedbackclass, feedbackid, percent)
register Display *dpy;
XDevice *dev;
XID feedbackclass, feedbackid;
int percent;
XDeviceBell(
register Display *dpy,
XDevice *dev,
XID feedbackclass,
XID feedbackid,
int percent)
{
xDeviceBellReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
......
......@@ -66,12 +66,64 @@ SOFTWARE.
#define ENQUEUE_EVENT True
#define DONT_ENQUEUE False
extern void _xibaddevice(
Display * /* dpy */,
int * /* error */
);
extern void _xibadclass(
Display * /* dpy */,
int * /* error */
);
extern void _xibadevent(
Display * /* dpy */,
int * /* error */
);
extern void _xibadmode(
Display * /* dpy */,
int * /* error */
);
extern void _xidevicebusy(
Display * /* dpy */,
int * /* error */
);
extern int _XiGetDevicePresenceNotifyEvent(
Display * /* dpy */
);
static XExtensionInfo *xinput_info;
static /* const */ char *xinput_extension_name = INAME;
static int XInputClose();
static char *XInputError();
static Bool XInputWireToEvent();
Status _XiEventToWire();
static int XInputClose(
Display * /* dpy */,
XExtCodes * /* codes */
);
static char *XInputError(
Display * /* dpy */,
int /* code */,
XExtCodes * /* codes */,
char * /* buf */,
int /* n */
);
static Bool XInputWireToEvent(
Display * /* dpy */,
XEvent * /* re */,
xEvent * /* event */
);
Status _XiEventToWire(
register Display * /* dpy */,
register XEvent * /* re */,
register xEvent ** /* event */,
register int * /* count */
);
static /* const */ XEvent emptyevent;
typedef struct _XInputData
......@@ -131,9 +183,9 @@ XEXT_GENERATE_FIND_DISPLAY(XInput_find_display, xinput_info,
*/
void
_xibaddevice(dpy, error)
Display *dpy;
int *error;
_xibaddevice(
Display *dpy,
int *error)
{
XExtDisplayInfo *info = XInput_find_display(dpy);
......@@ -141,9 +193,9 @@ _xibaddevice(dpy, error)
}
void
_xibadclass(dpy, error)
Display *dpy;
int *error;
_xibadclass(
Display *dpy,
int *error)
{
XExtDisplayInfo *info = XInput_find_display(dpy);
......@@ -151,9 +203,9 @@ _xibadclass(dpy, error)
}
void
_xibadevent(dpy, error)
Display *dpy;
int *error;
_xibadevent(
Display *dpy,
int *error)
{
XExtDisplayInfo *info = XInput_find_display(dpy);
......@@ -161,9 +213,9 @@ _xibadevent(dpy, error)
}
void
_xibadmode(dpy, error)
Display *dpy;
int *error;
_xibadmode(
Display *dpy,
int *error)
{
XExtDisplayInfo *info = XInput_find_display(dpy);
......@@ -171,9 +223,9 @@ _xibadmode(dpy, error)
}
void
_xidevicebusy(dpy, error)
Display *dpy;
int *error;
_xidevicebusy(
Display *dpy,
int *error)
{
XExtDisplayInfo *info = XInput_find_display(dpy);
......@@ -194,10 +246,10 @@ static int XInputCheckExtension(Display *dpy, XExtDisplayInfo *info)
*/
int
_XiCheckExtInit(dpy, version_index, info)
register Display *dpy;
register int version_index;
XExtDisplayInfo *info;
_XiCheckExtInit(
register Display *dpy,
register int version_index,
XExtDisplayInfo *info)
{
XExtensionVersion *ext;
......@@ -235,9 +287,9 @@ _XiCheckExtInit(dpy, version_index, info)
*/
static int
XInputClose(dpy, codes)
Display *dpy;
XExtCodes *codes;
XInputClose(
Display *dpy,
XExtCodes *codes)
{
XExtDisplayInfo *info = XInput_find_display(dpy);
......@@ -249,8 +301,7 @@ XInputClose(dpy, codes)
}
static int
Ones(mask)
Mask mask;
Ones(Mask mask)
{
register Mask y;
......@@ -275,10 +326,10 @@ _XiGetDevicePresenceNotifyEvent(Display * dpy)
*/
static Bool
XInputWireToEvent(dpy, re, event)
Display *dpy;
XEvent *re;
xEvent *event;
XInputWireToEvent(
Display *dpy,
XEvent *re,
xEvent *event)
{
unsigned int type, reltype;
unsigned int i, j;
......
......@@ -62,11 +62,11 @@ SOFTWARE.
#include "XIint.h"
Status
_XiEventToWire(dpy, re, event, count)
register Display *dpy; /* pointer to display structure */
register XEvent *re; /* pointer to client event */
register xEvent **event; /* wire protocol event */
register int *count;
_XiEventToWire(
register Display *dpy, /* pointer to display structure */
register XEvent *re, /* pointer to client event */
register xEvent **event, /* wire protocol event */
register int *count)
{
XExtDisplayInfo *info = XInput_find_display(dpy);
int i;
......
......@@ -62,8 +62,7 @@ SOFTWARE.
*
*/
XFreeDeviceList(list)
XDeviceList *list;
XFreeDeviceList(XDeviceList *list)
{
if (list != NULL) {
XFree((list->name) - sizeof(XDeviceList));
......
......@@ -60,21 +60,15 @@ SOFTWARE.
#include <X11/extensions/extutil.h>
#include "XIint.h"
XDeviceTimeCoord
* XGetDeviceMotionEvents(dpy, dev, start, stop, nEvents, mode, axis_count)
register Display *
dpy;
XDevice *
dev;
Time start;
Time stop;
int *
nEvents;
int *
mode;
int *
axis_count;
XDeviceTimeCoord *
XGetDeviceMotionEvents(
register Display *dpy,
XDevice *dev,
Time start,
Time stop,
int *nEvents,
int *mode,
int *axis_count)
{
xGetDeviceMotionEventsReq *req;
xGetDeviceMotionEventsReply rep;
......@@ -140,8 +134,7 @@ Time stop;
}
void
XFreeDeviceMotionEvents(events)
XDeviceTimeCoord *events;
XFreeDeviceMotionEvents(XDeviceTimeCoord *events)
{
XFree((char *)events);
}
......@@ -66,11 +66,11 @@ SOFTWARE.
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int
XGetDeviceButtonMapping(dpy, device, map, nmap)
register Display *dpy;
XDevice *device;
unsigned char map[];
unsigned int nmap;
XGetDeviceButtonMapping(
register Display *dpy,
XDevice *device,
unsigned char map[],
unsigned int nmap)
{
int status = 0;
unsigned char mapping[256]; /* known fixed size */
......
......@@ -62,10 +62,10 @@ SOFTWARE.
#include "XIint.h"
XDeviceControl *
XGetDeviceControl(dpy, dev, control)
register Display *dpy;
XDevice *dev;
int control;
XGetDeviceControl(
register Display *dpy,
XDevice *dev,
int control)
{
int size = 0;
int nbytes, i;
......@@ -239,8 +239,7 @@ XGetDeviceControl(dpy, dev, control)
}
void
XFreeDeviceControl(control)
XDeviceControl *control;
XFreeDeviceControl(XDeviceControl *control)
{
XFree(control);
}
......@@ -62,10 +62,10 @@ SOFTWARE.
#include "XIint.h"
XFeedbackState *
XGetFeedbackControl(dpy, dev, num_feedbacks)
register Display *dpy;
XDevice *dev;
int *num_feedbacks;
XGetFeedbackControl(
register Display *dpy,
XDevice *dev,
int *num_feedbacks)
{
int size = 0;
int nbytes, i;
......@@ -265,8 +265,7 @@ XGetFeedbackControl(dpy, dev, num_feedbacks)
}
void
XFreeFeedbackList(list)
XFeedbackState *list;
XFreeFeedbackList(XFeedbackState *list)
{
XFree((char *)list);
}
......@@ -61,9 +61,9 @@ SOFTWARE.
#include "XIint.h"
XModifierKeymap *
XGetDeviceModifierMapping(dpy, dev)
register Display *dpy;
XDevice *dev;
XGetDeviceModifierMapping(
register Display *dpy,
XDevice *dev)
{
unsigned long nbytes;
XModifierKeymap *res;
......
......@@ -62,11 +62,10 @@ SOFTWARE.
#include "XIint.h"
XEventClass *
XGetDeviceDontPropagateList(dpy, window, count)
register Display *dpy;
Window window;
int *count;
XGetDeviceDontPropagateList(
register Display *dpy,
Window window,
int *count)
{
XEventClass *list = NULL;
int rlen;
......
......@@ -61,20 +61,18 @@ SOFTWARE.
#include "XIint.h"
int
XGrabDeviceButton(dpy, dev, button, modifiers, modifier_device,
grab_window, owner_events, event_count, event_list,
this_device_mode, other_devices_mode)
register Display *dpy;
XDevice *dev;
unsigned int button; /* CARD8 */
unsigned int modifiers; /* CARD16 */
XDevice *modifier_device;
Window grab_window;
Bool owner_events;
unsigned int event_count;
XEventClass *event_list;
int this_device_mode;
int other_devices_mode;
XGrabDeviceButton(
register Display *dpy,
XDevice *dev,
unsigned int button, /* CARD8 */
unsigned int modifiers, /* CARD16 */
XDevice *modifier_device,
Window grab_window,
Bool owner_events,
unsigned int event_count,
XEventClass *event_list,
int this_device_mode,
int other_devices_mode)
{
register xGrabDeviceButtonReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
......
......@@ -61,20 +61,18 @@ SOFTWARE.
#include "XIint.h"
int
XGrabDeviceKey(dpy, dev, key, modifiers, modifier_device,
grab_window, owner_events, event_count, event_list,
this_device_mode, other_devices_mode)
register Display *dpy;
XDevice *dev;
unsigned int key; /* CARD8 */
unsigned int modifiers; /* CARD16 */
XDevice *modifier_device;
Window grab_window;
Bool owner_events;
unsigned int event_count;
XEventClass *event_list;
int this_device_mode;
int other_devices_mode;
XGrabDeviceKey(
register Display *dpy,
XDevice *dev,
unsigned int key, /* CARD8 */
unsigned int modifiers, /* CARD16 */
XDevice *modifier_device,
Window grab_window,
Bool owner_events,
unsigned int event_count,
XEventClass *event_list,
int this_device_mode,
int other_devices_mode)
{
register xGrabDeviceKeyReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
......
......@@ -61,17 +61,16 @@ SOFTWARE.
#include "XIint.h"
int
XGrabDevice(dpy, dev, grab_window, ownerEvents, event_count, event_list,
this_device_mode, other_devices_mode, time)
register Display *dpy;
XDevice *dev;
Window grab_window;
Bool ownerEvents;
int event_count;
XEventClass *event_list;
int this_device_mode;
int other_devices_mode;
Time time;
XGrabDevice(
register Display *dpy,
XDevice *dev,
Window grab_window,
Bool ownerEvents,
int event_count,
XEventClass *event_list,
int this_device_mode,
int other_devices_mode,
Time time)
{
xGrabDeviceReply rep;
register xGrabDeviceReq *req;
......
......@@ -61,12 +61,12 @@ SOFTWARE.
#include "XIint.h"
int
XGetDeviceFocus(dpy, dev, focus, revert_to, time)
register Display *dpy;
XDevice *dev;
Window *focus;
int *revert_to;
Time *time;
XGetDeviceFocus(
register Display *dpy,
XDevice *dev,
Window *focus,
int *revert_to,
Time *time)
{
xGetDeviceFocusReq *req;
xGetDeviceFocusReply rep;
......
......@@ -61,14 +61,13 @@ SOFTWARE.
#include "XIint.h"
int
XGetSelectedExtensionEvents(dpy, w, this_client_count, this_client_list,
all_clients_count, all_clients_list)
register Display *dpy;
Window w;
int *this_client_count;
XEventClass **this_client_list;
int *all_clients_count;
XEventClass **all_clients_list;
XGetSelectedExtensionEvents(
register Display *dpy,
Window w,
int *this_client_count,
XEventClass **this_client_list,
int *all_clients_count,
XEventClass **all_clients_list)
{
int tlen, alen;
register xGetSelectedExtensionEventsReq *req;
......
......@@ -14,4 +14,11 @@ extern int _XiCheckExtInit(Display *, int, XExtDisplayInfo *);
extern XExtensionVersion *_XiGetExtensionVersion(Display *, _Xconst char *, XExtDisplayInfo *);
extern Status _XiEventToWire(
register Display * /* dpy */,
register XEvent * /* re */,
register xEvent ** /* event */,
register int * /* count */
);
#endif
......@@ -64,9 +64,9 @@ SOFTWARE.
#include "XIint.h"
XDeviceInfo *
XListInputDevices(dpy, ndevices)
register Display *dpy;
int *ndevices;
XListInputDevices(
register Display *dpy,
int *ndevices)
{
int size;
xListInputDevicesReq *req;
......@@ -238,8 +238,7 @@ XListInputDevices(dpy, ndevices)
*/
void
XFreeDeviceList(list)
XDeviceInfo *list;
XFreeDeviceList(XDeviceInfo *list)
{
if (list != NULL) {
XFree((char *)list);
......
......@@ -61,9 +61,9 @@ SOFTWARE.
#include "XIint.h"
XDevice *
XOpenDevice(dpy, id)
register Display *dpy;
register XID id;
XOpenDevice(
register Display *dpy,
register XID id)
{
register long rlen; /* raw length */
xOpenDeviceReq *req;
......
......@@ -61,9 +61,9 @@ SOFTWARE.
#include "XIint.h"
XDeviceState *
XQueryDeviceState(dpy, dev)
register Display *dpy;
XDevice *dev;
XQueryDeviceState(
register Display *dpy,
XDevice *dev)
{
int i, j;
int rlen;
......@@ -186,8 +186,7 @@ XQueryDeviceState(dpy, dev)
}
void
XFreeDeviceState(list)
XDeviceState *list;
XFreeDeviceState(XDeviceState *list)
{
XFree((char *)list);
}
......@@ -61,11 +61,11 @@ SOFTWARE.
#include "XIint.h"
int
XSelectExtensionEvent(dpy, w, event_list, count)
register Display *dpy;
Window w;
XEventClass *event_list;
int count;
XSelectExtensionEvent(
register Display *dpy,
Window w,
XEventClass *event_list,
int count)
{
register xSelectExtensionEventReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
......
......@@ -64,11 +64,11 @@ SOFTWARE.