Skip to content
Snippets Groups Projects
  1. Apr 10, 2018
  2. Apr 09, 2018
  3. Apr 06, 2018
  4. Apr 05, 2018
    • Adam Jackson's avatar
      xwayland: Silence a build warning if we can · 74aef564
      Adam Jackson authored
      
      [735/786] Generating 'hw/xwayland/Xwayland@exe/relative-pointer-unstable-v1-protocol.c'.
      Using "code" is deprecated - use private-code or public-code.
      See the help page for details.
      
      Use private-code if wayland-scanner is new enough.
      
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      74aef564
    • Adam Jackson's avatar
      dix: Hush an almost certainly bogus warning · 6f0903dd
      Adam Jackson authored
      
      ../dix/getevents.c: In function ‘transformAbsolute’:
      ../dix/getevents.c:1195:28: warning: ‘oy’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           struct pixman_f_vector p = {.v = {*x, *y, 1} };
                                  ^
      ../dix/getevents.c:1234:22: note: ‘oy’ was declared here
           double x, y, ox, oy;
                            ^~
      
      This one is truly special. Even though both ox and oy are set and read
      along the same paths, only oy is marked for this warning! Initializing
      just oy = 0.0 fixes it entirely, but let's not make a weird thing
      weirder.
      
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: default avatarKeith Packard <keithp@keithp.com>
      6f0903dd
    • Adam Jackson's avatar
      mi: Hush an almost certainly bogus warning · 57e87230
      Adam Jackson authored
      
      In file included from ../mi/miexpose.c:83:
      ../mi/miexpose.c: In function ‘miHandleExposures’:
      ../include/regionstr.h:174:22: warning: ‘expBox.y2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           (_pReg)->extents = *(_pBox);
           ~~~~~~~~~~~~~~~~~^~~~~~~~~~
      ../mi/miexpose.c:139:12: note: ‘expBox.y2’ was declared here
           BoxRec expBox;
                  ^~~~~~
      
      etc. It's initialized if (extents), and then only read if (extents),
      but gcc doesn't seem to figure that out. Whatever, bzero it to be
      explicit.
      
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: default avatarKeith Packard <keithp@keithp.com>
      57e87230
    • 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: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: default 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: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: default 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: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: default 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: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: default 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: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: default 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: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Acked-by: default avatarKeith Packard <keithp@keithp.com>
      4c145339
    • Daniel Stone's avatar
      modesetting: Actually get framebuffer ID · 99f9b077
      Daniel Stone authored and Adam Jackson's avatar Adam Jackson committed
      
      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: default avatarDaniel Stone <daniels@collabora.com>
      Reported-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Tested-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      99f9b077
    • Daniel Stone's avatar
      dri3: Set stride and size for old clients · 8ff1cdb2
      Daniel Stone authored and Adam Jackson's avatar Adam Jackson committed
      
      For old clients using the fd_from_pixmap entrypoint, make sure we set
      stride and size correctly.
      
      Noticed by inspection.
      
      Signed-off-by: default avatarDaniel Stone <daniels@collabora.com>
      8ff1cdb2
    • Daniel Stone's avatar
      modesetting: Don't reuse iterator in nested loop · 78574a66
      Daniel Stone authored and Adam Jackson's avatar Adam Jackson committed
      
      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: default avatarDaniel Stone <daniels@collabora.com>
      Reported-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Reviewed-and-Tested-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      78574a66
  5. Apr 04, 2018
  6. Apr 03, 2018
Loading