[PATCH 2/2] d3dx9: Test penultimate declaration element in D3DXDeclaratorFromFVFTest.

James Mckenzie jjmckenzie51 at earthlink.net
Wed Jul 7 14:56:49 CDT 2010

Alexandre Julliard <julliard at winehq.org> wrote:
>James McKenzie <jjmckenzie51 at earthlink.net> writes:
>> Misha Koshelev wrote:
>>> ---
>>>  dlls/d3dx9_36/tests/mesh.c |    6 +++---
>>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>> diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
>>> index a2fb6d8..2952e23 100644
>>> --- a/dlls/d3dx9_36/tests/mesh.c
>>> +++ b/dlls/d3dx9_36/tests/mesh.c
>>> @@ -262,7 +262,7 @@ static void D3DXDeclaratorFromFVFTest(void)
>>>           if (hr == D3D_OK)
>>>          {
>>> -            for (i=0; i<4; i++)
>>> +            for (i=0; i<5; i++)
>> I don't know about everyone else here, but I prefer to use less than
>> or equal to, which I think is what was intended here.   This
>> positively states the upper bound, which is what I was taught in
>> programming classes a long time ago (when ANSI C was still 89...)
>> Thus this would be
>> for (i=0; i<=4; i++)
>There's no reason that this would be any better. Please don't give
>advice based on folklore you heard in programming classes.
That 'folklore' is called a best practice for programming in 'c'.  Maybe things have changed since 1995, but I don't think this is one of them.  However, each programmer has their own programming 'style'.  They are neither right/wrong, but some are actually better than others.  I could really 'bitch' about some of the tests, but this is not the place to do so, nor would it advance this project.  I was trying to hand out advice, which YOU obviously think is wrong.  Sorry, but I have book to back me up, it is called "Programming in ANSI C" and is dated in 1994.

James McKenzie

More information about the wine-devel mailing list