| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Previously we included it with an `-include` compiler directive. But
that's not portable. And it's better to be explicit anyway.
Every .c file should have `include "config.h"` first thing.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Coverity complains that a 7-byte string may not be null-terminated when copied
into act->data (size 7). This is fine, make a note of it.
All the strings in xkeyboard-config only use 6 bytes + null terminator so this
won't be an issue. The server (the only user of these) uses an 8-byte array
and forcibly null-terminates the string, see XkbDDXPrivate().
Everything else treats it as byte-array size 7 anyway so whether it's
null-terminated doesn't matter.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
A couple of modiifer actions need this information, but not the entire
keymap.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
| |
The modifier-resolving functions only need the modifier information.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
| |
This is a little shorter and follows easier from the spec flag
description table.
Also a few were too permissive (like allowing LatchToLock in SetMods).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
| |
It's easier to deal with, but we need to set it as "factory default".
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
| |
This used to *unset* a flag called "SwitchApplication"; we changed the
flag to "same" but forgot to switch the cases.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Makes more sense and flows more nicely this way.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Support for setting this field was missing from the LockMods and
LockControls actions.
Based on a xkbcomp patch by Andreas Wettstein.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Instead of using those t1 t2 variables, pass the final destinations
directly (while making sure they are not modified in case of error).
This also ensures the types are right, e.g. in CheckGroupField it should
be int32_t, not xkb_layout_index_t (and indeed it takes a negation!).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
| |
The type is uint8_t and so is the checked range.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
| |
It's not a button.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Someone was nice enough to run this for us:
ftp://ftp.sunet.se/pub/Linux/distributions/Debian/debian/pool/main/libx/libxkbcommon/libxkbcommon_0.3.1.orig.tar.gz
[libxkbcommon-0.3.1/src/keymap.c:86]: (style) The scope of the variable 'j' can be reduced.
[libxkbcommon-0.3.1/src/keymap.c:87]: (style) The scope of the variable 'key' can be reduced.
[libxkbcommon-0.3.1/src/keysym-utf.c:843]: (style) The scope of the variable 'mid' can be reduced.
[libxkbcommon-0.3.1/src/state.c:992]: (style) The scope of the variable 'str' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/action.c:467]: (style) The scope of the variable 'absolute' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/rules.c:468]: (style) The scope of the variable 'consumed' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/rules.c:862]: (style) The scope of the variable 'mlvo' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/rules.c:863]: (style) The scope of the variable 'kccgst' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/rules.c:865]: (style) The scope of the variable 'match_type' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/symbols.c:753]: (style) The scope of the variable 'toAct' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/symbols.c:1573]: (style) The scope of the variable 'key' can be reduced.
[libxkbcommon-0.3.1/test/common.c:80]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'.
[libxkbcommon-0.3.1/test/interactive.c:358]: (style) The scope of the variable 'nevs' can be reduced.
[libxkbcommon-0.3.1/test/interactive.c:236]: (style) Checking if unsigned variable 'nsyms' is less than zero.
[libxkbcommon-0.3.1/test/interactive.c:226]: (style) Unused variable: unicode
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we have one ExprDef type, which contains a tagged union with
the value of all expression types. Turns out, this union is quite
wasteful memory-wise. Instead, create separate types for all expressions
(e.g ExprBinary, ExprInteger) which embed the common fields
(ExprCommon), and malloc them per their size; ExprDef then becomes a
union of all these types, but is just used as a generic pointer.
[Instead of making ExprDef a union, another option is to use
ExprCommon as the generic pointer type and then do up-castings, like we
do with ParseCommon. But this makes the code much uglier.]
The diff is mostly straightforward mechanical adaptations. It could have
been much smaller with the help of C11 anonymous structs (which were
previously a gnu extension). This will have saved all of the 'op' ->
'expr->op', etc changes. But if we can be a bit more portable for a
little effort, we should.
Before (./test/rulescomp, x86 32 bit, -O2):
==12974== total heap usage: 145,217 allocs, 145,217 frees, 10,476,238 bytes allocated
After:
==11145== total heap usage: 145,217 allocs, 145,217 frees, 8,270,358 bytes allocated
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
| |
Also add a 'bool set' to the ExprDef union, instead of using 'ival' as a
bool.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
| |
This distinguishes between an identifier expression and a string
expression in the union.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
| |
(I really dislike this one for some reason..)
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
| |
To get a key by name and resolve an alias - this makes sense for
everyone.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
| |
Some obscure bug having to do with Private actions; see the comments.
This was prompted by:
https://bugs.freedesktop.org/show_bug.cgi?id=56491
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
| |
This again pushes the mod type annotation to the original call site, to
make it easier to grep to see where the real/virtual distinction
matters.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
| |
Some libc's don't support it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
| |
It's not really "last" per-se, and we use this other format in some
other enums.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
With Dan Nicholson's permission (via email), update his copyright and
license statements to the standard X.Org boilerplate MIT license, as
both myself and Ran have been using.
Clean up my copyright declarations (in some cases to correct ownership),
and add copyright/license statements from myself and/or Ran where
appropriate.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
|
|
| |
This was always set to affect the default button, so no need for it.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
| |
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
| |
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
|
|
|
| |
We didn't do anything with ISO_Lock, ActionMessage, RedirectKey, and the
device-specifying variants of the pointer actions, so remove those.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
| |
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
|
|
|
| |
Define it ourselves as XKB_KEY_NAME_LENGTH and use that, instead of the
one from XKB.h.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
|
|
|
|
|
|
|
| |
We move the LookupEntry struct from expr.h to text.h, along with most of
the lookup tables. This makes them available everywhere.
Looking up a value in the LookupEntry format is slower than direct index
mapping, but it allows multiple names per value (with the canonical one
being first) and "all"- and "none"-type masks. These functions are not
used anywhere efficiency matters.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
| |
Almost all callers do xkb_atom_intern on the currently returned string,
while ResolveString converts the atom to the string to begin with...
uselss double work.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
| |
xkbcomp has that bug as well, guess no one uses it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
| |
The NoAction handler always errors out with the same message.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The implementation of changing the default properties of actions, e.g. a
statements such as (from test/data/compat/basic):
setMods.clearLocks= True;
latchMods.clearLocks= True;
latchMods.latchToLock= True;
works by keeping a list of ActionInfo's, each containing the neccesary
info from each statement, and then when some action comes up (e.g. in an
interpret statment) it goes through the list, and applies the relevent
ActionInfo's to the newly-constructed xkb_action.
Instead of doing this, we add a struct ActionsInfo, which contains an
array of xkb_actions, one for each type. When a default changing
statement appears, we change the action in the array; when a new action
comes up, we just copy from the array. This is simpler to figure out,
and pretty straightforward.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently where it is possible to write:
setMods.clearLocks = True;
It's also possible to write:
action.clearLocks = True;
This will set the default value for the clearLocks action field for
*all* action types, as opposed to just setMods in this case. If
subsequently an action is used for which this field does not make sense,
it will error out.
This doesn't make any sense, because any given field is only possible by at
most 3 or 4 action types... which you might as well write explicitly and
avoid the side effect mentioned above.
Needless to say this is one of xkbcomp's "hidden features" and is not
used anywhere; remove it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
| |
Make it a bit easier to understand what they do.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
|
|
|
| |
Generally the enum-to-string function should appear where the enum is
defined.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
|
|
| |
Signed-off-by: Ran Benita <ran234@gmail.com>
|