[X2Go-Commits] [x2gokdrive] 01/04: x2gokdrive{remote, selection}.c: wrap initializer into another set of curly braces until the first POD is reached.

git-admin at x2go.org git-admin at x2go.org
Thu Oct 31 03:47:49 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gokdrive.

commit e816d4d29dd00352166577e3281bcdffd1ee5c2e
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Oct 31 03:25:05 2019 +0100

    x2gokdrive{remote,selection}.c: wrap initializer into another set of curly braces until the first POD is reached.
    
    Fixes compile errors on EPEL 7 and generally systems with older GCC
    versions.
    
    That warning, which is turned into an error later on, is generally
    overly strict, since {0} is widely used as an "universal zero
    initializer" in C, initializing all other elements that are not
    explicitly given in the list implicitly with zero.
    
    For some reason, GCC decided that it is an error to initialize a whole
    struct that way and explicitly requires that at least one plain-old-data
    type is initialized that way.
    
    Case in point, newer GCC versions removed that warning altogether and
    just blindly accepts the usual syntax.
---
 debian/changelog      | 11 +++++++++++
 x2gokdriveremote.c    |  6 +++---
 x2gokdriveselection.c |  4 ++--
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7b934e0..9e3e451 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,17 @@ x2gokdrive (0.0.0.1-0x2go1) UNRELEASED; urgency=medium
     - patches.xorg/1.19.2/xorg-server-configure-ac.patch: backport
       XORG_VERSION_CURRENT change from
       e0dbca73f11e9aa7a066e748e6d08ba256be69cf / 1.20.5.
+    - x2gokdrive{remote,selection}.c: warp initializer into another set of
+      curly braces until the first POD is reached. Fixes compile errors on
+      EPEL 7 and generally systems with older GCC versions. That warning,
+      which is turned into an error later on, is generally overly strict,
+      since {0} is widely used as an "universal zero initializer" in C,
+      initializing all other elements that are not explicitly given in the
+      list implicitly with zero. For some reason, GCC decided that it is an
+      error to initialize a whole struct that way and explicitly requires that
+      at least one plain-old-data type is initialized that way. Case in point,
+      newer GCC versions removed that warning altogether and just blindly
+      accepts the usual syntax.
   * debian/control:
     + Grammar fix.
     + Remove dependencies that refer to disabled features.
diff --git a/x2gokdriveremote.c b/x2gokdriveremote.c
index 4b9cbff..7ed24cd 100644
--- a/x2gokdriveremote.c
+++ b/x2gokdriveremote.c
@@ -1279,7 +1279,7 @@ static
 void sendMainImageFromSendThread(uint32_t width, uint32_t height, int32_t dx ,int32_t dy)
 {
     _X_UNUSED uint32_t length = 0;
-    struct frame_region regions[9] = {0};
+    struct frame_region regions[9] = {{0}};
 
     uint32_t isize = 0;
     unsigned char* data = NULL;
@@ -1980,7 +1980,7 @@ clientReadNotify(int fd, int ready, void *data)
                 {
                     uint16_t width=*((uint16_t*)buff+2);
                     uint16_t height=*((uint16_t*)buff+3);
-                    struct VirtScreen screens[4] = {0};
+                    struct VirtScreen screens[4] = {{0}};
 
                     remoteVars.client_initialized=TRUE;
                     EPHYR_DBG("Client want resize to %dx%d",width,height);
@@ -2660,7 +2660,7 @@ void initFrameRegions(struct cache_elem* frame)
             if(best_match && match_val<=MAX_MATCH_VAL)
             {
 
-                rectangle rect = {0};
+                rectangle rect = {{0}};
                 int hshift, vshift = 0;
 
                 if(find_common_regions(best_match, frame, &diff, &rect, &hshift, &vshift))
diff --git a/x2gokdriveselection.c b/x2gokdriveselection.c
index 11b22a6..5dc8d14 100644
--- a/x2gokdriveselection.c
+++ b/x2gokdriveselection.c
@@ -158,7 +158,7 @@ static int create_selection_window(void)
 
 static void request_selection(Atom selection, Atom rtype)
 {
-    xEvent ev = {0};
+    xEvent ev = {{0}};
     Selection *selPtr = NULL;
     int rc = -1;
 
@@ -444,7 +444,7 @@ static int convert_selection(ClientPtr client, Atom selection,
     int rc = -1;
 
     Atom realProperty = {0};
-    xEvent event = {0};
+    xEvent event = {{0}};
 
     inputBuffer* buff=&remoteVars->selstruct.inSelection;
     if(selection==atomClipboard)

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gokdrive.git


More information about the x2go-commits mailing list