1. 05 Apr, 2018 9 commits
    • Adam Jackson's avatar
      xkb: Silence some compiler warnings · 83913de2
      Adam Jackson authored
      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>
      83913de2
    • Adam Jackson's avatar
      dmx: Silence a string truncation warning. · d13cd386
      Adam Jackson authored
      ../hw/dmx/config/dmxparse.c: In function ‘dmxConfigCreateOption’:
      ../hw/dmx/config/dmxparse.c:385:13: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
                   strncpy(option->string + offset, p->string, len);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../hw/dmx/config/dmxparse.c:383:23: note: length computed here
                   int len = strlen(p->string);
                             ^~~~~~~~~~~~~~~~~
      
      The thing it's warning about is intentional, the surrounding code does
      its own nul-termination. Make that obvious by using memcpy instead.
      Signed-off-by: 's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: 's avatarKeith Packard <keithp@keithp.com>
      d13cd386
    • Adam Jackson's avatar
      dmx: Clean up some argument parsing code · 176f26e9
      Adam Jackson authored
      This threw:
      
      ../hw/dmx/input/dmxarg.c: In function ‘dmxArgParse’:
      ../hw/dmx/input/dmxarg.c:128:5: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
           strncpy(tmp, string, len);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
      ../hw/dmx/input/dmxarg.c:126:11: note: length computed here
           len = strlen(string) + 2;
                 ^~~~~~~~~~~~~~
      
      This code predates xstrtokenize, but that's no excuse.
      Signed-off-by: 's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: 's avatarKeith Packard <keithp@keithp.com>
      176f26e9
    • Adam Jackson's avatar
      dmx: Fix a read-from-uninitialized warning · be99072a
      Adam Jackson authored
      ../hw/dmx/dmxpixmap.c: In function ‘dmxBitmapToRegion’:
      ../include/regionstr.h:174:22: warning: ‘Box.x1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           (_pReg)->extents = *(_pBox);
           ~~~~~~~~~~~~~~~~~^~~~~~~~~~
      ../hw/dmx/dmxpixmap.c:208:12: note: ‘Box.x1’ was declared here
           BoxRec Box;
                  ^~~
      Signed-off-by: 's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: 's avatarKeith Packard <keithp@keithp.com>
      be99072a
    • Adam Jackson's avatar
      dmx: Fix some snprintf warnings. · c3b190f9
      Adam Jackson authored
      snprintf doesn't terminate the string if it truncates, so things like
      this are lurking crashers:
      
      ../hw/dmx/dmxprop.c: In function ‘dmxPropertyIdentifier.part.0’:
      ../hw/dmx/dmxprop.c:94:36: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 123 [-Wformat-truncation=]
           snprintf(buf, sizeof(buf), "%s:%s:%s", DMX_IDENT, hostname, display);
                                          ^~                 ~~~~~~~~
      ../hw/dmx/dmxprop.c:94:5: note: ‘snprintf’ output 7 or more bytes (assuming 262) into a destination of size 128
           snprintf(buf, sizeof(buf), "%s:%s:%s", DMX_IDENT, hostname, display);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../hw/dmx/dmxprop.c: In function ‘dmxPropertyWindow’:
      ../hw/dmx/dmxprop.c:372:36: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size between 0 and 127 [-Wformat-truncation=]
           snprintf(buf, sizeof(buf), "%s,%d", id, dmxScreen->index);
                                          ^~
      ../hw/dmx/dmxprop.c:372:5: note: ‘snprintf’ output between 3 and 140 bytes into a destination of size 128
           snprintf(buf, sizeof(buf), "%s,%d", id, dmxScreen->index);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      We could be more precise about termination, but meh.
      Signed-off-by: 's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: 's avatarKeith Packard <keithp@keithp.com>
      c3b190f9
    • Adam Jackson's avatar
      gtf: Warning fix · 4c145339
      Adam Jackson authored
      ../hw/xfree86/utils/gtf/gtf.c: In function ‘print_fb_mode’:
      ../hw/xfree86/utils/gtf/gtf.c:241:50: warning: cast from function call of type ‘double’ to non-matching type ‘int’ [-Wbad-function-cast]
           printf("    timings %d %d %d %d %d %d %d\n", (int) rint(1000000.0 / m->pclk),       /* pixclock in picoseconds */
      
      That's pretty nitpicky of you, gcc, but at least it's easy to fix.
      Signed-off-by: 's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: 's avatarKeith Packard <keithp@keithp.com>
      4c145339
    • Daniel Stone's avatar
      modesetting: Actually get framebuffer ID · 99f9b077
      Daniel Stone authored
      We would fail to get the FB ID if it wasn't already imported, since we
      were checking to see if the pointer was NULL (it never was) rather than
      if the content of the pointer was 0.
      Signed-off-by: 's avatarDaniel Stone <daniels@collabora.com>
      Reported-by: 's avatarOlivier Fourdan <ofourdan@redhat.com>
      Tested-by: 's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: 's avatarOlivier Fourdan <ofourdan@redhat.com>
      99f9b077
    • Daniel Stone's avatar
      dri3: Set stride and size for old clients · 8ff1cdb2
      Daniel Stone authored
      For old clients using the fd_from_pixmap entrypoint, make sure we set
      stride and size correctly.
      
      Noticed by inspection.
      Signed-off-by: 's avatarDaniel Stone <daniels@collabora.com>
      8ff1cdb2
    • Daniel Stone's avatar
      modesetting: Don't reuse iterator in nested loop · 78574a66
      Daniel Stone authored
      drmmode_crtc_set_mode has a loop nested inside another loop, where both
      of them were using 'i' as the loop iterator. Rename it to avoid an
      infinite loop.
      Signed-off-by: 's avatarDaniel Stone <daniels@collabora.com>
      Reported-by: 's avatarMichel Dänzer <michel.daenzer@amd.com>
      Reviewed-and-Tested-by: 's avatarMichel Dänzer <michel.daenzer@amd.com>
      Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
      78574a66
  2. 04 Apr, 2018 10 commits
  3. 03 Apr, 2018 1 commit
  4. 02 Apr, 2018 11 commits
  5. 28 Mar, 2018 9 commits