Age | Commit message (Collapse) | Author |
|
Found by Oracle Parfait static analyzer:
Error: File Leak
File Leak [file-ptr-leak]:
Leaked File outFile
at line 497 of app/xkbcomp/listing.c in function 'GenerateListing'.
outFile initialized at line 432 with fopen
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Some suggested by cppcheck, others by manual code inspection
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Stop exporting things that aren't used outside the file
that defines them.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Only one use was left after deleting the *alloc/free() wrappers
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Not needed in C89 and later
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
Retains uRecalloc() as a fallback for platforms without recallocarray()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
All these wrappers did was mess with types.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
All these wrappers did was mess with types.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Some found by cppcheck, some found by manual code inspection
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
This addresses issue #21
Signed-off-by: Leandro Nini <drfiemost@email.it>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Matt Turner <mattst88@gmail.com>
|
|
This addresses issue #20 some more.
Reported-by: Vincent Lefevre
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Copied from xorgproto
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
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>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|