Fixed some issues where XCB replies were being freed and data was not being copied.
authorJeremy Kolb <jkolb@freedesktop.org>
Mon, 20 Jun 2005 03:12:35 +0000 (03:12 +0000)
committerJeremy Kolb <jkolb@freedesktop.org>
Mon, 20 Jun 2005 03:12:35 +0000 (03:12 +0000)
src/mesa/glapi/glX_proto_send.py

index ef47edd42a4cd04b4b080a24fffc1d545190df66..94c096e686db5c09ee97ad710d185584bed9b85b 100644 (file)
@@ -453,11 +453,9 @@ generic_%u_byte( GLint rop, const void * ptr )
                                elif f.output and not f.reply_always_array:
                                        if not f.image and not f.name == "GenQueriesARB":
                                                print '        if (%sDataLength(reply) == 0)' % (xcb_name)
-                                               print '            %s = (%s *) &reply->datum;' % (f.output.name, f.output.p_type.name)
+                                               print '            (void)memcpy(%s, &reply->datum, sizeof(reply->datum));' % (f.output.name)
                                                print '        else'
-                                               print '            %s = (%s *)%sData(reply);' % (f.output.name, f.output.p_type.name, xcb_name)
-                                       else:
-                                               print '        %s = (%s *)%sData(reply);' % (f.output.name, f.output.p_type.name, xcb_name)
+                                       print '        (void)memcpy(%s, %sData(reply), %sDataLength(reply) * sizeof(%s));' % (f.output.name, xcb_name, xcb_name, f.output.p_type.name)
 
 
                                if f.fn_return_type != 'void':