Replace some input devPrivates with regular struct fields

In the process, fixes a memory leak in CloseDevice, and an unchecked
memory allocation in InitializePredictableAccelerationProperties.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
This commit is contained in:
Keith Packard 2010-04-29 12:24:49 -07:00
commit 65e961fcc1
6 changed files with 47 additions and 92 deletions

View file

@ -514,8 +514,9 @@ typedef struct _DeviceIntRec {
LedFeedbackPtr leds;
struct _XkbInterest *xkb_interest;
char *config_info; /* used by the hotplug layer */
ClassesPtr unused_classes; /* for master devices */
int saved_master_id; /* for slaves while grabbed */
PrivateRec *devPrivates;
int nPrivates;
DeviceUnwrapProc unwrapProc;
SpriteInfoPtr spriteInfo;
union {

View file

@ -62,6 +62,9 @@ typedef struct _MotionTracker {
int dir; /* initial direction bitfield */
} MotionTracker, *MotionTrackerPtr;
/* number of properties for predictable acceleration */
#define NPROPS_PREDICTABLE_ACCEL 4
/**
* Contains all data needed to implement mouse ballistics
*/
@ -88,9 +91,9 @@ typedef struct _DeviceVelocityRec {
struct { /* to be able to query this information */
int profile_number;
} statistics;
long prop_handlers[NPROPS_PREDICTABLE_ACCEL];
} DeviceVelocityRec, *DeviceVelocityPtr;
extern _X_EXPORT void
InitVelocityData(DeviceVelocityPtr vel);