Commit Graph

720 Commits (20bef734d83755401261da87d19588362c9f777f)

Author SHA1 Message Date
Ran Benita ad4f195eb4 makekeys: Receive the keysym files as arguments
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-26 21:09:37 +02:00
Ran Benita 0e98541f37 When makekeys fails to find a good hash, print error instead of divide-by-zero
This matches commit 78a894231ae8ec4959007b6d9b8d2a15d6333a1e from
libX11:
    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-26 21:09:37 +02:00
Ran Benita 04e687c9da makekeys: Fix build/target word size mismatch when cross-compiling
This matches commit 24283d40b1e4314c6647dda49d2a159833341a8b from
libX11:

    Since makekeys is built using build environment's compiler and
    runs natively, we have to make sure that the size of the
    Signature type is the same on both the native environment
    and the target, otherwise we get mismatches upon running X,
    and some LSB test failures (xts5).

    Use an unsigned 32-bit integer on all platforms.

    Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
    Reviewed-by: Daniel Stone <daniel@fooishbar.org>

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-26 21:08:55 +02:00
Ran Benita 744527e9a9 Fix remaining warnings
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 12:00:10 +02:00
Ran Benita eff72fab5d Fix warnings in scanner and parser
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 12:00:10 +02:00
Ran Benita 1d969c5cf6 Fix an incorrect sizeof
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 12:00:10 +02:00
Ran Benita f3e4335fc6 Fix all constness warnings
These are all trivial/obvious fixes which clear a bunch of warnings.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 12:00:10 +02:00
Ran Benita cca1c05097 Fix possible null dereferences
Fix all reported null dereferences from clang-analyzer.
There seems to be one false negative (in file indicators.c), but it is
fixed anyway.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 12:00:10 +02:00
Ran Benita 9005624f94 Remove unneeded assignments and variables
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 11:59:56 +02:00
Ran Benita a48ddb5dd3 makekeys: clear const and shadow warnings
The name 'index' is used by the standard library, so use 'ndx' like some
other files.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 11:59:56 +02:00
Ran Benita fdf7e8f6db makekeys: make buf local to main()
All the functions already accept it as a parameter. This clears -Wshadow
warnings.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 11:59:56 +02:00
Ran Benita 6a3b38b171 Remove ancient compatibility check
Other headers include malloc just fine.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 11:59:56 +02:00
Ran Benita a0dd052644 Remove unused includes of "tokens.h"
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 11:59:56 +02:00
Ran Benita 9ad0be3358 Remove unused debug #defines
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 11:11:10 +02:00
Daniel Stone 90f04e042b Perform bounds checking in ExprResolveLevel
Both callers perform the same bounds check, so move it into
ExprResolveLevel itself.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 18:07:29 +00:00
Daniel Stone 1ab058bbb3 Fix typo in ExprResolveKeyCode
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 17:47:46 +00:00
Daniel Stone e209fe31df Perform bounds checking in ExprResolveGroup
Every caller did the exact same check on the group bounds after calling
ExprResolveGroup, so might as well do it inside.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 17:33:39 +00:00
Daniel Stone 43ed3ff070 Switch expression resolution priv from char to void
Avoids a lot of really lame casts.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 17:14:04 +00:00
Daniel Stone eb6d9a0528 Remove chaining support from LookupModMask
Turns out we never use it, so.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 17:09:06 +00:00
Daniel Stone 11ea079175 Invert LookupModMask/LookupVModMask order
We never want to solely lookup a virtual modifier without also looking
up core modifiers.  So, rather than chaining the vmod lookup inside the
core modifier lookup, invert the ordering.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 17:07:48 +00:00
Daniel Stone 1a2f2556dd Remove unused LookupPriv::priv
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 17:00:51 +00:00
Daniel Stone 55e058f856 Move some definitions from expr.h to expr.c
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 16:59:51 +00:00
Daniel Stone 90d86c360a Remove field reference lookup support
None of the lookup functions anyone ever used supported field
references, so don't pretend we do in the API.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 16:54:54 +00:00
Daniel Stone 590df28cc5 Move groupNames mask definition to its user
groupNames was declared in compat.c as a global to anything which
included compat.h (for which groupNames was its sole reason to exist),
but only ever used in indicators.c.

Which is kind of fortunate, given that e314931e removed identical
definitions of groupNames (as integers, not masks) from both action.c
and symbols.c.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 16:35:39 +00:00
Daniel Stone 91b8985297 Turn ExprResolveInteger into a simple wrapper
Move the bulk of ExprResolveInteger into an internal function called
ExprResolveIntegerLookup, and introduce ExprResolveInteger as a simple
wrapper which doesn't take priv/lookup arguments.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 16:24:02 +00:00
Daniel Stone d32822e60f Open-code a radio group SimpleLookup
Because, joke's on you, it wasn't actually looking up radio groups.
Just checking to see if it was a string that was "none", or an integer.

Lord give me strength.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 16:06:01 +00:00
Daniel Stone e314931e8f Add ExprResolveGroup helper
Just a dumb wrapper around ExprResolveInteger.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 15:49:38 +00:00
Daniel Stone 8b47dbbf61 Add ExprResolveButton helper
Just a dumb wrapper around ExprResolveInteger.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 15:47:38 +00:00
Daniel Stone 3431a089cf Introduce ExprResolveLevel helper
Which returns an integer representing the level number represented by
the given expression.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 15:37:53 +00:00
Daniel Stone 193e9b3913 Introduce ExprResolveRadioGroup helper
Just a tiny special-cased version of ExprResolveInteger.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 15:33:40 +00:00
Daniel Stone 26285a7bd9 Remove priv arguments from ExprResolveString
They've never been used.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 14:15:08 +00:00
Daniel Stone b7b49eb0f7 Remove priv arguments from ExprResolveKeySym
They've never been used by its one caller.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 14:10:41 +00:00
Daniel Stone 70033b132b Remove priv arguments from ExprResolveKeyName
They've never been used.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 14:08:55 +00:00
Daniel Stone 482d4faaa1 Remove priv arguments from ExprResolveBoolean
They've never been used.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 13:44:27 +00:00
Daniel Stone 9404157571 Remove priv arguments from ExprResolveFloat
They've never been used.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 13:40:34 +00:00
Daniel Stone 3151ce36fa Remove priv arguments from ExprResolveModMask
What with them now being unused and all.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 13:34:36 +00:00
Daniel Stone 67605d2c90 Introduce ExprResolveVModMask
Which is just a slightly more typesafe wrapper around the chained
ExprResolveModMask everyone was using earlier.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 13:32:09 +00:00
Daniel Stone fbb82199ee Respect explicit minimum/maximum keycodes
Make sure we carry over an explicit minimum/maximum keycode setting,
rather than just using the computed minimum/maximum; this got broken
while changing the keycode range to be unsigned.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reported-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-16 11:18:49 +00:00
Daniel Stone c45cdb0c67 Still more memory leak fixes
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-16 00:22:11 +00:00
Daniel Stone 83f18b1c3a Fix xkbparse.y compilation
Thanks to autotools happily building stale generated sources, I hadn't
actually ever built my xkbparse.y changes.  Fix that so it not only
compiles, but works.  This seems to parse long keycodes correctly,
although I very much would not recommend testing this by declaring
0x1fffffff as your highest keycode.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-15 19:39:33 +00:00
Daniel Stone eb8c96cbd9 Don't leak SymbolsInfo
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-15 16:42:45 +00:00
Daniel Stone 3077e97e7c tests: Free returned XKB map
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-15 16:38:17 +00:00
Daniel Stone 67c874d76d Enable stderr debugging by default
(If debugFlags is set to non-zero.)

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-15 16:24:51 +00:00
Daniel Stone f57dcfebf4 Raise keycode range to 32 bits
\o/

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-15 16:24:51 +00:00
Daniel Stone 1a6c3807d6 vmod: Pass xkb_desc explicitly to vmod functions
Some error paths don't set info->xkb correctly, so just do like most
utility functions and pass the xkb_desc explicitly.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-15 16:24:50 +00:00
Daniel Stone 4e22851141 Introduce xkb_keycode_t for keycodes
And use it consistently everywhere, including with a special long-safe
internal keycode type, to ease the transition to large keycodes.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-15 16:24:50 +00:00
Daniel Stone 8f01b14412 xkbscan: Copy, rather than assign, file name
For some reason, lex decided to reduce a strcpy into an assignment,
leading to entirely justified valgrind warnings about invalid reads,
when scanFile was set to a string which may have only ever lived on the
stack of a now-exited function.

Make it a strdup() instead.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-15 16:24:50 +00:00
Daniel Stone ead9d0cb62 Move include path from X11/extensions/ to xkbcommon/
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-15 16:24:50 +00:00
Rob Bradford 615291f1f4 xkbcomp: Silence warning of return of uninitialised value
Some routes through HandleGeometryVar do not set a return value. Set a default
value for the return variable to avoid returning an uninitialised value.
2012-01-05 14:24:11 +00:00
Pekka Paalanen c19661b965 Add xkbc_free_keymap helper
Which just calls XkbcFreeKeyboard with the only arguments you'd ever
pass it.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2011-12-16 12:52:00 +00:00