diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py index bec0222..20137df 100644 --- a/src/mapi/glapi/gen/glX_proto_send.py +++ b/src/mapi/glapi/gen/glX_proto_send.py @@ -683,7 +683,9 @@ generic_%u_byte( GLint rop, const void * ptr ) elif output and not f.reply_always_array: if not output.is_image(): - print ' if (%s_data_length(reply) == 0)' % (xcb_name) + print ' // the XXX_data_length() xcb function name is misleading, it returns the number' + print ' // of elements, not the lenght of the data part. A single element is embedded.' + print ' if (%s_data_length(reply) == 1)' % (xcb_name) print ' (void)memcpy(%s, &reply->datum, sizeof(reply->datum));' % (output.name) print ' else' print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string())