Merge remote-tracking branch 'whot/for-keith'
This commit is contained in:
commit
5300212ce8
|
@ -1169,8 +1169,8 @@ IResetProc(ExtensionEntry * unused)
|
|||
EventSwapVector[DevicePropertyNotify] = NotImplemented;
|
||||
RestoreExtensionEvents();
|
||||
|
||||
free((void *) xi_all_devices.name);
|
||||
free((void *) xi_all_master_devices.name);
|
||||
free(xi_all_devices.name);
|
||||
free(xi_all_master_devices.name);
|
||||
|
||||
XIBarrierReset();
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size)
|
|||
static void
|
||||
CopyDeviceName(char **namebuf, const char *name)
|
||||
{
|
||||
char *nameptr = (char *) *namebuf;
|
||||
char *nameptr = *namebuf;
|
||||
|
||||
if (name) {
|
||||
*nameptr++ = strlen(name);
|
||||
|
|
|
@ -242,16 +242,16 @@ device_added(struct udev_device *udev_device)
|
|||
free(config_info);
|
||||
input_option_free_list(&input_options);
|
||||
|
||||
free((void *) attrs.usb_id);
|
||||
free((void *) attrs.pnp_id);
|
||||
free((void *) attrs.product);
|
||||
free((void *) attrs.device);
|
||||
free((void *) attrs.vendor);
|
||||
free(attrs.usb_id);
|
||||
free(attrs.pnp_id);
|
||||
free(attrs.product);
|
||||
free(attrs.device);
|
||||
free(attrs.vendor);
|
||||
if (attrs.tags) {
|
||||
const char **tag = attrs.tags;
|
||||
char **tag = attrs.tags;
|
||||
|
||||
while (*tag) {
|
||||
free((void *) *tag);
|
||||
free(*tag);
|
||||
tag++;
|
||||
}
|
||||
free(attrs.tags);
|
||||
|
|
|
@ -955,7 +955,7 @@ CloseDevice(DeviceIntPtr dev)
|
|||
while (dev->xkb_interest)
|
||||
XkbRemoveResourceClient((DevicePtr) dev, dev->xkb_interest->resource);
|
||||
|
||||
free((void *) dev->name);
|
||||
free(dev->name);
|
||||
|
||||
classes = (ClassesPtr) &dev->key;
|
||||
FreeAllDeviceClasses(classes);
|
||||
|
@ -1279,6 +1279,7 @@ InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, Atom *labels,
|
|||
|
||||
BUG_RETURN_VAL(dev == NULL, FALSE);
|
||||
BUG_RETURN_VAL(dev->button != NULL, FALSE);
|
||||
BUG_RETURN_VAL(numButtons >= MAX_BUTTONS, FALSE);
|
||||
|
||||
butc = calloc(1, sizeof(ButtonClassRec));
|
||||
if (!butc)
|
||||
|
|
|
@ -478,9 +478,9 @@ SetVendorRelease(int release)
|
|||
}
|
||||
|
||||
void
|
||||
SetVendorString(const char *string)
|
||||
SetVendorString(const char *vendor)
|
||||
{
|
||||
VendorString = string;
|
||||
VendorString = vendor;
|
||||
}
|
||||
|
||||
Bool
|
||||
|
|
|
@ -1655,6 +1655,8 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
|
|||
}
|
||||
#endif
|
||||
|
||||
BUG_RETURN_VAL(buttons >= MAX_BUTTONS, 0);
|
||||
|
||||
/* refuse events from disabled devices */
|
||||
if (!pDev->enabled)
|
||||
return 0;
|
||||
|
|
|
@ -60,7 +60,8 @@ check_butmap_change(DeviceIntPtr dev, CARD8 *map, int len, CARD32 *errval_out,
|
|||
}
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (dev->button->map[i + 1] != map[i] && dev->button->down[i + 1])
|
||||
if (dev->button->map[i + 1] != map[i] &&
|
||||
button_is_down(dev, i + 1, BUTTON_PROCESSED))
|
||||
return MappingBusy;
|
||||
}
|
||||
|
||||
|
@ -351,7 +352,7 @@ DuplicateInputAttributes(InputAttributes * attrs)
|
|||
{
|
||||
InputAttributes *new_attr;
|
||||
int ntags = 0;
|
||||
const char **tags, **new_tags;
|
||||
char **tags, **new_tags;
|
||||
|
||||
if (!attrs)
|
||||
return NULL;
|
||||
|
@ -403,20 +404,20 @@ DuplicateInputAttributes(InputAttributes * attrs)
|
|||
void
|
||||
FreeInputAttributes(InputAttributes * attrs)
|
||||
{
|
||||
const char **tags;
|
||||
char **tags;
|
||||
|
||||
if (!attrs)
|
||||
return;
|
||||
|
||||
free((void *) attrs->product);
|
||||
free((void *) attrs->vendor);
|
||||
free((void *) attrs->device);
|
||||
free((void *) attrs->pnp_id);
|
||||
free((void *) attrs->usb_id);
|
||||
free(attrs->product);
|
||||
free(attrs->vendor);
|
||||
free(attrs->device);
|
||||
free(attrs->pnp_id);
|
||||
free(attrs->usb_id);
|
||||
|
||||
if ((tags = attrs->tags))
|
||||
while (*tags)
|
||||
free((void *) *tags++);
|
||||
free(*tags++);
|
||||
|
||||
free(attrs->tags);
|
||||
free(attrs);
|
||||
|
|
|
@ -777,13 +777,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
|
|||
MessageType from;
|
||||
const char *s;
|
||||
XkbRMLVOSet set;
|
||||
|
||||
/* Default options. */
|
||||
set.rules = "base";
|
||||
set.model = "pc105";
|
||||
set.layout = "us";
|
||||
set.variant = NULL;
|
||||
set.options = NULL;
|
||||
const char *rules;
|
||||
|
||||
/*
|
||||
* Merge the ServerLayout and ServerFlags options. The former have
|
||||
|
@ -963,9 +957,15 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
|
|||
* evdev rules set. */
|
||||
#if defined(linux)
|
||||
if (!xf86Info.forceInputDevices)
|
||||
set.rules = "evdev";
|
||||
rules = "evdev";
|
||||
else
|
||||
#endif
|
||||
rules = "base";
|
||||
|
||||
/* Xkb default options. */
|
||||
XkbInitRules(&set, rules, "pc105", "us", NULL, NULL);
|
||||
XkbSetRulesDflts(&set);
|
||||
XkbFreeRMLVOSet(&set, FALSE);
|
||||
|
||||
xf86Info.useDefaultFontPath = TRUE;
|
||||
xf86Info.useDefaultFontPathFrom = X_DEFAULT;
|
||||
|
|
|
@ -159,8 +159,8 @@ configureInputSection(void)
|
|||
|
||||
parsePrologue(XF86ConfInputPtr, XF86ConfInputRec)
|
||||
|
||||
ptr->inp_identifier = "Keyboard0";
|
||||
ptr->inp_driver = "kbd";
|
||||
ptr->inp_identifier = xnfstrdup("Keyboard0");
|
||||
ptr->inp_driver = xnfstrdup("kbd");
|
||||
ptr->list.next = NULL;
|
||||
|
||||
/* Crude mechanism to auto-detect mouse (os dependent) */
|
||||
|
@ -175,17 +175,17 @@ configureInputSection(void)
|
|||
}
|
||||
|
||||
mouse = calloc(1, sizeof(XF86ConfInputRec));
|
||||
mouse->inp_identifier = "Mouse0";
|
||||
mouse->inp_driver = "mouse";
|
||||
mouse->inp_identifier = xnfstrdup("Mouse0");
|
||||
mouse->inp_driver = xnfstrdup("mouse");
|
||||
mouse->inp_option_lst =
|
||||
xf86addNewOption(mouse->inp_option_lst, strdup("Protocol"),
|
||||
strdup(DFLT_MOUSE_PROTO));
|
||||
xf86addNewOption(mouse->inp_option_lst, xnfstrdup("Protocol"),
|
||||
xnfstrdup(DFLT_MOUSE_PROTO));
|
||||
mouse->inp_option_lst =
|
||||
xf86addNewOption(mouse->inp_option_lst, strdup("Device"),
|
||||
strdup(DFLT_MOUSE_DEV));
|
||||
xf86addNewOption(mouse->inp_option_lst, xnfstrdup("Device"),
|
||||
xnfstrdup(DFLT_MOUSE_DEV));
|
||||
mouse->inp_option_lst =
|
||||
xf86addNewOption(mouse->inp_option_lst, strdup("ZAxisMapping"),
|
||||
strdup("4 5 6 7"));
|
||||
xf86addNewOption(mouse->inp_option_lst, xnfstrdup("ZAxisMapping"),
|
||||
xnfstrdup("4 5 6 7"));
|
||||
ptr = (XF86ConfInputPtr) xf86addListItem((glp) ptr, (glp) mouse);
|
||||
return ptr;
|
||||
}
|
||||
|
@ -290,7 +290,7 @@ configureDeviceSection(int screennum)
|
|||
" ### <string>: \"String\", <freq>: \"<f> Hz/kHz/MHz\",\n"
|
||||
" ### <percent>: \"<f>%\"\n"
|
||||
" ### [arg]: arg optional\n";
|
||||
ptr->dev_comment = strdup(descrip);
|
||||
ptr->dev_comment = xnfstrdup(descrip);
|
||||
if (ptr->dev_comment) {
|
||||
for (p = DevToConfig[screennum].GDev.options; p->name != NULL; p++) {
|
||||
char *p_e;
|
||||
|
@ -337,9 +337,9 @@ configureLayoutSection(void)
|
|||
iptr = malloc(sizeof(XF86ConfInputrefRec));
|
||||
iptr->list.next = NULL;
|
||||
iptr->iref_option_lst = NULL;
|
||||
iptr->iref_inputdev_str = "Mouse0";
|
||||
iptr->iref_inputdev_str = xnfstrdup("Mouse0");
|
||||
iptr->iref_option_lst =
|
||||
xf86addNewOption(iptr->iref_option_lst, strdup("CorePointer"),
|
||||
xf86addNewOption(iptr->iref_option_lst, xnfstrdup("CorePointer"),
|
||||
NULL);
|
||||
ptr->lay_input_lst = (XF86ConfInputrefPtr)
|
||||
xf86addListItem((glp) ptr->lay_input_lst, (glp) iptr);
|
||||
|
@ -351,9 +351,9 @@ configureLayoutSection(void)
|
|||
iptr = malloc(sizeof(XF86ConfInputrefRec));
|
||||
iptr->list.next = NULL;
|
||||
iptr->iref_option_lst = NULL;
|
||||
iptr->iref_inputdev_str = "Keyboard0";
|
||||
iptr->iref_inputdev_str = xnfstrdup("Keyboard0");
|
||||
iptr->iref_option_lst =
|
||||
xf86addNewOption(iptr->iref_option_lst, strdup("CoreKeyboard"),
|
||||
xf86addNewOption(iptr->iref_option_lst, xnfstrdup("CoreKeyboard"),
|
||||
NULL);
|
||||
ptr->lay_input_lst = (XF86ConfInputrefPtr)
|
||||
xf86addListItem((glp) ptr->lay_input_lst, (glp) iptr);
|
||||
|
@ -431,9 +431,9 @@ configureFilesSection(void)
|
|||
parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec)
|
||||
|
||||
if (xf86ModulePath)
|
||||
ptr->file_modulepath = strdup(xf86ModulePath);
|
||||
ptr->file_modulepath = xnfstrdup(xf86ModulePath);
|
||||
if (defaultFontPath)
|
||||
ptr->file_fontpath = strdup(defaultFontPath);
|
||||
ptr->file_fontpath = xnfstrdup(defaultFontPath);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
@ -446,8 +446,8 @@ configureMonitorSection(int screennum)
|
|||
|
||||
XNFasprintf(&tmp, "Monitor%d", screennum);
|
||||
ptr->mon_identifier = tmp;
|
||||
ptr->mon_vendor = strdup("Monitor Vendor");
|
||||
ptr->mon_modelname = strdup("Monitor Model");
|
||||
ptr->mon_vendor = xnfstrdup("Monitor Vendor");
|
||||
ptr->mon_modelname = xnfstrdup("Monitor Model");
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
@ -491,7 +491,7 @@ configureDDCMonitorSection(int screennum)
|
|||
|
||||
XNFasprintf(&tmp, "Monitor%d", screennum);
|
||||
ptr->mon_identifier = tmp;
|
||||
ptr->mon_vendor = strdup(ConfiguredMonitor->vendor.name);
|
||||
ptr->mon_vendor = xnfstrdup(ConfiguredMonitor->vendor.name);
|
||||
XNFasprintf(&ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id);
|
||||
|
||||
/* features in centimetres, we want millimetres */
|
||||
|
@ -529,7 +529,7 @@ configureDDCMonitorSection(int screennum)
|
|||
|
||||
if (ConfiguredMonitor->features.dpms) {
|
||||
ptr->mon_option_lst =
|
||||
xf86addNewOption(ptr->mon_option_lst, strdup("DPMS"), NULL);
|
||||
xf86addNewOption(ptr->mon_option_lst, xnfstrdup("DPMS"), NULL);
|
||||
}
|
||||
|
||||
return ptr;
|
||||
|
|
|
@ -539,7 +539,7 @@ MatchAttrToken(const char *attr, struct xorg_list *patterns,
|
|||
* match. Each list entry is a separate Match line of the same type.
|
||||
*/
|
||||
xorg_list_for_each_entry(group, patterns, entry) {
|
||||
const char *const *cur;
|
||||
char *const *cur;
|
||||
Bool match = FALSE;
|
||||
|
||||
for (cur = group->values; *cur; cur++)
|
||||
|
@ -598,7 +598,7 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev,
|
|||
* See if any of the device's tags match any of the MatchTag tokens.
|
||||
*/
|
||||
if (!xorg_list_is_empty(&iclass->match_tag)) {
|
||||
const char *const *tag;
|
||||
char *const *tag;
|
||||
Bool match;
|
||||
|
||||
if (!attrs->tags)
|
||||
|
|
|
@ -82,8 +82,8 @@ typedef struct _InputDriverRec {
|
|||
|
||||
typedef struct _InputInfoRec {
|
||||
struct _InputInfoRec *next;
|
||||
const char *name;
|
||||
const char *driver;
|
||||
char *name;
|
||||
char *driver;
|
||||
|
||||
int flags;
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ xf86ConfigSymTabRec InputClassTab[] = {
|
|||
#define TOKEN_SEP "|"
|
||||
|
||||
static void
|
||||
add_group_entry(struct xorg_list *head, const char **values)
|
||||
add_group_entry(struct xorg_list *head, char **values)
|
||||
{
|
||||
xf86MatchGroup *group;
|
||||
|
||||
|
@ -256,7 +256,7 @@ void
|
|||
xf86printInputClassSection(FILE * cf, XF86ConfInputClassPtr ptr)
|
||||
{
|
||||
const xf86MatchGroup *group;
|
||||
const char *const *cur;
|
||||
char *const *cur;
|
||||
|
||||
while (ptr) {
|
||||
fprintf(cf, "Section \"InputClass\"\n");
|
||||
|
@ -362,7 +362,7 @@ xf86freeInputClassList(XF86ConfInputClassPtr ptr)
|
|||
|
||||
while (ptr) {
|
||||
xf86MatchGroup *group, *next;
|
||||
const char **list;
|
||||
char **list;
|
||||
|
||||
TestFree(ptr->identifier);
|
||||
TestFree(ptr->driver);
|
||||
|
@ -370,55 +370,55 @@ xf86freeInputClassList(XF86ConfInputClassPtr ptr)
|
|||
xorg_list_for_each_entry_safe(group, next, &ptr->match_product, entry) {
|
||||
xorg_list_del(&group->entry);
|
||||
for (list = group->values; *list; list++)
|
||||
free((void *) *list);
|
||||
free(*list);
|
||||
free(group);
|
||||
}
|
||||
xorg_list_for_each_entry_safe(group, next, &ptr->match_vendor, entry) {
|
||||
xorg_list_del(&group->entry);
|
||||
for (list = group->values; *list; list++)
|
||||
free((void *) *list);
|
||||
free(*list);
|
||||
free(group);
|
||||
}
|
||||
xorg_list_for_each_entry_safe(group, next, &ptr->match_device, entry) {
|
||||
xorg_list_del(&group->entry);
|
||||
for (list = group->values; *list; list++)
|
||||
free((void *) *list);
|
||||
free(*list);
|
||||
free(group);
|
||||
}
|
||||
xorg_list_for_each_entry_safe(group, next, &ptr->match_os, entry) {
|
||||
xorg_list_del(&group->entry);
|
||||
for (list = group->values; *list; list++)
|
||||
free((void *) *list);
|
||||
free(*list);
|
||||
free(group);
|
||||
}
|
||||
xorg_list_for_each_entry_safe(group, next, &ptr->match_pnpid, entry) {
|
||||
xorg_list_del(&group->entry);
|
||||
for (list = group->values; *list; list++)
|
||||
free((void *) *list);
|
||||
free(*list);
|
||||
free(group);
|
||||
}
|
||||
xorg_list_for_each_entry_safe(group, next, &ptr->match_usbid, entry) {
|
||||
xorg_list_del(&group->entry);
|
||||
for (list = group->values; *list; list++)
|
||||
free((void *) *list);
|
||||
free(*list);
|
||||
free(group);
|
||||
}
|
||||
xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) {
|
||||
xorg_list_del(&group->entry);
|
||||
for (list = group->values; *list; list++)
|
||||
free((void *) *list);
|
||||
free(*list);
|
||||
free(group);
|
||||
}
|
||||
xorg_list_for_each_entry_safe(group, next, &ptr->match_tag, entry) {
|
||||
xorg_list_del(&group->entry);
|
||||
for (list = group->values; *list; list++)
|
||||
free((void *) *list);
|
||||
free(*list);
|
||||
free(group);
|
||||
}
|
||||
xorg_list_for_each_entry_safe(group, next, &ptr->match_layout, entry) {
|
||||
xorg_list_del(&group->entry);
|
||||
for (list = group->values; *list; list++)
|
||||
free((void *) *list);
|
||||
free(*list);
|
||||
free(group);
|
||||
}
|
||||
|
||||
|
|
|
@ -279,8 +279,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
GenericListRec list;
|
||||
const char *inp_identifier;
|
||||
const char *inp_driver;
|
||||
char *inp_identifier;
|
||||
char *inp_driver;
|
||||
XF86OptionPtr inp_option_lst;
|
||||
char *inp_comment;
|
||||
} XF86ConfInputRec, *XF86ConfInputPtr;
|
||||
|
@ -288,7 +288,7 @@ typedef struct {
|
|||
typedef struct {
|
||||
GenericListRec list;
|
||||
XF86ConfInputPtr iref_inputdev;
|
||||
const char *iref_inputdev_str;
|
||||
char *iref_inputdev_str;
|
||||
XF86OptionPtr iref_option_lst;
|
||||
} XF86ConfInputrefRec, *XF86ConfInputrefPtr;
|
||||
|
||||
|
@ -299,13 +299,13 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
struct xorg_list entry;
|
||||
const char **values;
|
||||
char **values;
|
||||
} xf86MatchGroup;
|
||||
|
||||
typedef struct {
|
||||
GenericListRec list;
|
||||
char *identifier;
|
||||
const char *driver;
|
||||
char *driver;
|
||||
struct xorg_list match_product;
|
||||
struct xorg_list match_vendor;
|
||||
struct xorg_list match_device;
|
||||
|
|
|
@ -95,8 +95,8 @@ SOFTWARE.
|
|||
|
||||
#define NO_AXIS_LIMITS -1
|
||||
|
||||
#define MAP_LENGTH 256
|
||||
#define DOWN_LENGTH 32 /* 256/8 => number of bytes to hold 256 bits */
|
||||
#define MAP_LENGTH MAX_BUTTONS
|
||||
#define DOWN_LENGTH (MAX_BUTTONS/8) /* 256/8 => number of bytes to hold 256 bits */
|
||||
#define NullGrab ((GrabPtr)NULL)
|
||||
#define PointerRootWin ((WindowPtr)PointerRoot)
|
||||
#define NoneWin ((WindowPtr)None)
|
||||
|
@ -221,12 +221,12 @@ typedef struct _InputOption InputOption;
|
|||
typedef struct _XI2Mask XI2Mask;
|
||||
|
||||
typedef struct _InputAttributes {
|
||||
const char *product;
|
||||
const char *vendor;
|
||||
const char *device;
|
||||
const char *pnp_id;
|
||||
const char *usb_id;
|
||||
const char **tags; /* null-terminated */
|
||||
char *product;
|
||||
char *vendor;
|
||||
char *device;
|
||||
char *pnp_id;
|
||||
char *usb_id;
|
||||
char **tags; /* null-terminated */
|
||||
uint32_t flags;
|
||||
} InputAttributes;
|
||||
|
||||
|
|
|
@ -542,7 +542,7 @@ typedef struct _DeviceIntRec {
|
|||
GrabInfoRec deviceGrab; /* grab on the device */
|
||||
int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */
|
||||
Atom xinput_type;
|
||||
const char *name;
|
||||
char *name;
|
||||
int id;
|
||||
KeyClassPtr key;
|
||||
ValuatorClassPtr valuator;
|
||||
|
|
|
@ -246,7 +246,7 @@ padding_for_int32(const int bytes)
|
|||
}
|
||||
|
||||
|
||||
extern const char **xstrtokenize(const char *str, const char *separators);
|
||||
extern char **xstrtokenize(const char *str, const char *separators);
|
||||
extern void FormatInt64(int64_t num, char *string);
|
||||
extern void FormatUInt64(uint64_t num, char *string);
|
||||
extern void FormatUInt64Hex(uint64_t num, char *string);
|
||||
|
|
|
@ -30,11 +30,11 @@
|
|||
/***====================================================================***/
|
||||
|
||||
typedef struct _XkbRMLVOSet {
|
||||
const char *rules;
|
||||
const char *model;
|
||||
const char *layout;
|
||||
const char *variant;
|
||||
const char *options;
|
||||
char *rules;
|
||||
char *model;
|
||||
char *layout;
|
||||
char *variant;
|
||||
char *options;
|
||||
} XkbRMLVOSet;
|
||||
|
||||
typedef struct _XkbRF_VarDefs {
|
||||
|
|
|
@ -738,6 +738,14 @@ extern _X_EXPORT void XkbClearAllLatchesAndLocks(DeviceIntPtr /* dev */ ,
|
|||
XkbEventCausePtr /* cause */
|
||||
);
|
||||
|
||||
extern _X_EXPORT void XkbInitRules(XkbRMLVOSet * /* rmlvo */,
|
||||
const char * /* rules */,
|
||||
const char * /* model */,
|
||||
const char * /* layout */,
|
||||
const char * /* variant */,
|
||||
const char * /* options */
|
||||
) ;
|
||||
|
||||
extern _X_EXPORT void XkbGetRulesDflts(XkbRMLVOSet * /* rmlvo */
|
||||
);
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e)
|
|||
else if (miEventQueue.dropped % QUEUE_DROP_BACKTRACE_FREQUENCY == 0 &&
|
||||
miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY <=
|
||||
QUEUE_DROP_BACKTRACE_MAX) {
|
||||
ErrorFSigSafe("[mi] EQ overflow continuing. %u events have been "
|
||||
ErrorFSigSafe("[mi] EQ overflow continuing. %zu events have been "
|
||||
"dropped.\n", miEventQueue.dropped);
|
||||
if (miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY ==
|
||||
QUEUE_DROP_BACKTRACE_MAX) {
|
||||
|
|
|
@ -1973,10 +1973,10 @@ CheckUserAuthorization(void)
|
|||
* Tokenize a string into a NULL terminated array of strings. Always returns
|
||||
* an allocated array unless an error occurs.
|
||||
*/
|
||||
const char **
|
||||
char **
|
||||
xstrtokenize(const char *str, const char *separators)
|
||||
{
|
||||
const char **list, **nlist;
|
||||
char **list, **nlist;
|
||||
char *tok, *tmp;
|
||||
unsigned num = 0, n;
|
||||
|
||||
|
@ -2004,7 +2004,7 @@ xstrtokenize(const char *str, const char *separators)
|
|||
error:
|
||||
free(tmp);
|
||||
for (n = 0; n < num; n++)
|
||||
free((void *) list[n]);
|
||||
free(list[n]);
|
||||
free(list);
|
||||
return NULL;
|
||||
}
|
||||
|
|
56
test/input.c
56
test/input.c
|
@ -1101,7 +1101,7 @@ xi_unregister_handlers(void)
|
|||
static void
|
||||
cmp_attr_fields(InputAttributes * attr1, InputAttributes * attr2)
|
||||
{
|
||||
const char **tags1, **tags2;
|
||||
char **tags1, **tags2;
|
||||
|
||||
assert(attr1 && attr2);
|
||||
assert(attr1 != attr2);
|
||||
|
@ -1180,50 +1180,54 @@ cmp_attr_fields(InputAttributes * attr1, InputAttributes * attr2)
|
|||
static void
|
||||
dix_input_attributes(void)
|
||||
{
|
||||
InputAttributes orig = { 0 };
|
||||
InputAttributes *orig;
|
||||
InputAttributes *new;
|
||||
const char *tags[4] = { "tag1", "tag2", "tag2", NULL };
|
||||
|
||||
new = DuplicateInputAttributes(NULL);
|
||||
assert(!new);
|
||||
|
||||
new = DuplicateInputAttributes(&orig);
|
||||
assert(memcmp(&orig, new, sizeof(InputAttributes)) == 0);
|
||||
orig = calloc(1, sizeof(InputAttributes));
|
||||
assert(orig);
|
||||
|
||||
orig.product = "product name";
|
||||
new = DuplicateInputAttributes(&orig);
|
||||
cmp_attr_fields(&orig, new);
|
||||
new = DuplicateInputAttributes(orig);
|
||||
assert(memcmp(orig, new, sizeof(InputAttributes)) == 0);
|
||||
|
||||
orig->product = xnfstrdup("product name");
|
||||
new = DuplicateInputAttributes(orig);
|
||||
cmp_attr_fields(orig, new);
|
||||
FreeInputAttributes(new);
|
||||
|
||||
orig.vendor = "vendor name";
|
||||
new = DuplicateInputAttributes(&orig);
|
||||
cmp_attr_fields(&orig, new);
|
||||
orig->vendor = xnfstrdup("vendor name");
|
||||
new = DuplicateInputAttributes(orig);
|
||||
cmp_attr_fields(orig, new);
|
||||
FreeInputAttributes(new);
|
||||
|
||||
orig.device = "device path";
|
||||
new = DuplicateInputAttributes(&orig);
|
||||
cmp_attr_fields(&orig, new);
|
||||
orig->device = xnfstrdup("device path");
|
||||
new = DuplicateInputAttributes(orig);
|
||||
cmp_attr_fields(orig, new);
|
||||
FreeInputAttributes(new);
|
||||
|
||||
orig.pnp_id = "PnPID";
|
||||
new = DuplicateInputAttributes(&orig);
|
||||
cmp_attr_fields(&orig, new);
|
||||
orig->pnp_id = xnfstrdup("PnPID");
|
||||
new = DuplicateInputAttributes(orig);
|
||||
cmp_attr_fields(orig, new);
|
||||
FreeInputAttributes(new);
|
||||
|
||||
orig.usb_id = "USBID";
|
||||
new = DuplicateInputAttributes(&orig);
|
||||
cmp_attr_fields(&orig, new);
|
||||
orig->usb_id = xnfstrdup("USBID");
|
||||
new = DuplicateInputAttributes(orig);
|
||||
cmp_attr_fields(orig, new);
|
||||
FreeInputAttributes(new);
|
||||
|
||||
orig.flags = 0xF0;
|
||||
new = DuplicateInputAttributes(&orig);
|
||||
cmp_attr_fields(&orig, new);
|
||||
orig->flags = 0xF0;
|
||||
new = DuplicateInputAttributes(orig);
|
||||
cmp_attr_fields(orig, new);
|
||||
FreeInputAttributes(new);
|
||||
|
||||
orig.tags = tags;
|
||||
new = DuplicateInputAttributes(&orig);
|
||||
cmp_attr_fields(&orig, new);
|
||||
orig->tags = xstrtokenize("tag1 tag2 tag3", " ");
|
||||
new = DuplicateInputAttributes(orig);
|
||||
cmp_attr_fields(orig, new);
|
||||
FreeInputAttributes(new);
|
||||
|
||||
FreeInputAttributes(orig);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
20
test/touch.c
20
test/touch.c
|
@ -40,7 +40,7 @@ touch_grow_queue(void)
|
|||
int i;
|
||||
|
||||
memset(&dev, 0, sizeof(dev));
|
||||
dev.name = "test device";
|
||||
dev.name = xnfstrdup("test device");
|
||||
dev.id = 2;
|
||||
dev.valuator = &val;
|
||||
val.numAxes = 5;
|
||||
|
@ -82,6 +82,8 @@ touch_grow_queue(void)
|
|||
assert(t->client_id == 0);
|
||||
assert(t->ddx_id == 0);
|
||||
}
|
||||
|
||||
free(dev.name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -95,7 +97,7 @@ touch_find_ddxid(void)
|
|||
int i;
|
||||
|
||||
memset(&dev, 0, sizeof(dev));
|
||||
dev.name = "test device";
|
||||
dev.name = xnfstrdup("test device");
|
||||
dev.id = 2;
|
||||
dev.valuator = &val;
|
||||
val.numAxes = 5;
|
||||
|
@ -150,6 +152,8 @@ touch_find_ddxid(void)
|
|||
ProcessWorkQueue();
|
||||
ti = TouchFindByDDXID(&dev, 40, TRUE);
|
||||
assert(ti == &dev.last.touches[size]);
|
||||
|
||||
free(dev.name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -164,7 +168,7 @@ touch_begin_ddxtouch(void)
|
|||
int size = 5;
|
||||
|
||||
memset(&dev, 0, sizeof(dev));
|
||||
dev.name = "test device";
|
||||
dev.name = xnfstrdup("test device");
|
||||
dev.id = 2;
|
||||
dev.valuator = &val;
|
||||
val.numAxes = 5;
|
||||
|
@ -195,6 +199,8 @@ touch_begin_ddxtouch(void)
|
|||
assert(ti->client_id > last_client_id);
|
||||
assert(!ti->emulate_pointer);
|
||||
last_client_id = ti->client_id;
|
||||
|
||||
free(dev.name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -212,7 +218,7 @@ touch_begin_touch(void)
|
|||
screenInfo.screens[0] = &screen;
|
||||
|
||||
memset(&dev, 0, sizeof(dev));
|
||||
dev.name = "test device";
|
||||
dev.name = xnfstrdup("test device");
|
||||
dev.id = 2;
|
||||
|
||||
memset(&sprite, 0, sizeof(sprite));
|
||||
|
@ -237,6 +243,8 @@ touch_begin_touch(void)
|
|||
assert(ti->emulate_pointer);
|
||||
|
||||
assert(touch.num_touches == 1);
|
||||
|
||||
free(dev.name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -251,7 +259,7 @@ touch_init(void)
|
|||
screenInfo.screens[0] = &screen;
|
||||
|
||||
memset(&dev, 0, sizeof(dev));
|
||||
dev.name = "test device";
|
||||
dev.name = xnfstrdup("test device");
|
||||
|
||||
memset(&sprite, 0, sizeof(sprite));
|
||||
dev.spriteInfo = &sprite;
|
||||
|
@ -264,6 +272,8 @@ touch_init(void)
|
|||
rc = InitTouchClassDeviceStruct(&dev, 1, XIDirectTouch, 2);
|
||||
assert(rc == TRUE);
|
||||
assert(dev.touch);
|
||||
|
||||
free(dev.name);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
18
test/xkb.c
18
test/xkb.c
|
@ -82,15 +82,17 @@ xkb_get_rules_test(void)
|
|||
static void
|
||||
xkb_set_rules_test(void)
|
||||
{
|
||||
XkbRMLVOSet rmlvo = {
|
||||
.rules = "test-rules",
|
||||
.model = "test-model",
|
||||
.layout = "test-layout",
|
||||
.variant = "test-variant",
|
||||
.options = "test-options"
|
||||
};
|
||||
XkbRMLVOSet rmlvo;
|
||||
XkbRMLVOSet rmlvo_new = { NULL };
|
||||
|
||||
XkbInitRules(&rmlvo, "test-rules", "test-model", "test-layout",
|
||||
"test-variant", "test-options");
|
||||
assert(rmlvo.rules);
|
||||
assert(rmlvo.model);
|
||||
assert(rmlvo.layout);
|
||||
assert(rmlvo.variant);
|
||||
assert(rmlvo.options);
|
||||
|
||||
XkbSetRulesDflts(&rmlvo);
|
||||
XkbGetRulesDflts(&rmlvo_new);
|
||||
|
||||
|
@ -106,6 +108,8 @@ xkb_set_rules_test(void)
|
|||
assert(strcmp(rmlvo.layout, rmlvo_new.layout) == 0);
|
||||
assert(strcmp(rmlvo.variant, rmlvo_new.variant) == 0);
|
||||
assert(strcmp(rmlvo.options, rmlvo_new.options) == 0);
|
||||
|
||||
XkbFreeRMLVOSet(&rmlvo, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -129,11 +129,11 @@ XkbFreeRMLVOSet(XkbRMLVOSet * rmlvo, Bool freeRMLVO)
|
|||
if (!rmlvo)
|
||||
return;
|
||||
|
||||
free((void *) rmlvo->rules);
|
||||
free((void *) rmlvo->model);
|
||||
free((void *) rmlvo->layout);
|
||||
free((void *) rmlvo->variant);
|
||||
free((void *) rmlvo->options);
|
||||
free(rmlvo->rules);
|
||||
free(rmlvo->model);
|
||||
free(rmlvo->layout);
|
||||
free(rmlvo->variant);
|
||||
free(rmlvo->options);
|
||||
|
||||
if (freeRMLVO)
|
||||
free(rmlvo);
|
||||
|
@ -206,6 +206,21 @@ XkbWriteRulesProp(ClientPtr client, void *closure)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
XkbInitRules(XkbRMLVOSet *rmlvo,
|
||||
const char *rules,
|
||||
const char *model,
|
||||
const char *layout,
|
||||
const char *variant,
|
||||
const char *options)
|
||||
{
|
||||
rmlvo->rules = rules ? xnfstrdup(rules) : NULL;
|
||||
rmlvo->model = model ? xnfstrdup(model) : NULL;
|
||||
rmlvo->layout = layout ? xnfstrdup(layout) : NULL;
|
||||
rmlvo->variant = variant ? xnfstrdup(variant) : NULL;
|
||||
rmlvo->options = options ? xnfstrdup(options) : NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
XkbSetRulesUsed(XkbRMLVOSet * rmlvo)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user