summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* configure: raise minimum autoconf requirement to 2.70HEADmasterAlan Coopersmith2023-02-161-1/+1
| | | | | | | | Needed for builds on NetBSD to work correctly, since it depends on AC_USE_SYSTEM_EXTENSIONS defining _OPENBSD_SOURCE to expose the prototype for reallocarray() in the system headers. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* xkbcomp.h: include config.h before any other headersAlan Coopersmith2023-01-281-0/+4
| | | | | | | | | | Ensures flags set by AC_USE_SYSTEM_EXTENSIONS are correctly propogated when including system headers. Closes: #22 xkbcomp from git compile error Fixes: 81e46ca ("Use asprintf() if the platform supports it") Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace calloc(strlen())+strcpy() pairs with strdup() callsAlan Coopersmith2023-01-031-6/+3
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Mark more pointers as constAlan Coopersmith2023-01-0326-306/+261
| | | | | | 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-035-36/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Stop building more unused functionsAlan Coopersmith2023-01-033-0/+12
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Only build debug infrastructure if DEBUG is definedAlan Coopersmith2023-01-037-11/+21
| | | | | | | 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>
* Remove unused "no indent" (NOI) debug functionsAlan Coopersmith2023-01-032-27/+0
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Mark more functions and variables staticAlan Coopersmith2023-01-0316-78/+18
| | | | | | | Stop exporting things that aren't used outside the file that defines them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* XkbAddDirectoryToPath: don't leak existing paths on realloc() failureAlan Coopersmith2023-01-031-2/+5
| | | | | | | | | | | 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>
* FindKeypadVMod: check xkb is not NULL before dereference, not afterAlan Coopersmith2023-01-031-6/+7
| | | | | | | | | | | | | | | | | 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>
* Remove #ifdef sgi sectionsAlan Coopersmith2023-01-032-8/+0
| | | | | | | 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>
* Handle -Wstringop-truncation warning in HandleOverlayDef()Alan Coopersmith2023-01-031-2/+2
| | | | | | | | | | | | | | | | | 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>
* Use asprintf() if the platform supports itAlan Coopersmith2023-01-035-10/+35
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace && with & for bitwise comparisonAlan Coopersmith2022-12-111-1/+1
| | | | | | | | | | | | 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>
* Fix 106 missing-field-initializers warnings in misc.cAlan Coopersmith2022-12-111-106/+106
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace malloc()+bzero() pairs with calloc() callsAlan Coopersmith2022-12-114-26/+13
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove unnecessary casts from bzero() callsAlan Coopersmith2022-12-117-17/+15
| | | | 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>
* Replace Opaque with direct usage of void *Alan Coopersmith2022-12-112-8/+1
| | | | | | Only one use was left after deleting the *alloc/free() wrappers Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove unnecessary checks for NULL pointers before calling free()Alan Coopersmith2022-12-117-68/+35
| | | | | | Not needed in C89 and later Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace uFree() with direct free() callsAlan Coopersmith2022-12-1112-76/+64
| | | | | | | 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-116-29/+34
| | | | | | Retains uRecalloc() as a fallback for platforms without recallocarray() Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace uTypedRealloc() with direct reallocarray() callsAlan Coopersmith2022-12-114-18/+12
| | | | | | | 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>
* Replace uCalloc() and uTypedCalloc() with direct calloc() callsAlan Coopersmith2022-12-118-37/+25
| | | | | | 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-1113-56/+48
| | | | | | All these wrappers did was mess with types. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Delete unused uTmpAlloc/uTmpFree wrappers around alloca()Alan Coopersmith2022-12-111-7/+0
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Use C99 struct initializersAlan Coopersmith2022-12-117-176/+236
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Variable scope reductionsAlan Coopersmith2022-12-1116-267/+222
| | | | | | 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-1016-63/+63
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Eliminate 20 -Wimplicit-fallthrough warningsAlan Coopersmith2022-12-102-48/+54
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* gitlab CI: stop requiring Signed-off-by in commitsAlan Coopersmith2022-12-101-2/+2
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Avoid possibly dereferencing null pointerLeandro Nini2022-12-101-5/+8
| | | | | | This addresses issue #21 Signed-off-by: Leandro Nini <drfiemost@email.it>
* xkbcomp 1.4.6xkbcomp-1.4.6Alan Coopersmith2022-12-071-2/+2
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* configure: Use AC_SYS_LARGEFILE to enable large file supportMatt Turner2022-11-291-0/+3
| | | | Signed-off-by: Matt Turner <mattst88@gmail.com>
* suppress four more warnings when 'warningLevel' is zeroBenno Schulenberg2022-07-113-7/+10
| | | | | | | | 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>
* man page: remove out-of-date COPYRIGHT sectionAlan Coopersmith2022-04-021-4/+0
| | | | | | | | 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>
* gitlab CI: update to new templatesAlan Coopersmith2021-12-081-9/+67
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Build xz tarballs instead of bzip2Alan Coopersmith2021-12-061-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix "upercase" typoAlan Coopersmith2021-11-281-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* xkbcomp 1.4.5xkbcomp-1.4.5Peter Hutterer2021-03-171-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* keycodes: compress the high keycode warningPeter Hutterer2021-01-211-6/+2
| | | | | | | 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>
* keycodes: downgrade the >255 keycode warning to an infoPeter Hutterer2021-01-211-2/+2
| | | | | | | | 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>
* 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-2117-500/+464
| | | | | | | | | | | | 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>
* gitlab CI: add basic build testPeter Hutterer2021-01-211-0/+43
| | | | | | Copied from xorgproto Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Remove trailing whitespacesPeter Hutterer2021-01-2133-292/+292
| | | | | | 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>
* xkbcomp 1.4.4xkbcomp-1.4.4Peter Hutterer2020-11-051-3/+3
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Fix lockdevbtn to be XkbSA_LockDeviceBtn actionMiroslav Koškár2020-10-211-1/+1
|