1. 19 Oct, 2015 5 commits
    • Jeremy Huddleston's avatar
      security: Silence some benign -Wformat warnings · a7a00e4b
      Jeremy Huddleston authored
      XID may be either 'unsigned long' or 'unsigned int' depending on:
      
      typedef unsigned long CARD64;
      typedef unsigned int CARD32;
      typedef unsigned long long CARD64;
      typedef unsigned long CARD32;
      
      typedef unsigned long XID;
      typedef CARD32 XID;
      
      so when building with -Wformat, we get some warnings that are benign.  This silences them.
      
      security.c:215:52: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
          SecurityAudit("revoked authorization ID %d\n", pAuth->id);
                                                  ~~     ^~~~~~~~~
                                                  %lu
        CC       dpmsstubs.lo
      security.c:553:25: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
               client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
                              ^~~~~~~~~
      security.c:553:55: warning: format specifies type 'int' but the argument has type 'CARD32' (aka 'unsigned long')
            [-Wformat,Format String Issue]
               client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
                                                            ^~~~~~~~~~~~~~
      security.c:554:10: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
               pAuth->group, eventMask);
               ^~~~~~~~~~~~
      security.c:554:24: warning: format specifies type 'int' but the argument has type 'Mask' (aka 'unsigned long')
            [-Wformat,Format String Issue]
               pAuth->group, eventMask);
                             ^~~~~~~~~
      security.c:781:19: warning: format specifies type 'unsigned int' but the argument has type 'Mask' (aka 'unsigned
      long')
            [-Wformat,Format String Issue]
                        requested, rec->id, cid,
                        ^~~~~~~~~
      security.c:781:30: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
                        requested, rec->id, cid,
                                   ^~~~~~~
      security.c:863:23: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
                            rec->pWin->drawable.id, wClient(rec->pWin)->index,
                            ^~~~~~~~~~~~~~~~~~~~~~
      security.c:893:31: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
                                    rec->pWin->drawable.id,
                                    ^~~~~~~~~~~~~~~~~~~~~~
      security.c:915:39: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
                        rec->client->index, rec->pWin->drawable.id,
                                            ^~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      a7a00e4b
    • Jeremy Huddleston's avatar
      xres: Silence -Wunused-function warnings when building !COMPOSITE or !RENDER · aa73d587
      Jeremy Huddleston authored
      xres.c:422:1: warning: unused function 'ResFindCompositeClientWindowPixmaps' [-Wunused-function,Unused Entity Issue]
      ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata)
      ^
      Signed-off-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      aa73d587
    • Jeremy Huddleston's avatar
      xdmauth: Correct miscall of abs() to instrad call labs() · 85eb90ea
      Jeremy Huddleston authored
      xdmauth.c:230:13: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of
      type
      'int'
            which may cause truncation of value [-Wabsolute-value,Semantic Issue]
              if (abs(now - client->time) > TwentyFiveMinutes) {
                  ^
      xdmauth.c:230:13: note: use function 'labs' instead [Semantic Issue]
              if (abs(now - client->time) > TwentyFiveMinutes) {
                  ^~~
                  labs
      xdmauth.c:302:9: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type
      'int' which
            may cause truncation of value [-Wabsolute-value,Semantic Issue]
          if (abs(client->time - now) > TwentyMinutes) {
              ^
      xdmauth.c:302:9: note: use function 'labs' instead [Semantic Issue]
          if (abs(client->time - now) > TwentyMinutes) {
              ^~~
              labs
      Signed-off-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      85eb90ea
    • Jeremy Huddleston's avatar
      randr: Correct a miscall of abs() to instead call fabs() · 9f0fcd14
      Jeremy Huddleston authored
      rrtransform.c:124:22: warning: using integer absolute value function 'abs' when
            argument is of floating point type [-Wabsolute-value,Semantic Issue]
                  if ((v = abs(f_transform->m[j][i])) > max)
                           ^
      rrtransform.c:124:22: note: use function 'fabs' instead [Semantic Issue]
                  if ((v = abs(f_transform->m[j][i])) > max)
                           ^~~
                           fabs
      Signed-off-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      9f0fcd14
    • Jeremy Huddleston's avatar
      mi: Correct a miscall of abs() to instead call fabs() · 610dd8a5
      Jeremy Huddleston authored
      miarc.c:1714:9: warning: using integer absolute value function
      'abs' when
            argument is of floating point type [-Wabsolute-value,Semantic Issue]
          if (abs(parc->angle2) >= 360.0)
              ^
      miarc.c:1714:9: note: use function 'fabs' instead [Semantic Issue]
          if (abs(parc->angle2) >= 360.0)
              ^~~
              fabs
      Signed-off-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      610dd8a5
  2. 13 Oct, 2015 2 commits
    • Ken Thomases's avatar
      XQuartz: Fix how we calculate the height of the OSX menu bar · 4513f924
      Ken Thomases authored
      +[NSScreen mainScreen] does not mean the primary display.  It used to mean the
      one with the key window.  When "Displays have separate spaces" is enabled, it
      means the active screen, the one whose menu bar is mostly opaque.  As such, it
      may not be the screen whose lower-left corner is located at (0, 0).  That's
      why its max-Y is not necessarily comparable to its height.  That only works
      for the primary display.
      
      This code could use [[NSScreen screens] firstObject].  This is always the
      primary display, the one whose lower-left corner is at (0, 0).
      
      Once that's done, the above change should be reverted.  The height of the
      visible frame would be the full height of the screen minus the menu bar _and
      the Dock_ if the Dock is along the bottom of the screen.
      
      Actually, there's a theoretically-simpler approach: use
      -[NSMenu menuBarHeight].  That replaces a long-deprecated method
      +[NSMenuView menuBarHeight].  However, there was a bug in Tiger that led to
      the former not working while the latter still worked. I haven't actually
      checked recently.
      
      CrossOver's still-kicking X server code uses this code, which tries all of
      the above:
      
             NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0];
             aquaMenuBarHeight = [[NSApp mainMenu] menuBarHeight];
             if (!aquaMenuBarHeight) aquaMenuBarHeight = [NSMenuView menuBarHeight];
             if (!aquaMenuBarHeight) aquaMenuBarHeight =
                 NSHeight([primaryScreen frame]) - NSMaxY([primaryScreen visibleFrame]);
      Reviewed-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Signed-off-by: default avatarKen Thomases <ken@codeweavers.com>
      4513f924
    • Jeremy Huddleston Sequoia's avatar
  3. 12 Oct, 2015 1 commit
  4. 07 Oct, 2015 2 commits
  5. 06 Oct, 2015 5 commits
  6. 05 Oct, 2015 1 commit
  7. 30 Sep, 2015 2 commits
  8. 29 Sep, 2015 5 commits
  9. 25 Sep, 2015 9 commits
  10. 24 Sep, 2015 7 commits
  11. 23 Sep, 2015 1 commit