Commit Graph

827 Commits (2eba51c0f603535dc2663f2666437305b287efb3)

Author SHA1 Message Date
Ran Benita 4bc839ab89 Use memset instead of bzero
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-02 22:41:20 +02:00
Ran Benita a3e40917ee Remove return's at the end of void functions
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-02 22:41:20 +02:00
Ran Benita f278cea107 Remove all uses of the register keyword
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-02 22:41:20 +02:00
Ran Benita f424251244 Use strdup instead of strlen + malloc + strcpy
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-02 22:41:20 +02:00
Ran Benita 6a34e4e19a Don't check for NULL before free()
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-02 22:41:20 +02:00
Ran Benita c41061a005 Use yacc-generated header instead of tokens.h
The yacc implementation can generate all the necessary token
definitions itself; there is no need to maintain a hand written
file for that.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-26 21:45:29 +02:00
Ran Benita 0d8874d01c makekeys: update to match the rest of libX11 makekeys
This integrates two commits from libX11:

ebd6ef0a4db0ddef0ae17ad14571518ccdeea5ba
   XStringToKeysym: Special case for XF86 keysyms

    Some XFree86 keysyms were in XKeysymDB as XF86_foo, despite really being
    XF86foo.  So, if we get to the bottom of XStringToKeysym and haven't
    found our XF86_foo, try it again as XF86foo.

    Signed-off-by: Daniel Stone <daniel@fooishbar.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>

00175397480b76d32bf82b0c7c94c91a2a95954e
    makekeys: Scan vendor keysyms as well as core

    Since we can't really live without vendor keysyms, scan them all in to
    generate ks_tables.h, rather than only doing the core ones, and leaving
    the vendor syms to be manually synchronised with XKeysymDB.

    Signed-off-by: Daniel Stone <daniel@fooishbar.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>

Notice that the xkey.sh test is changed to match libX11 behavior, i.e.
XKeysymToString(0x1008FE20) -> "XF86Ungrab" as opposed to "XF86_Ungrab".

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-26 21:09:37 +02:00
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