From 6c5e1aff0421b8a56e686520b6f6d11a0408871b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 24 Oct 2016 11:57:26 +0200 Subject: [PATCH] wined3d: Simplify remove_vbos(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/drawprim.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 483384531c0..bf035ae8c35 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -391,18 +391,19 @@ static void remove_vbos(struct wined3d_context *context, { unsigned int i; - for (i = 0; i < (sizeof(s->elements) / sizeof(*s->elements)); ++i) + for (i = 0; i < ARRAY_SIZE(s->elements); ++i) { struct wined3d_stream_info_element *e; - if (!(s->use_map & (1u << i))) continue; + if (!(s->use_map & (1u << i))) + continue; e = &s->elements[i]; if (e->data.buffer_object) { struct wined3d_buffer *vb = state->streams[e->stream_idx].buffer; e->data.buffer_object = 0; - e->data.addr = (BYTE *)((ULONG_PTR)e->data.addr + (ULONG_PTR)wined3d_buffer_load_sysmem(vb, context)); + e->data.addr += (ULONG_PTR)wined3d_buffer_load_sysmem(vb, context); } } }