[Xcb-commit] 6 commits - src

Julien Danjou jdanjou at kemper.freedesktop.org
Thu Aug 28 04:50:57 PDT 2008


 src/c_client.py |    2 +-
 src/xcb_auth.c  |    2 +-
 src/xcb_conn.c  |    4 ++--
 src/xcb_ext.c   |    8 ++++----
 src/xcb_in.c    |    2 +-
 src/xcb_out.c   |   10 +++++-----
 6 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 38d5de3a5573b2e89e97d04a809a3dd38a0fe8a7
Author: Julien Danjou <julien at danjou.info>
Date:   Wed Aug 27 13:56:28 2008 +0200

    Set namelen unsigned
    
    Signed-off-by: Julien Danjou <julien at danjou.info>

diff --git a/src/xcb_auth.c b/src/xcb_auth.c
index 3f24690..b44855e 100644
--- a/src/xcb_auth.c
+++ b/src/xcb_auth.c
@@ -68,7 +68,7 @@ static size_t memdup(char **dst, void *src, size_t len)
     return len;
 }
 
-static int authname_match(enum auth_protos kind, char *name, int namelen)
+static int authname_match(enum auth_protos kind, char *name, size_t namelen)
 {
     if(strlen(authnames[kind]) != namelen)
 	return 0;
commit 9c9c09b376fe1ddcedd03c52cfc0b06867d998c9
Author: Julien Danjou <julien at danjou.info>
Date:   Wed Aug 27 13:56:26 2008 +0200

    Rename index to idx to avoid shadowing
    
    Signed-off-by: Julien Danjou <julien at danjou.info>

diff --git a/src/xcb_ext.c b/src/xcb_ext.c
index 12cb164..68bb29b 100644
--- a/src/xcb_ext.c
+++ b/src/xcb_ext.c
@@ -40,11 +40,11 @@ typedef struct lazyreply {
     } value;
 } lazyreply;
 
-static lazyreply *get_index(xcb_connection_t *c, int index)
+static lazyreply *get_index(xcb_connection_t *c, int idx)
 {
-    if(index > c->ext.extensions_size)
+    if(idx > c->ext.extensions_size)
     {
-        int new_size = index << 1;
+        int new_size = idx << 1;
         lazyreply *new_extensions = realloc(c->ext.extensions, sizeof(lazyreply) * new_size);
         if(!new_extensions)
             return 0;
@@ -52,7 +52,7 @@ static lazyreply *get_index(xcb_connection_t *c, int index)
         c->ext.extensions = new_extensions;
         c->ext.extensions_size = new_size;
     }
-    return c->ext.extensions + index - 1;
+    return c->ext.extensions + idx - 1;
 }
 
 static lazyreply *get_lazyreply(xcb_connection_t *c, xcb_extension_t *ext)
commit c5b2e53abf0b113d4cc4105127cf848ee450aa98
Author: Julien Danjou <julien at danjou.info>
Date:   Wed Aug 27 13:56:25 2008 +0200

    Use a signed size in read_block()
    
    Signed-off-by: Julien Danjou <julien at danjou.info>

diff --git a/src/xcb_in.c b/src/xcb_in.c
index 31a1e60..1d029af 100644
--- a/src/xcb_in.c
+++ b/src/xcb_in.c
@@ -252,7 +252,7 @@ static void free_reply_list(struct reply_list *head)
     }
 }
 
-static int read_block(const int fd, void *buf, const size_t len)
+static int read_block(const int fd, void *buf, const ssize_t len)
 {
     int done = 0;
     while(done < len)
commit 1bbdba52116f127bed3ce812a00240b4009bbf22
Author: Julien Danjou <julien at danjou.info>
Date:   Wed Aug 27 13:56:24 2008 +0200

    Use unsigned to compare and rename sync
    
    - i must be unsigned to be compare in the loop
    - sync shadow global sync() function
    
    Signed-off-by: Julien Danjou <julien at danjou.info>

diff --git a/src/xcb_out.c b/src/xcb_out.c
index 60226e5..000b121 100644
--- a/src/xcb_out.c
+++ b/src/xcb_out.c
@@ -111,7 +111,7 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect
             uint16_t len;
         } fields;
         uint32_t packet;
-    } sync = { { /* GetInputFocus */ 43, 0, 1 } };
+    } sync_req = { { /* GetInputFocus */ 43, 0, 1 } };
     unsigned int request;
     uint32_t prefix[3] = { 0 };
     int veclen = req->count;
@@ -127,7 +127,7 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect
     if(!(flags & XCB_REQUEST_RAW))
     {
         static const char pad[3];
-        int i;
+        unsigned int i;
         uint16_t shortlen = 0;
         size_t longlen = 0;
         assert(vector[0].iov_len >= 4);
@@ -193,16 +193,16 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect
         _xcb_wait_io(c, &c->out.cond);
 
     request = ++c->out.request;
-    /* send GetInputFocus (sync) when 64k-2 requests have been sent without
+    /* send GetInputFocus (sync_req) when 64k-2 requests have been sent without
      * a reply.
-     * Also send sync (could use NoOp) at 32-bit wrap to avoid having
+     * Also send sync_req (could use NoOp) at 32-bit wrap to avoid having
      * applications see sequence 0 as that is used to indicate
      * an error in sending the request */
     while((req->isvoid &&
 	c->out.request == c->in.request_expected + (1 << 16) - 1) ||
        request == 0)
     {
-        prefix[0] = sync.packet;
+        prefix[0] = sync_req.packet;
         _xcb_in_expect_reply(c, request, WORKAROUND_NONE, XCB_REQUEST_DISCARD_REPLY);
         c->in.request_expected = c->out.request;
 	request = ++c->out.request;
commit 6438584285de72858f97be891e16a125d13471d8
Author: Julien Danjou <julien at danjou.info>
Date:   Wed Aug 27 13:56:23 2008 +0200

    Fix htonl() arg & convert sizeof() to signed
    
    Signed-off-by: Julien Danjou <julien at danjou.info>

diff --git a/src/xcb_conn.c b/src/xcb_conn.c
index e7856c3..02f60bd 100644
--- a/src/xcb_conn.c
+++ b/src/xcb_conn.c
@@ -80,7 +80,7 @@ static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info)
     xcb_setup_request_t out;
     struct iovec parts[6];
     int count = 0;
-    int endian = 0x01020304;
+    static const uint32_t endian = 0x01020304;
     int ret;
 
     memset(&out, 0, sizeof(out));
@@ -110,7 +110,7 @@ static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info)
         parts[count].iov_len = XCB_PAD(out.authorization_protocol_data_len);
         parts[count++].iov_base = (char *) pad;
     }
-    assert(count <= sizeof(parts) / sizeof(*parts));
+    assert(count <= (int) (sizeof(parts) / sizeof(*parts)));
 
     _xcb_lock_io(c);
     {
commit 1ead02e88eb9f37757eeb1cc8c762fc48d6d08ee
Author: Julien Danjou <julien at danjou.info>
Date:   Wed Aug 27 13:56:22 2008 +0200

    initialize global_id to 0
    
    Signed-off-by: Julien Danjou <julien at danjou.info>

diff --git a/src/c_client.py b/src/c_client.py
index 19c8015..1c6ad16 100755
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -183,7 +183,7 @@ def c_open(self):
         _h('extern xcb_extension_t %s;', _ns.c_ext_global_name)
 
         _c('')
-        _c('xcb_extension_t %s = { "%s" };', _ns.c_ext_global_name, _ns.ext_xname)
+        _c('xcb_extension_t %s = { "%s", 0 };', _ns.c_ext_global_name, _ns.ext_xname)
 
 def c_close(self):
     '''


More information about the xcb-commit mailing list