[1/2] d3dx9/test: Add UpdateSemantics test.

Stefan Dösinger stefandoesinger at gmx.at
Wed Jun 8 13:32:40 CDT 2011


On Wednesday 08 June 2011 18:51:41 Michael Mc Donnell wrote:
>    unsigned int faces[] = {0, 1, 2};
>    unsigned int num_faces = sizeof(faces) / 3;
Does this do what you want? As far as I can see you want ARRAY_SIZE(faces) / 
3.

> +    struct {
> +        D3DXVECTOR3 position0;
> +        D3DXVECTOR3 position1;
> +        D3DXVECTOR3 normal;
> +        DWORD color;
> +    } vertices[] = {
> ...
Another style nitpick: Bracket placing.

> +    /* Two null pointers. Setting only the mesh to null will result in an
> +     * exception on Windows.
> +     */
> +    hr = mesh->lpVtbl->UpdateSemantics(NULL, NULL);
I think setting the instance pointer to NULL when invoking a method doesn't 
need a test, it will give you odd results. What you show here is that native 
checks the only method parameter before it accesses the object instance.

Remember, usually apps will invoke this via C++:

mesh->UpdateSemantics(declaration);

Similarly it isn't necessary to check iface or This against NULL in the 
implementations.

Otherwise this looks OK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20110608/222bf369/attachment.pgp>


More information about the wine-devel mailing list