+static bool wined3d_get_unused_stream_index(const struct wined3d_state *state, uint32_t *index) +{ + uint32_t i; + + for (i = 0; i < ARRAY_SIZE(state->streams); ++i) + { + if (!state->streams[i].buffer) + { + *index = i; + break; + } + } + + return i != ARRAY_SIZE(state->streams); +}
That's the straightforward translation, but I think it's a bit awkward. I think it would be clearer to replace the "break;" above with "return true;", and "return i != ARRAY_SIZE(state->streams);" with "return false;".