1. 09 Jan, 2020 3 commits
    • Ulrich Sibiller's avatar
      _XkbFilterDeviceBtn: move variable declarations to match usage scope · 1a1ace77
      Ulrich Sibiller authored
      Fix this warning:
      
      xkbActions.c: In function ‘_XkbFilterDeviceBtn’:
      xkbActions.c:1084:6: warning: declaration of ‘button’ shadows a previous local [-Wshadow=compatible-local]
        int button;
            ^~~~~~
      xkbActions.c:1044:6: note: shadowed declaration is here
       int  button;
            ^~~~~~
      
      Backport of this xorg-xserver upstream commit:
      
        commit 41dd7cf673e47ab74c5065b8dbf268b2e5facb64
        Author: Alan Coopersmith <alan.coopersmith@oracle.com>
        Date:   Mon Dec 12 16:49:34 2011 -0800
      
          _XkbFilterDeviceBtn: move variable declarations to match usage scope
      
          The main body of this function is an if { } else if { } pair of blocks.
          Previously there was int button at the top level scope which is used
          only in the first block, and a redeclaration of int button inside the
          second block.   Since there's no overlap in the code paths for the
          two uses of button, move the one from the outer block into the first
          block to help the programmer more quickly determine they are unrelated
          usages, and to silence the gcc warning of:
      
          xkbActions.c: In function '_XkbFilterDeviceBtn':
          xkbActions.c:999:6: warning: declaration of 'button' shadows a previous local
          xkbActions.c:955:6: warning: shadowed declaration is here
      
          For consistency, move DeviceIntPtr dev declarations as well that are
          used in the same way.
      Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Reviewed-by: 's avatarJamey Sharp <jamey@minilop.net>
      Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      1a1ace77
    • Ulrich Sibiller's avatar
      XkbFindSrvLedInfo: remove extraneous name-clashing sli variable · 914f88a8
      Ulrich Sibiller authored
      Fix shadow warning:
      
      xkbLEDs.c: In function ‘XkbFindSrvLedInfo’:
      xkbLEDs.c:633:19: warning: declaration of ‘sli’ shadows a previous local [-Wshadow=compatible-local]
        XkbSrvLedInfoPtr sli;
                         ^~~
      xkbLEDs.c:629:18: note: shadowed declaration is here
       XkbSrvLedInfoPtr sli;
                        ^~~
      
      Backport of this xorg-xserver commit:
      
        commit d8eb9b5faa2d2c9350bdaffef8749a9cac3c87b8
        Author: Alan Coopersmith <alan.coopersmith@oracle.com>
        Date:   Mon Dec 12 16:49:34 2011 -0800
      
          XkbFindSrvLedInfo: remove extraneous name-clashing sli variable
      
          Variable is already defined outside the outer if statement, and
          there's no need to redefine inside the if statement.
      
          No point in setting sli before if (dev->kbdfeed->xkb_sli==NULL)
          check - if check is true, we immediately set it, if check is false,
          we immediately return without further reference or use of it.
      
          The one thing we do with it inside the inner if statement is store
          an allocation in it for a brief moment before writing to the final
          destination, which is immediately returned to the caller.
      
          In short, there's no benefit to the variable at all in this block,
          it just gives the optimizer more code to figure out how to omit.
      
          Fixes gcc warning:
          xkbLEDs.c: In function 'XkbFindSrvLedInfo':
          xkbLEDs.c:683:19: warning: declaration of 'sli' shadows a previous local
          xkbLEDs.c:679:18: warning: shadowed declaration is here
      Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Reviewed-by: 's avatarJamey Sharp <jamey@minilop.net>
      Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      914f88a8
    • Ulrich Sibiller's avatar
      xkb: fix shadow warnings · ae180b6b
      Ulrich Sibiller authored
      xkb.c: In function ‘ProcXkbSetCompatMap’:
      xkb.c:2601:20: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local]
        register unsigned i,bit;
                          ^
      xkb.c:2529:23: note: shadowed declaration is here
           register unsigned i,bit;
                             ^
      xkb.c:2601:22: warning: declaration of ‘bit’ shadows a previous local [-Wshadow=compatible-local]
        register unsigned i,bit;
                            ^~~
      xkb.c:2529:25: note: shadowed declaration is here
           register unsigned i,bit;
                               ^~~
      
      Backport of this xorg upstream commit:
      
        commit 344eea237fc07dedfd733d14f95ed0ad26bb5f81
        Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
        Date:   Tue Oct 16 02:04:34 2012 -0500
      
          xkb: fix shadow warnings
      Signed-off-by: 's avatarYaakov Selkowitz <yselkowitz@users.sourceforge.net>
      Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      ae180b6b
  2. 05 Jan, 2020 1 commit
  3. 29 Sep, 2019 1 commit
  4. 22 Jun, 2019 8 commits
    • Ulrich Sibiller's avatar
      rework xkb device private handling · 3aabc92c
      Ulrich Sibiller authored
      We can only free the xkbDevicePrivate because we do not know the
      details of any other (possible) extension. So let's limit to that one
      private for now and call the new xkbFreePrivates from dix (where such
      a function is completely missing).
      3aabc92c
    • Ulrich Sibiller's avatar
      xkb: fix what looks to be a copy-paste error with first vs firstMM · 5be6d271
      Ulrich Sibiller authored
        commit 758393951233d1b2520cf4cefd33ec4288a3880a
        Author: Dave Airlie <airlied@redhat.com>
        Date:   Wed Sep 12 11:09:40 2018 +1000
      
          xkb: fix what looks to be a copy-paste error with first vs firstMM
      
          Pointed out by coverity.
      Signed-off-by: 's avatarDave Airlie <airlied@redhat.com>
      5be6d271
    • Ulrich Sibiller's avatar
      xkmread.c: fix compiler warning · 31c3d27e
      Ulrich Sibiller authored
      xkmread.c: In function ‘XkmReadFileSectionName’:
      xkmread.c:1181:25: warning: ‘tmpTOC.type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           XkbConfigText(tmpTOC.type,XkbMessage),0);
      31c3d27e
    • Ulrich Sibiller's avatar
      xkb: Silence some compiler warnings · 813acdd2
      Ulrich Sibiller authored
        commit 83913de25d35709b3ab7b0ab124b73924145d2dd
        Author: Adam Jackson <ajax@redhat.com>
        Date:   Thu Apr 5 12:59:11 2018 -0400
      
          xkb: Silence some compiler warnings
      
          Of the form:
      
          ../xkb/XKBGAlloc.c: In function ‘SrvXkbAddGeomKeyAlias’:
          ../xkb/XKBGAlloc.c:591:13: warning: ‘strncpy’ specified bound 4 equals destination size [-Wstringop-truncation]
                       strncpy(alias->real, realStr, XkbKeyNameLength);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
          This is intentional; the code that reads from these fields never reads
          more than 4 bytes anyway. Rephrase things in terms of memcpy so that's
          clear. Obviously this is awful but in XKB awful is par.
      Signed-off-by: 's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: 's avatarKeith Packard <keithp@keithp.com>
      813acdd2
    • Ulrich Sibiller's avatar
      xkb: Use snprintf to measure string lengths instead of manual strlen math · 054e906f
      Ulrich Sibiller authored
        commit a4a2e814d5d0e6152307a301eda1d6fc1c555aaa
        Author: Alan Coopersmith <alan.coopersmith@oracle.com>
        Date:   Sun Feb 13 21:36:02 2011 -0800
      
          xkb: Use snprintf to measure string lengths instead of manual strlen math
      Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Reviewed-by: 's avatarDaniel Stone <daniel@fooishbar.org>
      054e906f
    • Ulrich Sibiller's avatar
      xkbEvents.c: Fix "warning: unused variable `s'". · 2070891c
      Ulrich Sibiller authored
        commit 2391c409a2840d61fed93832650c0d6c82ebebdf
        Author: Eamon Walsh <ewalsh@tycho.nsa.gov>
        Date:   Fri Jun 13 22:48:17 2008 -0400
      
          Fix "warning: unused variable `s'".
      2070891c
    • Ulrich Sibiller's avatar
      XKB: Remove a bunch of mad ifdefs · 4962c5a8
      Ulrich Sibiller authored
        commit 534fc5140b039a8c98ab715d0a6740d513b41209
        Author: Daniel Stone <daniel@fooishbar.org>
        Date:   Sun Feb 3 23:30:22 2008 +1100
      
          XKB: Remove a bunch of mad ifdefs
      
          We have SEEK_SET and size_t, seriously.  Also use DebugF instead of
          ifdef DEBUG, and ditch a couple of random bits that were never used.
      4962c5a8
    • Ulrich Sibiller's avatar
      xkb: remove oldState from XkbHandleActions. · 56dcc8a4
      Ulrich Sibiller authored
      Fixes this cppcheck finding:
      [nx-X11/programs/Xserver/xkb/xkbActions.c:1306]: (error) Uninitialized variable: oldState
      
        commit 35a4b8e7f4526a92d44cb16a783f21030cd1f6df
        Author: Peter Hutterer <peter.hutterer@who-t.net>
        Date:   Tue May 5 16:51:59 2009 +1000
      
          xkb: remove oldState from XkbHandleActions.
      
          I really don't know what the purpose of this variable is or was, aside from
          potentially clobbering up our key state since there's a path where it may be
          used uninitialised.
      
          Also, this means that xkbi->prev_state is now accessible from the DIX with
          meaningful data.
      Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      56dcc8a4
  5. 18 Jun, 2019 1 commit
  6. 17 May, 2019 1 commit
  7. 10 May, 2019 1 commit
  8. 17 Dec, 2018 2 commits
  9. 09 Nov, 2018 14 commits
  10. 03 Jul, 2018 4 commits
  11. 27 Feb, 2018 2 commits
  12. 27 Dec, 2017 1 commit
  13. 07 Dec, 2017 1 commit