[PATCH v2] input: constify valuators passed in by input drivers.
Peter Hutterer
peter.hutterer at who-t.net
Mon Aug 16 18:15:28 PDT 2010
GPE, GKVE and GProxE copy the valuators passed in, leaving the source intact.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
This patch is dependent on the valuator copy patch and since it technically
constitutes an API change I'll keep in in my input-next branch until after
1.9.
Changes to v1: the first version of this patch had the constification and
the valuator copy in one patch. This part just adds the const keywords.
dix/getevents.c | 6 +++---
hw/xfree86/common/xf86Xinput.c | 8 ++++----
hw/xfree86/common/xf86Xinput.h | 8 ++++----
include/input.h | 6 +++---
4 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dix/getevents.c b/dix/getevents.c
index e5134d3..4d32ed3 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -912,7 +912,7 @@ GetKeyboardEvents(EventList *events, DeviceIntPtr pDev, int type, int key_code)
int
GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type,
int key_code, int first_valuator,
- int num_valuators, int *valuators_in) {
+ int num_valuators, const int *valuators_in) {
int num_events = 0;
CARD32 ms = 0;
DeviceEvent *event;
@@ -1071,7 +1071,7 @@ transformAbsolute(DeviceIntPtr dev, int v[MAX_VALUATORS])
int
GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
int flags, int first_valuator, int num_valuators,
- int *valuators_in) {
+ const int *valuators_in) {
int num_events = 1;
CARD32 ms;
DeviceEvent *event;
@@ -1191,7 +1191,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
*/
int
GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type,
- int first_valuator, int num_valuators, int *valuators_in)
+ int first_valuator, int num_valuators, const int *valuators_in)
{
int num_events = 1;
DeviceEvent *event;
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index bd77fe6..be8590c 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -1001,7 +1001,7 @@ xf86PostMotionEventP(DeviceIntPtr device,
int is_absolute,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
{
int i = 0, nevents = 0;
Bool drag = xf86SendDragEvents(device);
@@ -1088,7 +1088,7 @@ xf86PostProximityEventP(DeviceIntPtr device,
int is_in,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
{
int i, nevents;
@@ -1134,7 +1134,7 @@ xf86PostButtonEventP(DeviceIntPtr device,
int is_down,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
{
int i = 0, nevents = 0;
int flags = 0;
@@ -1199,7 +1199,7 @@ xf86PostKeyEventP(DeviceIntPtr device,
int is_absolute,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
{
int i = 0, nevents = 0;
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 20a3f1b..d8e69cf 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -164,23 +164,23 @@ extern _X_EXPORT InputInfoPtr xf86InputDevs;
extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
int first_valuator, int num_valuators, ...);
extern _X_EXPORT void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
- int first_valuator, int num_valuators, int *valuators);
+ int first_valuator, int num_valuators, const int *valuators);
extern _X_EXPORT void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
int first_valuator, int num_valuators, ...);
extern _X_EXPORT void xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator,
- int num_valuators, int *valuators);
+ int num_valuators, const int *valuators);
extern _X_EXPORT void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,
int is_down, int first_valuator, int num_valuators,
...);
extern _X_EXPORT void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute, int button,
int is_down, int first_valuator, int num_valuators,
- int *valuators);
+ const int *valuators);
extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down,
int is_absolute, int first_valuator, int num_valuators,
...);
extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device, unsigned int key_code, int is_down,
int is_absolute, int first_valuator, int num_valuators,
- int *valuators);
+ const int *valuators);
extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
int is_down);
extern _X_EXPORT int xf86ActivateDevice(LocalDevicePtr local);
diff --git a/include/input.h b/include/input.h
index ffb1c33..d4da569 100644
--- a/include/input.h
+++ b/include/input.h
@@ -453,7 +453,7 @@ extern _X_EXPORT int GetPointerEvents(
int flags,
int first_valuator,
int num_valuators,
- int *valuators);
+ const int *valuators);
extern _X_EXPORT int GetKeyboardEvents(
EventListPtr events,
@@ -468,7 +468,7 @@ extern int GetKeyboardValuatorEvents(
int key_code,
int first_valuator,
int num_valuator,
- int *valuators);
+ const int *valuators);
extern int GetProximityEvents(
EventListPtr events,
@@ -476,7 +476,7 @@ extern int GetProximityEvents(
int type,
int first_valuator,
int num_valuators,
- int *valuators);
+ const int *valuators);
extern void PostSyntheticMotion(
DeviceIntPtr pDev,
--
1.7.2.1
More information about the xorg-devel
mailing list