xkbcomp: Changes to 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 3 19:12:53 UTC 2023


 .gitlab-ci.yml |    4 
 action.c       |  213 +++++++++++++++--------------
 action.h       |    6 
 alias.c        |   22 +--
 alias.h        |    2 
 compat.c       |  100 ++++++-------
 configure.ac   |    7 
 expr.c         |  189 +++++++++++++-------------
 expr.h         |   49 ++----
 geometry.c     |  296 ++++++++++++++++++-----------------------
 indicators.c   |   46 +++---
 indicators.h   |    8 -
 keycodes.c     |   63 +++-----
 keymap.c       |    8 -
 keytypes.c     |  222 ++++++++++++-------------------
 listing.c      |   57 ++++---
 misc.c         |  267 +++++++++++++++++++------------------
 misc.h         |   10 -
 parseutils.c   |  408 +++++++++++++++++++++++++++++++--------------------------
 parseutils.h   |    6 
 symbols.c      |  272 +++++++++++++++++---------------------
 utils.c        |   93 +++---------
 utils.h        |   89 +++---------
 vmod.c         |   46 +++---
 vmod.h         |   13 -
 xkbcomp.c      |   66 +++++----
 xkbcomp.h      |   12 -
 xkbparse.y     |    5 
 xkbpath.c      |   67 ++++-----
 xkbpath.h      |    8 -
 xkbscan.c      |    6 
 31 files changed, 1245 insertions(+), 1415 deletions(-)

New commits:
commit 772470d0e4fef8e0a3d6eaf4c563fa7b1f6d6d19
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Dec 11 15:32:03 2022 -0800

    Replace calloc(strlen())+strcpy() pairs with strdup() calls
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 6db8fd556e2562e9a0a821c0d6fd4f7cdcf6266c
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Dec 11 15:18:26 2022 -0800

    Mark more pointers as const
    
    Some suggested by cppcheck, others by manual code inspection
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 299c9762b1dbe53f3297c54e5526aeae767d1a10
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Dec 11 10:24:13 2022 -0800

    Use unsigned ints when shifting to create bitmasks
    
    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 at oracle.com>

commit e4cba31313b44e40efcc0c260a33c3ec83e4b772
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Dec 11 10:20:05 2022 -0800

    Stop building more unused functions
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 3e486c4578f3f6a81fc0f9afba6551dfa8c7b63b
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Dec 11 10:02:13 2022 -0800

    Only build debug infrastructure if DEBUG is defined
    
    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 at oracle.com>

commit a3bbf780252e55bb1dcab717289ef09e00d11223
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Dec 11 09:55:55 2022 -0800

    Remove unused "no indent" (NOI) debug functions
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 0493c7216dd39baeb420583be71af095576dbf74
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Dec 11 09:50:55 2022 -0800

    Mark more functions and variables static
    
    Stop exporting things that aren't used outside the file
    that defines them.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 4119707089b5c14f53bd5ff0b86ee7e575ac9316
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Dec 11 09:22:57 2022 -0800

    XkbAddDirectoryToPath: don't leak existing paths on realloc() failure
    
    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 at oracle.com>

commit 0d22aac7bb50ff1f7588f78ec25e9fb62a7b2e5e
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Dec 11 09:17:56 2022 -0800

    FindKeypadVMod: check xkb is not NULL before dereference, not after
    
    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 at oracle.com>

commit c7a5d1468c75adb2139d2c2facc73854f13b5ba3
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Dec 11 08:57:56 2022 -0800

    Remove #ifdef sgi sections
    
    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 at oracle.com>

commit e6821a8a7b16e5a8e4c478c9544798fae59a21d1
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 16:20:58 2022 -0800

    Handle -Wstringop-truncation warning in HandleOverlayDef()
    
    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 at oracle.com>

commit 81e46cab5f4bdd69fa0a644dba86f6902cece175
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 16:10:01 2022 -0800

    Use asprintf() if the platform supports it
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit a1551b78e9ac0e2075ca241c0e8ae361758f26b4
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 15:39:39 2022 -0800

    Replace && with & for bitwise comparison
    
    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 at oracle.com>

commit e4e821d5083072e796d6489ddcacf895a43c66f1
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 15:37:56 2022 -0800

    Fix 106 missing-field-initializers warnings in misc.c
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 1fb639c97fc28b8ed66b5553eafbbeed07e4cb09
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 15:33:17 2022 -0800

    Replace malloc()+bzero() pairs with calloc() calls
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 8e58b7949ab96180d60fb13f7820d6cc01c228ae
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 15:21:49 2022 -0800

    Remove unnecessary casts from bzero() calls
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit bdbfa354dd4d93657104ccd7c9e892ed45197dd8
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 15:16:05 2022 -0800

    Remove unnecessary casts from memcpy() calls
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit f1757a005f471044da3f8e946a091b067996d270
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 14:30:21 2022 -0800

    Replace Opaque with direct usage of void *
    
    Only one use was left after deleting the *alloc/free() wrappers
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 5655379ce89ab55f25a536972aaa310480de9432
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 14:23:11 2022 -0800

    Remove unnecessary checks for NULL pointers before calling free()
    
    Not needed in C89 and later
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 2ac6a7f029d8855fbb4e8024aab0511727ac3a67
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 14:10:32 2022 -0800

    Replace uFree() with direct free() calls
    
    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 at oracle.com>

commit 8d85bd1e2f9473958b235caf7af9913b518f73dd
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 14:07:18 2022 -0800

    Replace uTypedRecalloc() with direct recallocarray() calls
    
    Retains uRecalloc() as a fallback for platforms without recallocarray()
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit e02e32f71f6c24fcc69bdaf58f6f9e973a017896
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 13:49:56 2022 -0800

    Replace uTypedRealloc() with direct reallocarray() calls
    
    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 at oracle.com>

commit 75af06f5f8ffc41fabd100253aad222cb4ab8662
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 13:44:17 2022 -0800

    Replace uCalloc() and uTypedCalloc() with direct calloc() calls
    
    All these wrappers did was mess with types.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 265ea3a77418df2744575f1168f89a33f01e72d4
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 13:39:10 2022 -0800

    Replace uAlloc() and uTypedAlloc() with direct malloc() calls
    
    All these wrappers did was mess with types.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 81e51cf1ff494131827df487a0f538c3b07e0407
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 13:34:09 2022 -0800

    Delete unused uTmpAlloc/uTmpFree wrappers around alloca()
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 77b1efa1c83ad64d49d1e9c085d2a496580ce6f9
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 13:26:39 2022 -0800

    Use C99 struct initializers
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 64761ee9424f755b84ab0ce02d13eda32d215a14
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 11:38:04 2022 -0800

    Variable scope reductions
    
    Some found by cppcheck, some found by manual code inspection
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 9737af15196380a1687d18a17d297ee17b45a83f
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 11:03:40 2022 -0800

    Remove register keyword from variable declarations
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit b67c058e2ccc27472b238a6b5dc5e4cd20f6d2bd
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Dec 10 09:08:33 2022 -0800

    Eliminate 20 -Wimplicit-fallthrough warnings
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 634f60a9b25b5d03c78e90574adce3e38f378333
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Thu Jul 28 17:30:21 2022 -0700

    gitlab CI: stop requiring Signed-off-by in commits
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>



More information about the xorg-commit mailing list