summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-01-03Only build debug infrastructure if DEBUG is definedAlan Coopersmith
It's only used when DEBUG is defined, so don't build it when we're not using it. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-03Remove unused "no indent" (NOI) debug functionsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-03Mark more functions and variables staticAlan Coopersmith
Stop exporting things that aren't used outside the file that defines them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-03XkbAddDirectoryToPath: don't leak existing paths on realloc() failureAlan Coopersmith
Found by cppcheck: xkbpath.c:217:9: error: Common realloc mistake: 'includePath' nulled but not freed upon failure [memleakOnRealloc] includePath = (char **) realloc(includePath, szPath * sizeof(char *)); ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-03FindKeypadVMod: check xkb is not NULL before dereference, not afterAlan Coopersmith
As found by cppcheck: vmod.c:232:26: warning: Either the condition 'xkb' is redundant or there is possible null pointer dereference: xkb. [nullPointerRedundantCheck] name = XkbInternAtom(xkb->dpy, "NumLock", False); ^ vmod.c:233:10: note: Assuming that condition 'xkb' is not redundant if ((xkb) && LookupVModIndex((XPointer) xkb, None, name, TypeInt, &rtrn)) ^ vmod.c:232:26: note: Null pointer dereference name = XkbInternAtom(xkb->dpy, "NumLock", False); ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-03Remove #ifdef sgi sectionsAlan Coopersmith
They just included an additional malloc.h header, but SGI Irix has been unsupported for a decade now. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-03Handle -Wstringop-truncation warning in HandleOverlayDef()Alan Coopersmith
In function ‘HandleOverlayDef’, inlined from ‘HandleSectionBody’ at geometry.c:2778:18, inlined from ‘HandleSectionDef’ at geometry.c:2818:10, inlined from ‘HandleGeometryFile’ at geometry.c:2864:18: geometry.c:2573:9: warning: ‘strncpy’ output may be truncated copying 4 bytes from a string of length 4 [-Wstringop-truncation] 2573 | strncpy(key->over, keyDef->over, XkbKeyNameLength); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ geometry.c:2574:9: warning: ‘strncpy’ output may be truncated copying 4 bytes from a string of length 4 [-Wstringop-truncation] 2574 | strncpy(key->under, keyDef->under, XkbKeyNameLength); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-03Use asprintf() if the platform supports itAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace && with & for bitwise comparisonAlan Coopersmith
Clears up gcc warning: keytypes.c: In function ‘SetPreserve’: keytypes.c:757:26: warning: promoted ~unsigned is always non-zero [-Wsign-compare] || (new.preVMods && (~new.indexVMods))) ^~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Fix 106 missing-field-initializers warnings in misc.cAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace malloc()+bzero() pairs with calloc() callsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Remove unnecessary casts from bzero() callsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Remove unnecessary casts from memcpy() callsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace Opaque with direct usage of void *Alan Coopersmith
Only one use was left after deleting the *alloc/free() wrappers Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Remove unnecessary checks for NULL pointers before calling free()Alan Coopersmith
Not needed in C89 and later Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace uFree() with direct free() callsAlan Coopersmith
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>
2022-12-11Replace uTypedRecalloc() with direct recallocarray() callsAlan Coopersmith
Retains uRecalloc() as a fallback for platforms without recallocarray() Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace uTypedRealloc() with direct reallocarray() callsAlan Coopersmith
Falls back to realloc() if platform doesn't offer reallocarray(). Also removes uRealloc() since it had no other uses. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace uCalloc() and uTypedCalloc() with direct calloc() callsAlan Coopersmith
All these wrappers did was mess with types. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace uAlloc() and uTypedAlloc() with direct malloc() callsAlan Coopersmith
All these wrappers did was mess with types. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Delete unused uTmpAlloc/uTmpFree wrappers around alloca()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Use C99 struct initializersAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Variable scope reductionsAlan Coopersmith
Some found by cppcheck, some found by manual code inspection Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-10Remove register keyword from variable declarationsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-10Eliminate 20 -Wimplicit-fallthrough warningsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-10gitlab CI: stop requiring Signed-off-by in commitsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-10Avoid possibly dereferencing null pointerLeandro Nini
This addresses issue #21 Signed-off-by: Leandro Nini <drfiemost@email.it>
2022-12-07xkbcomp 1.4.6xkbcomp-1.4.6Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-11-29configure: Use AC_SYS_LARGEFILE to enable large file supportMatt Turner
Signed-off-by: Matt Turner <mattst88@gmail.com>
2022-07-11suppress four more warnings when 'warningLevel' is zeroBenno Schulenberg
This addresses issue #20 some more. Reported-by: Vincent Lefevre Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-07-11suppress the "Could not resolve" warning when 'warningLevel' is zeroBenno Schulenberg
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>
2022-04-02man page: remove out-of-date COPYRIGHT sectionAlan Coopersmith
The information previously listed here didn't match what is present in the source code or the COPYING file, and the X(7) man page doesn't list any license information as this had claimed. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-08gitlab CI: update to new templatesAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-06Build xz tarballs instead of bzip2Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-11-28Fix "upercase" typoAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-03-17xkbcomp 1.4.5xkbcomp-1.4.5Peter Hutterer
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-21keycodes: compress the high keycode warningPeter Hutterer
No point spending 3 lines on this, especially given that this warning is always triggered. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-21keycodes: downgrade the >255 keycode warning to an infoPeter Hutterer
This warning will be triggered all the time now that xkeyboard-config has started adding keycodes > 255. Downgrade to an info, there's nothing the user can do about this warning anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-21Downgrade the warning for missing symbols to infoPeter Hutterer
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>
2021-01-21Replace WARN[1-9], ERROR[1-9], etc. with their unnumbered versionPeter Hutterer
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>
2021-01-21gitlab CI: add basic build testPeter Hutterer
Copied from xorgproto Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-21Remove trailing whitespacesPeter Hutterer
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>
2020-11-05xkbcomp 1.4.4xkbcomp-1.4.4Peter Hutterer
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-21Fix lockdevbtn to be XkbSA_LockDeviceBtn actionMiroslav Koškár
2020-07-23Fix spelling/wording issuesAlan Coopersmith
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-06-05Don't pretend unresolved symbols are an errorPeter Hutterer
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>
2020-06-05For -R and after chdir, add the current directory to the pathPeter Hutterer
This restores the behavior pre 1aecdffaa0db7bbf85bc0aae9043e9437b25c30d, at least when -R is given. For a normal invocation without -R we don't add the current directory, because 1aecdff isn't totally wrong about whether that's a good idea. Fixes https://gitlab.freedesktop.org/xorg/app/xkbcomp/issues/3
2020-02-20xkbcomp 1.4.3xkbcomp-1.4.3Matt Turner
Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-02-19Don't compare with string literalsDimitry Andric
xkbcomp.c:228:37: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare] if ((argv[i][0] != '-') || (uStringEqual(argv[i], "-"))) ^~~~~~~~~~~~~~~~~~~~~~~~~~ ./utils.h:195:30: note: expanded from macro 'uStringEqual' ^~~~~~~~~~~~~~~~~~~~~ ./utils.h:198:38: note: expanded from macro 'uStringCompare' (s1)!=(s2):strcmp(s1,s2)) ^ ~~~~ Don't attempt to do this macro trickery, and simply use strcmp instead, where it applies. Bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244235
2019-06-13Error out if we have no default pathPeter Hutterer
The path is set through configure.ac/Makefile.am and always defined anyway. Let's not re-define it here with a different value than our default. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>