diff options
author | Keith Whitwell <[email protected]> | 2009-03-12 16:57:11 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-03-12 16:57:30 +0000 |
commit | 10812b079166e6d8dd414b8a0bf35b01e12bbdf0 (patch) | |
tree | f36c4b4d298403b9b646350a02c7e6e9efd24e23 /src | |
parent | d885c9dad15b64fd40c4c4d5cda6713a3e06a9ae (diff) |
stw: fix uninitialized variable issue
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/wgl/shared/stw_context.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_context.c b/src/gallium/state_trackers/wgl/shared/stw_context.c index 1377fb1ec81..708acad1939 100644 --- a/src/gallium/state_trackers/wgl/shared/stw_context.c +++ b/src/gallium/state_trackers/wgl/shared/stw_context.c @@ -80,7 +80,7 @@ stw_create_layer_context( struct stw_context *ctx = NULL; GLvisual *visual = NULL; struct pipe_context *pipe = NULL; - UINT_PTR hglrc; + UINT_PTR hglrc = 0; if(!stw_dev) return 0; @@ -140,25 +140,21 @@ stw_create_layer_context( UINT_PTR i; for (i = 0; i < STW_CONTEXT_MAX; i++) { - if (stw_dev->ctx_array[i].ctx == NULL) + if (stw_dev->ctx_array[i].ctx == NULL) { + /* success: + */ + stw_dev->ctx_array[i].ctx = ctx; + hglrc = i + 1; break; + } } - - /* No slot available, fail: - */ - if (i == STW_CONTEXT_MAX) - goto done; - - stw_dev->ctx_array[i].ctx = ctx; - - /* success: - */ - hglrc = i + 1; } -done: pipe_mutex_unlock( stw_dev->mutex ); - return hglrc; + /* Success? + */ + if (hglrc != 0) + return hglrc; fail: if (visual) |