[Xcb] [PATCH] Fix htonl() arg & convert sizeof() to signed

Barton C Massey bart at cs.pdx.edu
Wed Aug 27 09:31:29 PDT 2008


In practice it doesn't actually make much difference here,
but strictly speaking count should be made unsigned rather
than the other way around.

	Bart

In message <1219838188-8908-2-git-send-email-julien at danjou.info> you wrote:
> Signed-off-by: Julien Danjou <julien at danjou.info>
> ---
>  src/xcb_conn.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> 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);
>      {
> -- 
> 1.5.6.3
> 
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb


More information about the Xcb mailing list