1. 15 Dec, 2017 5 commits
  2. 14 Dec, 2017 7 commits
    • Mike Gabriel's avatar
      Xserver/GL/glx/glxcmds.c: Cast small-int values through intptr_t when passed as pointers · 8bb1579f
      Mike Gabriel authored
       Picked from this X.org commit:
      
       commit b0dd6be2c8703f7062d45ac9fd646550c7d54e3b
       Author: Jamey Sharp <jamey@minilop.net>
       Date:   Thu Oct 8 13:38:44 2009 +1100
      
          Cast small-int values through intptr_t when passed as pointers
      
          On 64-bit systems, int and pointers don't have the same size, so GCC gives
          warnings about casts between int and pointer types. However, in the cases
          covered by this patch, it's always a value that fits in int being stored
          temporarily as a pointer and then converted back later, which is safe.
          Casting through the pointer-sized integer type intptr_t convinces the
          compiler that this is OK.
      Signed-off-by: 's avatarJamey Sharp <jamey@minilop.net>
      Signed-off-by: 's avatarDaniel Stone <daniel@fooishbar.org>
      Backported-to-NX-by: 's avatarMike Gabriel <mike.gabriel@das-netzwerkteam.de>
       (Only appropriate location for backporting: Xserver/GL/glx/glxcmds.c).
      8bb1579f
    • Mike Gabriel's avatar
      glx: warning fixes · a6ffabda
      Mike Gabriel authored
       commit 63ccaec2c39f4b5742383472c951ee2cd35c9e14
       Author: Adam Jackson <ajax@redhat.com>
       Date:   Tue Oct 19 11:59:23 2010 -0400
      
          render2.c: In function ‘__glXDisp_Map2d’:
          render2.c:127: warning: ‘u1’ may be used uninitialized in this function
          render2.c: In function ‘__glXDisp_Map1d’:
          render2.c:90: warning: ‘u1’ may be used uninitialized in this function
      
          Remove unnecessary test, and change memcpy to memmove as all users were
          doing overlapping copies.
      Signed-off-by: 's avatarAdam Jackson <ajax@redhat.com>
      Reviewed-by: 's avatarDaniel Stone <daniel@fooishbar.org>
      Backported-to-NX-by: 's avatarMike Gabriel <mike.gabriel@das-netzwerkteam.de>
      a6ffabda
    • Mike Gabriel's avatar
      Xserver/GL/glx/glxfb.c: Fix compiler warning: pointer-sign. · 16fbdb2a
      Mike Gabriel authored
       glxfb.c: In function '__glXFBMemSwapBuffers':
       glxfb.c:117:5: warning: pointer targets in passing argument 10 of 'pGC->ops->PutImage' differ in signedness [-Wpointer-sign]
            buf);
            ^~~
       glxfb.c:117:5: note: expected 'char *' but argument is of type 'GLubyte * {aka unsigned char *}'
      16fbdb2a
    • Mike Gabriel's avatar
      hw/nxagent/Events.c: Fix compiler warnings (with NX_DEBUG_INPUT): format. · a2741452
      Mike Gabriel authored
       Events.c: In function 'nxagentDumpInputDevicesState':
       Events.c:4662:58: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'DeviceIntPtr {aka struct _DeviceIntRec *}' [-Wformat=]
          fprintf(stderr, "\nKeyboard device state: \n\tdevice [%p]\n\tlast grab time [%lu]"
                                                                 ^
       Events.c:4662:82: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'CARD32 {aka unsigned int}' [-Wformat=]
          fprintf(stderr, "\nKeyboard device state: \n\tdevice [%p]\n\tlast grab time [%lu]"
                                                                                        ^
       Events.c:4662:19: warning: format '%p' expects argument of type 'void *', but argument 7 has type 'GrabPtr {aka struct _GrabRec *}' [-Wformat=]
          fprintf(stderr, "\nKeyboard device state: \n\tdevice [%p]\n\tlast grab time [%lu]"
                          ^
       Events.c:4675:66: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'WindowPtr {aka struct _Window *}' [-Wformat=]
            fprintf(stderr, "\nKeyboard grab state: \n\twindow pointer [%p]"
                                                                         ^
       Events.c:4689:59: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'DeviceIntPtr {aka struct _DeviceIntRec *}' [-Wformat=]
              fprintf(stderr, "\nPassive grab state: \n\tdevice [%p]\n\towner events flag [%s]"
                                                                  ^
       Events.c:4689:23: warning: format '%lx' expects argument of type 'long unsigned int', but argument 10 has type 'Mask {aka unsigned int}' [-Wformat=]
              fprintf(stderr, "\nPassive grab state: \n\tdevice [%p]\n\towner events flag [%s]"
                              ^
       Events.c:4722:57: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'DeviceIntPtr {aka struct _DeviceIntRec *}' [-Wformat=]
          fprintf(stderr, "\nPointer device state: \n\tdevice [%p]\n\tlast grab time [%lu]"
                                                                ^
       Events.c:4722:81: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'CARD32 {aka unsigned int}' [-Wformat=]
          fprintf(stderr, "\nPointer device state: \n\tdevice [%p]\n\tlast grab time [%lu]"
                                                                                        ^
       Events.c:4722:19: warning: format '%p' expects argument of type 'void *', but argument 7 has type 'GrabPtr {aka struct _GrabRec *}' [-Wformat=]
          fprintf(stderr, "\nPointer device state: \n\tdevice [%p]\n\tlast grab time [%lu]"
                          ^
       Events.c:4735:65: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'WindowPtr {aka struct _Window *}' [-Wformat=]
            fprintf(stderr, "\nPointer grab state: \n\twindow pointer [%p]"
                                                                        ^
       Events.c:4750:61: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'DeviceIntPtr {aka struct _DeviceIntRec *}' [-Wformat=]
                fprintf(stderr, "\nPassive grab state: \n\tdevice [%p]\n\towner events flag [%s]"
                                                                    ^
       Events.c:4750:25: warning: format '%lx' expects argument of type 'long unsigned int', but argument 10 has type 'Mask {aka unsigned int}' [-Wformat=]
                fprintf(stderr, "\nPassive grab state: \n\tdevice [%p]\n\towner events flag [%s]"
                                ^
      a2741452
    • Mike Gabriel's avatar
      hw/nxagent/NXxvdisp.c: Fix compiler warnings: misleading-indentation · 7aed70f1
      Mike Gabriel authored
       NXxvdisp.c: In function 'ProcXvDispatch':
       NXxvdisp.c:96:9: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
                else
                ^~~~
       NXxvdisp.c:99:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
                    break;
                    ^~~~~
       NXxvdisp.c:104:9: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
                else
                ^~~~
       NXxvdisp.c:107:10: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
                 break;
                 ^~~~~
       NXxvdisp.c:118:2: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
         else
         ^~~~
       NXxvdisp.c:121:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
                    break;
                    ^~~~~
       NXxvdisp.c:126:2: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
         else
         ^~~~
       NXxvdisp.c:129:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
                    break;
                    ^~~~~
       NXxvdisp.c:137:2: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
         else
         ^~~~
       NXxvdisp.c:140:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
                    break;
                    ^~~~~
       NXxvdisp.c:146:2: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
         else
         ^~~~
       NXxvdisp.c:149:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
             break;
             ^~~~~
      7aed70f1
    • Mike Gabriel's avatar
      hw/nxagent/NXdispatch.c: Fix compiler warning: misleading-indentation · 72152baf
      Mike Gabriel authored
       NXdispatch.c: In function 'Dispatch':
       NXdispatch.c:309:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
           if (!(dispatchException & DE_TERMINATE))
           ^~
       NXdispatch.c:312:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
             while (!dispatchException)
             ^~~~~
      72152baf
    • Mike Gabriel's avatar
      Xserver/Xi/chgfctl.c: Fix compiler warning: misleading-indentation. · 6d98e538
      Mike Gabriel authored
       chgfctl.c: In function 'ChangeKbdFeedback':
       chgfctl.c:359:6: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
             else
             ^~~~
       chgfctl.c:361:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
          kctrl.autoRepeats[inx] =
          ^~~~~
      6d98e538
  3. 13 Dec, 2017 18 commits
  4. 11 Dec, 2017 2 commits
    • Mike Gabriel's avatar
      Xserver/os/xprintf.c: Drop NoMachine's own implementation of Xvasprintf(). Use… · cf2e0765
      Mike Gabriel authored
      Xserver/os/xprintf.c: Drop NoMachine's own implementation of Xvasprintf(). Use stock implementation instead.
      
       * Reason from NoMachine's NX CHANGELOG for having its own implementation
         of Xvasprintf() (from around nxagent 3.3.0):
      
          - Fixed TR06G02225. The implementation of Xvprintf() has been reviewed
            to work on more platforms. Previous implementation caused a failure
            in the build of keyboard map on some platform like Solaris 8 and 9.
          - Fixed TR03G02198. Reimplemented Xvprintf() in Xserver/os to handle
            the case in which vsnprintf returned -1.
      
       * Reason for removing it again:
      
          - Fixes segfaults in SetDefaultFontPath when launching nxagent.
          - All locations in Xserver/** using the code check for return value
            of -1.
          - Solaris 8 and 9 are beyond of our support scope.
          - Keep more in sync with X.org.
          - Good moment to drop more GPL-2 code from Xserver's code base.
      cf2e0765
    • Mihai Moldovan's avatar
      nx-X11/programs/Xserver/os/xprintf.c: remove doubly-defined Xscnprintf function,… · c31cd773
      Mihai Moldovan authored
      nx-X11/programs/Xserver/os/xprintf.c: remove doubly-defined Xscnprintf function, add missing header includes.
      
      Fix up for 1e3a9748, which has been
      faulty in this regard.
      c31cd773
  5. 10 Dec, 2017 3 commits
    • Daniel Kurtz's avatar
      os/xprintf: add Xvscnprintf and Xscnprintf · a6e632aa
      Daniel Kurtz authored
      Backported from X.org:
      
      commit 5c2e2a164d615ab06be28a663734e782614b5cc7
      Author: Daniel Kurtz <djkurtz@chromium.org>
      Date:   Wed Apr 18 09:51:51 2012 +0000
      
          os/xprintf: add Xvscnprintf and Xscnprintf
      
          Normal snprintf() usually returns the number of bytes that would have been
          written into a buffer had the buffer been long enough.
      
          The scnprintf() variants return the actual number of bytes written,
          excluding the trailing '\0'.
      Signed-off-by: 's avatarDaniel Kurtz <djkurtz@chromium.org>
      Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Backported-to-NX-by: 's avatarMihai Moldovan <ionic@ionic.de>
      a6e632aa
    • Colin Harrison's avatar
      Typo in xserver Xvasprintf() · c281c6e0
      Colin Harrison authored
      Backported from X.org:
      
      commit 1324b0ca9f8a7fdaf03b374c75eb3c9df407c2f1
      Author: Colin Harrison <colin.harrison@virgin.net>
      Date:   Fri Dec 10 00:08:24 2010 +0000
      
          Typo in xserver Xvasprintf()
      
          I needed this patch in the wrapper around vsnprintf() in os/xprintf.c
          (MinGW for Windows build) to correct various crashes.
      Reviewed-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Backported-to-NX-by: 's avatarMihai Moldovan <ionic@ionic.de>
      c281c6e0
    • Alan Coopersmith's avatar
      Add asprintf() implementation for platforms without it · 1e3a9748
      Alan Coopersmith authored
      Backported from X.org:
      
      commit c95c1d338fdb62dbe3dba934b97324fa778b7fce
      Author: Alan Coopersmith <alan.coopersmith@oracle.com>
      Date:   Sat Nov 27 18:43:12 2010 -0800
      
          Add asprintf() implementation for platforms without it
      
          Provides a portable implementation of this common allocating sprintf()
          API found in many, but not yet all, of the platforms we support.
          If the platform provides vasprintf() we simply wrap it, otherwise we
          implement it - either way callers can use it regardless of platform.
      
          Since not all platforms guarantee to NULL out the return pointer on
          failure, we don't either, and require callers to check the return
          value for -1.
      
          The old Xprintf() API is deprecated, but left for compatibility for now.
      
          The new API is added in a new header so that it can be used in parts of
          the server such as hw/xfree86/parser that don't include all the server
          headers.
      Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Reviewed-by: 's avatarMikhail Gusarov <dottedmag@dottedmag.net>
      
      Includes re-indentation changes from
      9838b7032ea9792bec21af424c53c07078636d21.
      Backported-to-NX-by: 's avatarMihai Moldovan <ionic@ionic.de>
      1e3a9748
  6. 07 Dec, 2017 5 commits