Merge branch 'master' of git+ssh://git.freedesktop.org/git/xcb
This commit is contained in:
commit
d69c403cba
|
@ -1,20 +1 @@
|
|||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
compile
|
||||
config.guess
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
configure.lineno
|
||||
depcomp
|
||||
install-sh
|
||||
libtool
|
||||
ltmain.sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
*.pc
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
|
|
|
@ -1,14 +1,3 @@
|
|||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
Makefile.in
|
||||
config.h
|
||||
config.h.in
|
||||
stamp-h1
|
||||
*.lo
|
||||
*.loT
|
||||
*.la
|
||||
*.o
|
||||
xproto.c
|
||||
xproto.h
|
||||
xcb_des.c
|
||||
|
@ -16,4 +5,3 @@ xcb_types.c
|
|||
xcb_types.h
|
||||
extensions
|
||||
X11
|
||||
check_all
|
||||
|
|
|
@ -596,13 +596,13 @@ authorization from the authors.
|
|||
mode="assign" />
|
||||
|
||||
<l />
|
||||
<l>xcb_parts[2].iov_base = &xcb_out;</l>
|
||||
<l>xcb_parts[2].iov_base = (char *) &xcb_out;</l>
|
||||
<l>xcb_parts[2].iov_len = sizeof(xcb_out);</l>
|
||||
<l>xcb_parts[3].iov_base = 0;</l>
|
||||
<l>xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;</l>
|
||||
|
||||
<xsl:for-each select="$struct/list">
|
||||
<l>xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_base = (void *) <!--
|
||||
<l>xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_base = (char *) <!--
|
||||
--><xsl:value-of select="@name" />;</l>
|
||||
<l>xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_len = <!--
|
||||
--><xsl:apply-templates mode="output-expression" /><!--
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#ifndef __XCB_H
|
||||
#define __XCB_H
|
||||
#include <sys/types.h>
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/X.h>
|
||||
#include <sys/uio.h>
|
||||
|
|
|
@ -168,7 +168,9 @@ static Xauth *get_authptr(struct sockaddr *sockname, unsigned int socknamelen)
|
|||
case AF_UNIX:
|
||||
/*block*/ {
|
||||
struct sockaddr_un *su = (struct sockaddr_un *) sockname;
|
||||
char *sockbuf = (char *) sockname;
|
||||
assert(sizeof(*su) >= socknamelen);
|
||||
sockbuf[socknamelen] = 0; /* null-terminate path */
|
||||
display = strrchr(su->sun_path, 'X');
|
||||
if (display == 0)
|
||||
return 0; /* sockname is mangled somehow */
|
||||
|
|
|
@ -74,18 +74,18 @@ static int write_setup(XCBConnection *c, XCBAuthInfo *auth_info)
|
|||
parts[count].iov_len = sizeof(XCBConnSetupReq);
|
||||
parts[count++].iov_base = &out;
|
||||
parts[count].iov_len = XCB_PAD(sizeof(XCBConnSetupReq));
|
||||
parts[count++].iov_base = (caddr_t) pad;
|
||||
parts[count++].iov_base = (char *) pad;
|
||||
|
||||
if(auth_info)
|
||||
{
|
||||
parts[count].iov_len = out.authorization_protocol_name_len = auth_info->namelen;
|
||||
parts[count++].iov_base = auth_info->name;
|
||||
parts[count].iov_len = XCB_PAD(out.authorization_protocol_name_len);
|
||||
parts[count++].iov_base = (caddr_t) pad;
|
||||
parts[count++].iov_base = (char *) pad;
|
||||
parts[count].iov_len = out.authorization_protocol_data_len = auth_info->datalen;
|
||||
parts[count++].iov_base = auth_info->data;
|
||||
parts[count].iov_len = XCB_PAD(out.authorization_protocol_data_len);
|
||||
parts[count++].iov_base = (caddr_t) pad;
|
||||
parts[count++].iov_base = (char *) pad;
|
||||
}
|
||||
assert(count <= sizeof(parts) / sizeof(*parts));
|
||||
|
||||
|
|
20
src/xcb_in.c
20
src/xcb_in.c
|
@ -36,6 +36,9 @@
|
|||
#include "xcbext.h"
|
||||
#include "xcbint.h"
|
||||
|
||||
#define XCBError 0
|
||||
#define XCBReply 1
|
||||
|
||||
struct event_list {
|
||||
XCBGenericEvent *event;
|
||||
struct event_list *next;
|
||||
|
@ -85,7 +88,7 @@ static int read_packet(XCBConnection *c)
|
|||
memcpy(&genrep, c->in.queue, sizeof(genrep));
|
||||
|
||||
/* Compute 32-bit sequence number of this packet. */
|
||||
if((genrep.response_type & 0x7f) != KeymapNotify)
|
||||
if((genrep.response_type & 0x7f) != XCBKeymapNotify)
|
||||
{
|
||||
int lastread = c->in.request_read;
|
||||
c->in.request_read = (lastread & 0xffff0000) | genrep.sequence;
|
||||
|
@ -104,7 +107,7 @@ static int read_packet(XCBConnection *c)
|
|||
}
|
||||
c->in.request_completed = c->in.request_read - 1;
|
||||
}
|
||||
if(genrep.response_type != 1) /* not reply: error or event */
|
||||
if(genrep.response_type != XCBReply) /* error or event */
|
||||
c->in.request_completed = c->in.request_read; /* XXX: does event/error imply no more replies? */
|
||||
|
||||
while(c->in.pending_replies && c->in.pending_replies->request <= c->in.request_completed)
|
||||
|
@ -117,7 +120,7 @@ static int read_packet(XCBConnection *c)
|
|||
}
|
||||
}
|
||||
|
||||
if(genrep.response_type == 0 || genrep.response_type == 1)
|
||||
if(genrep.response_type == XCBError || genrep.response_type == XCBReply)
|
||||
{
|
||||
pend = c->in.pending_replies;
|
||||
if(pend && pend->request != c->in.request_read)
|
||||
|
@ -125,7 +128,7 @@ static int read_packet(XCBConnection *c)
|
|||
}
|
||||
|
||||
/* For reply packets, check that the entire packet is available. */
|
||||
if(genrep.response_type == 1)
|
||||
if(genrep.response_type == XCBReply)
|
||||
{
|
||||
if(pend && pend->workaround == WORKAROUND_GLX_GET_FB_CONFIGS_BUG)
|
||||
{
|
||||
|
@ -135,7 +138,7 @@ static int read_packet(XCBConnection *c)
|
|||
length += genrep.length * 4;
|
||||
}
|
||||
|
||||
buf = malloc(length + (genrep.response_type == 1 ? 0 : sizeof(CARD32)));
|
||||
buf = malloc(length + (genrep.response_type == XCBReply ? 0 : sizeof(CARD32)));
|
||||
if(!buf)
|
||||
return 0;
|
||||
if(_xcb_in_read_block(c, buf, length) <= 0)
|
||||
|
@ -149,11 +152,12 @@ static int read_packet(XCBConnection *c)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if(genrep.response_type != 1)
|
||||
if(genrep.response_type != XCBReply)
|
||||
((XCBGenericEvent *) buf)->full_sequence = c->in.request_read;
|
||||
|
||||
/* reply, or checked error */
|
||||
if(genrep.response_type == 1 || (genrep.response_type == 0 && pend && (pend->flags & XCB_REQUEST_CHECKED)))
|
||||
if( genrep.response_type == XCBReply ||
|
||||
(genrep.response_type == XCBError && pend && (pend->flags & XCB_REQUEST_CHECKED)))
|
||||
{
|
||||
reader_list *reader;
|
||||
struct reply_list *cur = malloc(sizeof(struct reply_list));
|
||||
|
@ -293,7 +297,7 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError **
|
|||
ret = head->reply;
|
||||
free(head);
|
||||
|
||||
if(((XCBGenericRep *) ret)->response_type == 0) /* X error */
|
||||
if(((XCBGenericRep *) ret)->response_type == XCBError)
|
||||
{
|
||||
if(e)
|
||||
*e = ret;
|
||||
|
|
|
@ -120,7 +120,7 @@ unsigned int XCBSendRequest(XCBConnection *c, int flags, struct iovec *vector, c
|
|||
longlen += vector[i].iov_len;
|
||||
if(!vector[i].iov_base)
|
||||
{
|
||||
vector[i].iov_base = (caddr_t) pad;
|
||||
vector[i].iov_base = (char *) pad;
|
||||
assert(vector[i].iov_len <= sizeof(pad));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
/* Utility functions implementable using only public APIs. */
|
||||
|
||||
#include <assert.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
.libs
|
||||
.deps
|
||||
*.o
|
||||
Makefile.in
|
||||
CheckLog.html
|
||||
CheckLog_xcb.xml
|
||||
check_all
|
||||
|
|
Loading…
Reference in New Issue