st/nine: Return E_FAIL for unused vertexdeclaration type
authorPatrick Rudolph <siro@das-labor.org>
Thu, 15 Jan 2015 08:43:33 +0000 (09:43 +0100)
committerAxel Davy <axel.davy@ens.fr>
Thu, 5 Feb 2015 23:07:19 +0000 (00:07 +0100)
Add returncode E_FAIL.
Return E_FAIL for any vertexdeclaration element with type unused.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
include/D3D9/d3d9types.h
src/gallium/state_trackers/nine/vertexdeclaration9.c

index e0f1e720ab174c1f0965d5b673313c9d9337d624..5020934ddfe7570c833dc517eaf12eab9064c673 100644 (file)
@@ -50,6 +50,7 @@
 #define E_OUTOFMEMORY MAKE_HRESULT(1, 0x007, 14)
 #define E_NOINTERFACE MAKE_HRESULT(1, 0x000, 0x4002)
 #define E_POINTER     MAKE_HRESULT(1, 0x000, 0x4003)
+#define E_FAIL        MAKE_HRESULT(1, 0x000, 0x4005)
 
 #define S_OK          ((HRESULT)0)
 #define S_FALSE       ((HRESULT)1)
index 08b95e22fc42969748faec0d12f86536255405ac..49e5937a52ef69d16e3979874621379da22aa867 100644 (file)
@@ -181,10 +181,11 @@ NineVertexDeclaration9_ctor( struct NineVertexDeclaration9 *This,
     HRESULT hr = NineUnknown_ctor(&This->base, pParams);
     if (FAILED(hr)) { return hr; }
 
+    /* wine */
     for (This->nelems = 0;
-         pElements[This->nelems].Type != D3DDECLTYPE_UNUSED &&
-         pElements[This->nelems].Stream != 0xFF; /* wine */
-         ++This->nelems);
+         pElements[This->nelems].Stream != 0xFF;
+         ++This->nelems)
+        user_assert(pElements[This->nelems].Type != D3DDECLTYPE_UNUSED, E_FAIL);
 
     caps = NineDevice9_GetCaps(This->base.device);
     user_assert(This->nelems <= caps->MaxStreams, D3DERR_INVALIDCALL);