diff options
author | Jeremy Kolb <jkolb@freedesktop.org> | 2005-06-24 02:28:02 +0000 |
---|---|---|
committer | Jeremy Kolb <jkolb@freedesktop.org> | 2005-06-24 02:28:02 +0000 |
commit | 3fb86eefe8b22e8d95111ef49feb0a91d865fd00 (patch) | |
tree | bb8beafb0487cabc19d87299433da490a21eb0b1 /src | |
parent | 1c5caba184dc6f9bf7b2c730d8d3109a7a59ce52 (diff) |
Fixed the XCB implementation when always_array is true, thanks to Ian Romanick for pointing it out. Please review.
Diffstat (limited to 'src')
-rw-r--r-- | src/glx/x11/indirect.c | 8 | ||||
-rw-r--r-- | src/mesa/glapi/glX_proto_send.py | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/glx/x11/indirect.c b/src/glx/x11/indirect.c index 42e961e5f3..27a818ddf3 100644 --- a/src/glx/x11/indirect.c +++ b/src/glx/x11/indirect.c @@ -3387,7 +3387,7 @@ __indirect_glGetClipPlane(GLenum plane, GLdouble * equation) XCBConnection *c = XCBConnectionOfDisplay(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); XCBGlxGetClipPlaneRep *reply = XCBGlxGetClipPlaneReply(c, XCBGlxGetClipPlane(c, gc->currentContextTag, plane), NULL); - equation = (GLdouble *)XCBGlxGetClipPlaneData(reply); + (void)memcpy(equation, XCBGlxGetClipPlaneData(reply), XCBGlxGetClipPlaneDataLength(reply) * sizeof(GLdouble)); free(reply); #else GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetClipPlane, cmdlen); @@ -4314,7 +4314,7 @@ __indirect_glAreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * XCBConnection *c = XCBConnectionOfDisplay(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); XCBGlxAreTexturesResidentRep *reply = XCBGlxAreTexturesResidentReply(c, XCBGlxAreTexturesResident(c, gc->currentContextTag, n, textures), NULL); - residences = (GLboolean *)XCBGlxAreTexturesResidentData(reply); + (void)memcpy(residences, XCBGlxAreTexturesResidentData(reply), XCBGlxAreTexturesResidentDataLength(reply) * sizeof(GLboolean)); retval = reply->ret_val; free(reply); #else @@ -4429,7 +4429,7 @@ __indirect_glGenTextures(GLsizei n, GLuint * textures) XCBConnection *c = XCBConnectionOfDisplay(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); XCBGlxGenTexturesRep *reply = XCBGlxGenTexturesReply(c, XCBGlxGenTextures(c, gc->currentContextTag, n), NULL); - textures = (GLuint *)XCBGlxGenTexturesData(reply); + (void)memcpy(textures, XCBGlxGenTexturesData(reply), XCBGlxGenTexturesDataLength(reply) * sizeof(GLuint)); free(reply); #else GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenTextures, cmdlen); @@ -7624,7 +7624,7 @@ __indirect_glGenQueriesARB(GLsizei n, GLuint * ids) XCBConnection *c = XCBConnectionOfDisplay(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); XCBGlxGenQueriesARBRep *reply = XCBGlxGenQueriesARBReply(c, XCBGlxGenQueriesARB(c, gc->currentContextTag, n), NULL); - ids = (GLuint *)XCBGlxGenQueriesARBData(reply); + (void)memcpy(ids, XCBGlxGenQueriesARBData(reply), XCBGlxGenQueriesARBDataLength(reply) * sizeof(GLuint)); free(reply); #else GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenQueriesARB, cmdlen); diff --git a/src/mesa/glapi/glX_proto_send.py b/src/mesa/glapi/glX_proto_send.py index 6a4d1dfc0d..53a9795918 100644 --- a/src/mesa/glapi/glX_proto_send.py +++ b/src/mesa/glapi/glX_proto_send.py @@ -574,7 +574,8 @@ generic_%u_byte( GLint rop, const void * ptr ) if f.needs_reply(): print ' %sRep *reply = %sReply(c, %s, NULL);' % (xcb_name, xcb_name, xcb_request) if output and f.reply_always_array: - print ' %s = (%s)%sData(reply);' % (output.name, output.type_string(), xcb_name) + print ' (void)memcpy(%s, %sData(reply), %sDataLength(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string()) + elif output and not f.reply_always_array: if not output.is_image(): print ' if (%sDataLength(reply) == 0)' % (xcb_name) |