kdrive: make mouse driver Init() and Enable() funcs bool

They're similar to the keyboard driver's ones, and those already using
Bool, so it's more consistent using Bool here, too.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-03-03 14:16:40 +01:00
committed by Enrico Weigelt, metux IT consult .
parent 7ef19de104
commit 528ad3e771
3 changed files with 10 additions and 9 deletions

View File

@@ -1262,7 +1262,7 @@ ephyrPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs)
/* Mouse calls */
static Status
static Bool
MouseInit(KdPointerInfo * pi)
{
pi->driverPrivate = (EphyrPointerPrivate *)
@@ -1281,15 +1281,15 @@ MouseInit(KdPointerInfo * pi)
pi->transformCoordinates = TRUE;
ephyrMouse = pi;
return Success;
return TRUE;
}
static Status
static Bool
MouseEnable(KdPointerInfo * pi)
{
((EphyrPointerPrivate *) pi->driverPrivate)->enabled = TRUE;
SetNotifyFd(hostx_get_fd(), ephyrXcbNotify, X_NOTIFY_READ, NULL);
return Success;
return TRUE;
}
static void

View File

@@ -26,8 +26,10 @@
#include <stdio.h>
#include <string.h>
#include <X11/X.h>
#include <X11/Xdefs.h>
#include <X11/Xproto.h>
#include <X11/Xos.h>
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "windowstr.h"
@@ -169,8 +171,8 @@ typedef struct _KdPointerInfo KdPointerInfo;
typedef struct _KdPointerDriver {
const char *name;
Status(*Init) (KdPointerInfo *);
Status(*Enable) (KdPointerInfo *);
Bool (*Init) (KdPointerInfo *);
Bool (*Enable) (KdPointerInfo *);
void (*Disable) (KdPointerInfo *);
void (*Fini) (KdPointerInfo *);
struct _KdPointerDriver *next;

View File

@@ -237,9 +237,8 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff)
return BadImplementation;
}
if ((*pi->driver->Init) (pi) != Success) {
if (!(pi->driver->Init(pi)))
return BadRequest;
}
btn_labels = calloc(pi->nButtons, sizeof(Atom));
if (!btn_labels)
@@ -303,7 +302,7 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff)
return BadImplementation;
}
if ((*pi->driver->Enable) (pi) == Success) {
if (pi->driver->Enable(pi)) {
pDev->on = TRUE;
return Success;
}