1. 15 Oct, 2020 2 commits
  2. 10 Oct, 2020 2 commits
    • Ross Burton's avatar
      cpprules.in: squash whitespace in generated files · a37986f7
      Ross Burton authored
      CPP is used to generate files, but as cpp reads files from the build host the
      output has a number of blank lines at the beginning which varies depending on
      what GCC and friends is used.
      
      Pathalogical example:
      
       $ cpp -undef -traditional /dev/null
       # 1 "/dev/null"
       # 1 "<built-in>"
       # 1 "<command-line>"
       # 31 "<command-line>"
       # 1 "/usr/include/stdc-predef.h" 1 3 4
      
       # 17 "/usr/include/stdc-predef.h" 3 4
      
       [ 40 blank line ]
      
       # 32 "<command-line>" 2
       # 1 "/dev/null"
      
      So depending on the content of stdc-predef.h and what other headers CPP will
      load, the amount of whitespace in the generates files varies. This can result in
      differences in reproducible environments, and file conflicts in multilib
      environments.
      
      As whitespace is irrelevant to these machine-readable files, extend the sed to
      just delete blank lines.
      a37986f7
    • Carmina16's avatar
      Adding ia and ie locales · 16192ce2
      Carmina16 authored
      16192ce2
  3. 28 Sep, 2020 1 commit
  4. 21 Sep, 2020 1 commit
    • Krzesimir Nowak's avatar
      Fix leaking modifiers string. · 1a9269a9
      Krzesimir Nowak authored
      Reported by valgrind:
      
      ```
      ==118175== 17 bytes in 1 blocks are definitely lost in loss record 13 of 1,675
      ==118175==    at 0x483A809: malloc (vg_replace_malloc.c:307)
      ==118175==    by 0x5CD1B46: _XlcDefaultMapModifiers (in /usr/lib64/libX11.so.6.3.0)
      ==118175==    by 0x5CD1F1A: XSetLocaleModifiers (in /usr/lib64/libX11.so.6.3.0)
      ==118175==    by 0x496841C: X11_InitKeyboard (SDL_x11keyboard.c:324)
      ==118175==    by 0x496F0CA: X11_VideoInit (SDL_x11video.c:455)
      ==118175==    by 0x494747B: SDL_VideoInit_REAL (SDL_video.c:532)
      ==118175==    by 0x489E886: SDL_InitSubSystem_REAL (SDL.c:206)
      ==118175==    by 0x402634: main (fade.cc:35)
      ```
      1a9269a9
  5. 28 Aug, 2020 6 commits
    • Alan Coopersmith's avatar
      Exempt XLookupKeysym from XKeycodeToKeysym deprecation warnings · d127217f
      Alan Coopersmith authored
      Gets rid of:
      src/xkb/XKBBind.c: In function ‘XLookupKeysym’:
      src/xkb/XKBBind.c:234:5: warning: ‘XKeycodeToKeysym’ is deprecated
      [https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Wdeprecated-declarations]
        234 |     return XKeycodeToKeysym(dpy, event->keycode, col);
            |     ^~~~~~
      src/xkb/XKBBind.c:96:1: note: declared here
         96 | XKeycodeToKeysym(Display *dpy,
            | ^~~~~~~~~~~~~~~~
      Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      d127217f
    • Alan Coopersmith's avatar
      lcUTF8: Increase string buffer size from 20 to 32 bytes · a64eb5f4
      Alan Coopersmith authored
      While we don't expect large enough ints to need it, we don't
      enforce a maximum size, so gcc assumes the worst and warns:
      
      ../../../src/xlibi18n/lcUTF8.c: In function ‘create_tofontcs_conv’:
      ../../../src/xlibi18n/lcUTF8.c:1736:34: warning: ‘.charset.name’ directive output may be truncated writing 13 bytes into a region of size between 8 and 17 [-Wformat-truncation=]
       1736 |  snprintf(buf, sizeof(buf), "fs%d.charset.name", i);
            |                                  ^~~~~~~~~~~~~
      ../../../src/xlibi18n/lcUTF8.c:1736:2: note: ‘snprintf’ output between 17 and 26 bytes into a destination of size 20
       1736 |  snprintf(buf, sizeof(buf), "fs%d.charset.name", i);
            |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../../src/xlibi18n/lcUTF8.c:1739:46: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
       1739 |      snprintf(buf, sizeof(buf), "fs%d.charset", i);
            |                                              ^
      ../../../src/xlibi18n/lcUTF8.c:1739:6: note: ‘snprintf’ output between 12 and 21 bytes into a destination of size 20
       1739 |      snprintf(buf, sizeof(buf), "fs%d.charset", i);
            |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../../src/xlibi18n/lcUTF8.c:1754:41: warning: ‘.charset.name’ directive output may be truncated writing 13 bytes into a region of size between 8 and 17 [-Wformat-truncation=]
       1754 |         snprintf(buf, sizeof(buf), "fs%d.charset.name", i);
            |                                         ^~~~~~~~~~~~~
      ../../../src/xlibi18n/lcUTF8.c:1754:9: note: ‘snprintf’ output between 17 and 26 bytes into a destination of size 20
       1754 |         snprintf(buf, sizeof(buf), "fs%d.charset.name", i);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../../src/xlibi18n/lcUTF8.c:1757:53: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
       1757 |             snprintf(buf, sizeof(buf), "fs%d.charset", i);
            |                                                     ^
      ../../../src/xlibi18n/lcUTF8.c:1757:13: note: ‘snprintf’ output between 12 and 21 bytes into a destination of size 20
       1757 |             snprintf(buf, sizeof(buf), "fs%d.charset", i);
            |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      a64eb5f4
    • Alan Coopersmith's avatar
      i18n: use memcpy instead of strncpy on unterminated char arrays · 54925250
      Alan Coopersmith authored
      Avoids gcc warnings that we're using strncpy wrong to copy a known-length
      set of characters without a terminating '\0' to a buffer whose length we
      are checking separately.  (Should also be imperceptibly faster since we
      no longer check if each byte is '\0' when we already know it won't be.)
      Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      54925250
    • Alan Coopersmith's avatar
      Mark FreeBlueTblElements label unused in LRGB.c · 8754868d
      Alan Coopersmith authored
      Quiets gcc 10.2 warning of:
      src/xcms/LRGB.c: In function ‘LINEAR_RGB_InitSCCData’:
      src/xcms/LRGB.c:798:1: warning: label ‘FreeBlueTblElements’ defined
       but not used
      [https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-label-Wunused-label]
        798 | FreeBlueTblElements:
            | ^~~~~~~~~~~~~~~~~~~
      Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      8754868d
    • Alan Coopersmith's avatar
      Raise minimum required xproto version to 7.0.25 (released 2013-11-23) · 52b0cd67
      Alan Coopersmith authored
      Allows us to depend on _X_COLD directly instead of having to check for it.
      
      (Since we also use _X_UNUSED, 7.0.22 or later was implicitly required
       already but not checked for.)
      Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      52b0cd67
    • Maya Rashish's avatar
      Avoid the use of "register" keyword in public headers. · deafb99f
      Maya Rashish authored
      This causes issues when compiling code for C++17.
      deafb99f
  6. 24 Aug, 2020 1 commit
  7. 19 Aug, 2020 1 commit
  8. 17 Aug, 2020 1 commit
  9. 14 Aug, 2020 1 commit
  10. 10 Aug, 2020 1 commit
  11. 06 Aug, 2020 2 commits
  12. 02 Aug, 2020 1 commit
    • Yichao Yu's avatar
      Fix size calculation in `_XimAttributeToValue`. · 93fce3f4
      Yichao Yu authored
      The check here guards the read below.
      For `XimType_XIMStyles`, these are `num` of `CARD32` and for `XimType_XIMHotKeyTriggers`
      these are `num` of `XIMTRIGGERKEY` ref[1] which is defined as 3 x `CARD32`.
      (There are data after the `XIMTRIGGERKEY` according to the spec but they are not read by this
      function and doesn't need to be checked.)
      
      The old code here used the native datatype size instead of the wire protocol size causing
      the check to always fail.
      
      Also fix the size calculation for the header (size). It is 2 x CARD16 for both types
      despite the unused `CARD16` for `XimType_XIMStyles`.
      
      [1] https://www.x.org/releases/X11R7.6/doc/libX11/specs/XIM/xim.html#Input_Method_Styles
      
      This fixes a regression caused by 388b303c in 1.6.10.
      
      Fix #116
      93fce3f4
  13. 30 Jul, 2020 1 commit
  14. 24 Jul, 2020 5 commits
  15. 22 Jul, 2020 1 commit
  16. 19 Jul, 2020 1 commit
  17. 04 Jun, 2020 1 commit
    • Samuel Thibault's avatar
      Braille: Fix default lookup · 4385a84c
      Samuel Thibault authored
      cbb59d17 ('Braille: Fix typing quickly') broke the default lookup that
      translates Braille keysym patterns to Braille Unicode patterns since it
      rightfully clears brl_committing, but then we do not have it any more to
      fill brl_committed.
      
      This change saves the committed pattern so we can return it in the
      default lookup.
      Signed-off-by: Samuel Thibault's avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
      4385a84c
  18. 25 Apr, 2020 4 commits
  19. 22 Apr, 2020 2 commits
  20. 29 Jan, 2020 1 commit
    • Adam Jackson's avatar
      Fix XTS regression in XCopyColormapAndFree · 68c72a73
      Adam Jackson authored
      XCopyColormapAndFree/5 threw an assertion:
      
          520|4 5 00014017 1 2|Assertion XCopyColormapAndFree-5.(A)
          520|4 5 00014017 1 3|When a colourmap argument does not name a valid colourmap,
          520|4 5 00014017 1 4|then a BadColor error occurs.
          520|4 5 00014017 1 5|METH: Create a bad colourmap by creating and freeing a colourmap.
          520|4 5 00014017 1 6|METH: Call test function using bad colourmap as the colourmap argument.
          520|4 5 00014017 1 7|METH: Verify that a BadColor error occurs.
          520|4 5 00014017 1 8|unexpected signal 6 (SIGABRT) received
          220|4 5 2 15:05:53|UNRESOLVED
          410|4 5 1 15:05:53|IC End
          510|4|system 0: Abandoning testset: caught unexpected signal 11 (SIGSEGV)
      
      More specifically:
      
          lt-XCopyColormapAndFree: xcb_io.c:533: _XAllocID: Assertion `ret != inval_id' failed.
      
      This bug was introduced (by following my advice, d'oh) in:
      
          commit 99a2cf1a
          Author: Tapani Pälli <tapani.palli@intel.com>
          Date:   Mon May 13 08:29:49 2019 +0300
      
              Protect colormap add/removal with display lock
      
      In that patch we moved the call to _XcmsCopyCmapRecAndFree inside the
      display lock. The problem is said routine has side effects, including
      trying to implicitly create a colormap in some cases. Since we don't run
      the XID handler until SyncHandle() we would see inconsistent internal
      xlib state, triggering the above assert.
      
      Fix this by dropping and re-taking the display lock before calling into
      XCMS.
      Reviewed-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
      68c72a73
  21. 01 Jan, 2020 1 commit
  22. 22 Dec, 2019 1 commit
    • Peter Hutterer's avatar
      Handle ssharp in XConvertCase() · a48787d3
      Peter Hutterer authored
      lowercase: LATIN SMALL LETTER SHARP S (U+00DF)
      uppercase: LATIN CAPITAL LETTER SHARP S (U+1E9E)
      
      The uppercase sharp s (XK_ssharp) is a relatively recent addition to unicode
      but was added to the relevant keyboard layouts in xkeyboard-config-2.25
      (d1411e5e95c)
      xkeyboard-config/xkeyboard-config#144
      
      Alas, the CapsLock behavior was broken on the finnish layout (maybe others).
      This was due to xkbcomp using XConvertCase() to determine whether a key
      requires the type FOUR_LEVEL_ALPHABETIC or FOUR_LEVEL_SEMIALPHABETIC.
      
      Let's make this function return the right lower/upper symbols for the sharp s
      and hope that the world won't get any worse because of it.
      
      #110Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      a48787d3
  23. 09 Oct, 2019 2 commits