action: add missing array_ndx checks
Only the "data" field can have them, and every other field needs to error out if it appears. But some didn't check. Signed-off-by: Ran Benita <ran234@gmail.com>master
parent
477407f710
commit
3acea3b3bb
|
@ -422,14 +422,14 @@ HandleMovePtr(struct xkb_keymap *keymap, union xkb_action *action,
|
|||
{
|
||||
struct xkb_pointer_action *act = &action->ptr;
|
||||
|
||||
if (array_ndx && (field == ACTION_FIELD_X || field == ACTION_FIELD_Y))
|
||||
return ReportActionNotArray(keymap, action->type, field);
|
||||
|
||||
if (field == ACTION_FIELD_X || field == ACTION_FIELD_Y) {
|
||||
int val;
|
||||
const bool absolute = (value->expr.op != EXPR_NEGATE &&
|
||||
value->expr.op != EXPR_UNARY_PLUS);
|
||||
|
||||
if (array_ndx)
|
||||
return ReportActionNotArray(keymap, action->type, field);
|
||||
|
||||
if (!ExprResolveInteger(keymap->ctx, value, &val))
|
||||
return ReportMismatch(keymap, action->type, field, "integer");
|
||||
|
||||
|
@ -458,6 +458,9 @@ HandleMovePtr(struct xkb_keymap *keymap, union xkb_action *action,
|
|||
else if (field == ACTION_FIELD_ACCEL) {
|
||||
bool set;
|
||||
|
||||
if (array_ndx)
|
||||
return ReportActionNotArray(keymap, action->type, field);
|
||||
|
||||
if (!ExprResolveBoolean(keymap->ctx, value, &set))
|
||||
return ReportMismatch(keymap, action->type, field, "boolean");
|
||||
|
||||
|
@ -687,6 +690,9 @@ HandlePrivate(struct xkb_keymap *keymap, union xkb_action *action,
|
|||
if (field == ACTION_FIELD_TYPE) {
|
||||
int type;
|
||||
|
||||
if (array_ndx)
|
||||
return ReportActionNotArray(keymap, action->type, field);
|
||||
|
||||
if (!ExprResolveInteger(keymap->ctx, value, &type))
|
||||
return ReportMismatch(keymap, ACTION_TYPE_PRIVATE, field, "integer");
|
||||
|
||||
|
@ -880,7 +886,6 @@ HandleActionDef(ExprDef *def, struct xkb_keymap *keymap,
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SetActionField(struct xkb_keymap *keymap, const char *elem, const char *field,
|
||||
ExprDef *array_ndx, ExprDef *value, ActionsInfo *info)
|
||||
|
|
Loading…
Reference in New Issue