summaryrefslogtreecommitdiff
path: root/symbols.c
Commit message (Collapse)AuthorAgeFilesLines
* Mark more pointers as constAlan Coopersmith2023-01-031-20/+17
| | | | | | Some suggested by cppcheck, others by manual code inspection Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Use unsigned ints when shifting to create bitmasksAlan Coopersmith2023-01-031-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | symbols.c:1057:28: portability: Shifting signed 32-bit value by 31 bits is implementation-defined behaviour. See condition at line 1049. [shiftTooManyBitsSigned] radio_groups |= (1 << (tmp.uval - 1)); ^ symbols.c:1049:41: note: Assuming that condition 'tmp.uval>32' is not redundant if ((tmp.uval < 1) || (tmp.uval > XkbMaxRadioGroups)) ^ symbols.c:1057:28: note: Shift radio_groups |= (1 << (tmp.uval - 1)); ^ symbols.c:1057:28: warning: Either the condition 'tmp.uval>32' is redundant or there is signed integer overflow for expression '1<<(tmp.uval-1)'. [integerOverflowCond] radio_groups |= (1 << (tmp.uval - 1)); ^ symbols.c:1049:41: note: Assuming that condition 'tmp.uval>32' is not redundant if ((tmp.uval < 1) || (tmp.uval > XkbMaxRadioGroups)) ^ symbols.c:1057:28: note: Integer overflow radio_groups |= (1 << (tmp.uval - 1)); ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove unnecessary casts from bzero() callsAlan Coopersmith2022-12-111-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove unnecessary casts from memcpy() callsAlan Coopersmith2022-12-111-8/+4
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove unnecessary checks for NULL pointers before calling free()Alan Coopersmith2022-12-111-20/+10
| | | | | | Not needed in C89 and later Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace uFree() with direct free() callsAlan Coopersmith2022-12-111-16/+16
| | | | | | | All these wrappers did was mess with types and add a test for NULL pointers that isn't needed in C89 and later. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace uTypedRecalloc() with direct recallocarray() callsAlan Coopersmith2022-12-111-8/+8
| | | | | | Retains uRecalloc() as a fallback for platforms without recallocarray() Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace uCalloc() and uTypedCalloc() with direct calloc() callsAlan Coopersmith2022-12-111-7/+7
| | | | | | All these wrappers did was mess with types. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace uAlloc() and uTypedAlloc() with direct malloc() callsAlan Coopersmith2022-12-111-1/+1
| | | | | | All these wrappers did was mess with types. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Variable scope reductionsAlan Coopersmith2022-12-111-50/+39
| | | | | | Some found by cppcheck, some found by manual code inspection Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove register keyword from variable declarationsAlan Coopersmith2022-12-101-16/+16
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* suppress four more warnings when 'warningLevel' is zeroBenno Schulenberg2022-07-111-5/+8
| | | | | | | | This addresses issue #20 some more. Reported-by: Vincent Lefevre Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
* suppress the "Could not resolve" warning when 'warningLevel' is zeroBenno Schulenberg2022-07-111-1/+5
| | | | | | | | | | | Two years ago, commit c8cfca25ab changed an error to a warning but forgot to add a check for 'warningLevel'. This partially addresses issue #20. Reported-by: Vincent Lefevre Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
* Fix "upercase" typoAlan Coopersmith2021-11-281-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Downgrade the warning for missing symbols to infoPeter Hutterer2021-01-211-2/+1
| | | | | | | | | | | | In the interest of maintainability, it's easier to include as many keycodes as possible and then have the symbols mapping specific to the layout. This is particularly true for evdev where the kernel takes care of device-specifics and every keyboard has the same set of keycodes anyway. So let's downgrade this from a warning to a mere info, virtually every keyboard right now triggers this warning for a number of keys. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Replace WARN[1-9], ERROR[1-9], etc. with their unnumbered versionPeter Hutterer2021-01-211-78/+78
| | | | | | | | | | | | Those macros date back to when varargs weren't a thing but they've been #defined to the same value for 17 years now. Patch generated with: for action in WARN INFO ERROR ACTION FATAL WSGO; do sed -i "s/${action}[1-9]/${action}/g" `git ls-files` done Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Remove trailing whitespacesPeter Hutterer2021-01-211-9/+9
| | | | | | Let's clean this up so I don't have to fight vim and git in removing them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Fix spelling/wording issuesAlan Coopersmith2020-07-231-2/+2
| | | | | | | Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Don't pretend unresolved symbols are an errorPeter Hutterer2020-06-051-1/+1
| | | | | | | | | Whenever xkeyboard-config is newer than xorgproto, or libX11 just hasn't yet been rebuilt against the protocol we end up with some unresolved symbols. That's not an error, it just happens. Let's downgrade this to a warning instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* When overriding a key, adjust also its number of levels (#57242).Benno Schulenberg2015-11-091-7/+8
| | | | | | | | | | | | | Specifying an explicit key type when overriding a key should adjust the number of levels to that of the specified type. This gets rid of the age-old warning of the right Alt key being ONE_LEVEL but having two symbols assigned. Fixes bug #57242 <http://bugs.freedesktop.org/show_bug.cgi?id=57242>. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Reviewed-by: Ran Benita <ran234@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* symbols: increase the warning level for shortening a key typePeter Hutterer2015-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | Any use of the german keyboard layout or anything else using level3(ralt_switch) produces the warning Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols Ignoring extra symbols This warning is meaningless, the default definition for RALT comes from pc(pc105) including altwin(meta_alt) which defines it as TWO_LEVEL and { Alt_R, Meta_R }. Including level3(ralt_switch) correctly sets it as ONE_LEVEL but now we get the warning. That makes users file bug reports and we can't be having that, can we? Up the warning level for this case to one past the default. The warning is only useful when you're testing a new keyboard layout or trying to fix an actual bug with missing symbols. And then you can run xkbcomp with -w10. No need to spam the log on every server startup. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* Fix many const char * warnings from gccAlan Coopersmith2013-11-011-4/+4
| | | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
* Delete redundant redeclarations of extern Atoms in symbols.cAlan Coopersmith2011-12-281-4/+0
| | | | | | | | | | | | | Fixes gcc warnings of: symbols.c:43: warning: redundant redeclaration of 'tok_ONE_LEVEL' tokens.h:99: warning: previous declaration of 'tok_ONE_LEVEL' was here symbols.c:44: warning: redundant redeclaration of 'tok_TWO_LEVEL' tokens.h:100: warning: previous declaration of 'tok_TWO_LEVEL' was here symbols.c:45: warning: redundant redeclaration of 'tok_KEYPAD' tokens.h:102: warning: previous declaration of 'tok_KEYPAD' was here Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Silence -Wparentheses-equalityJeremy Huddleston2011-11-111-1/+1
| | | | | | warning: equality comparison with extraneous parentheses [-Wparentheses-equality] Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
* Lazy keysym parsing (avoid XStringToKeysym)Daniel Stone2010-06-151-2/+7
| | | | | | | Instead of calling XStringToKeysym on every keysym we parse, store it as a string until we need to store it in an actual keymap. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* Don't overwrite previously assigned type indices with useless ones.Peter Hutterer2008-08-221-2/+9
| | | | | | | | | | | The default type for a key with no levels is ONE_LEVEL. Let's not overwrite the kt_index with this default type if we have previously assigned a real type. Reproduceable by running setxkbmap -layout "ru(phonetic),us", the first group is assigned ONE_LEVEL and shift stops working. Red Hat Bug #436626 <https://bugzilla.redhat.com/show_bug.cgi?id=436626>
* More comments.Peter Hutterer2008-08-211-1/+60
|
* Add some explanatory commentsPeter Hutterer2008-08-181-1/+13
|
* Indent fixes.Peter Hutterer2008-08-121-1579/+1883
| | | | indent -cbi 0 -nprs -nut -npcs -i4 -bli 0 *.c *.h
* Remove RCS tags.Peter Hutterer2008-08-121-2/+0
|
* Fixed a bunch of const correctness bugs.Tilman Sauerbeck2007-09-231-1/+1
|
* Merging XORG-CURRENT into trunkXORG-6_7_99_904XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901XORG-6_7_99_2XORG-6_7_99_1XACE-SELINUX-MERGECOMPOSITEWRAPEgbert Eich2004-04-231-1/+1
|
* Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich2004-03-141-1/+1
|
* Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0STSF-CURRENTEgbert Eich2004-03-031-1/+1
|
* readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich2004-02-261-1/+1
|
* Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich2004-02-261-1/+1
|
* XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_901xf86-4_3_99_16Kaleb Keithley2003-11-251-12/+45
|
* XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1Kaleb Keithley2003-11-141-231/+199
|
* R6.6 is the Xorg base-lineXORG-MAINKaleb Keithley2003-11-141-0/+1920