Re: Add implementation of D3DRMVector* functions

2007-03-12 Thread Dmitry Timoshkov

Vijay Kiran Kamuju [EMAIL PROTECTED] wrote:


This is a patch by David Adams, implementing D3DRMVector* functions in d3drm.dll
I am sending the patch to this mailing list as this was posted on
bugzilla and awaiting review.


1. it's not really nice to send something with name attachment.cgi as a patch.
2. the patch has inconsistent formatting and very hard to read due to that
3. the patch is extremely buggy in memory allocations: instead of allocating
the space for an object it allocates the space only for a pointer. I'd suggest
to allocate all the objects on the stack instead.

--
Dmitry.




Re: Add implementation of D3DRMVector* functions

2007-03-12 Thread H. Verbeet

On 12/03/07, Vijay Kiran Kamuju [EMAIL PROTECTED] wrote:

Hi,

This is a patch by David Adams, implementing D3DRMVector* functions in d3drm.dll
I am sending the patch to this mailing list as this was posted on
bugzilla and awaiting review.



A few comments:


- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA

0;2110;-130;1, USA
I don't think that change should be there.


+LPD3DVECTOR result=(LPD3DVECTOR)(malloc(sizeof(LPD3DVECTOR)));

That and other places in that patch should be using HeapAlloc/HeapFree


+LPD3DVECTOR D3DRMAPI D3DRMVectorRandom(LPD3DVECTOR d)
+{
+
+srand(time(NULL));
+d-x=(float)(rand());
+d-y=(float)(rand());
+d-z=(float)(rand());
+TRACE(Random vector=(%f,%f,%f)\n,d-x,d-y,d-z);
+return d;
+}

I'm not sure about this, but I'm thinking it might be better to
generate a normalized vector there.

- The indentation in D3DRMVectorRotate is a bit of a mess
- Writing test cases doesn't hurt, and in this case should be pretty easy




Re: Add implementation of D3DRMVector* functions

2007-03-12 Thread H. Verbeet

On 12/03/07, Dmitry Timoshkov [EMAIL PROTECTED] wrote:

3. the patch is extremely buggy in memory allocations: instead of allocating
the space for an object it allocates the space only for a pointer. I'd suggest
to allocate all the objects on the stack instead.


Hmm, I looked over that.




Re: Add implementation of D3DRMVector* functions

2007-03-12 Thread Vijay Kiran Kamuju

Hi,

Can you update these comments to this bugzilla entry, #7442?

Thanks,
VJ

On 3/12/07, H. Verbeet [EMAIL PROTECTED] wrote:

On 12/03/07, Vijay Kiran Kamuju [EMAIL PROTECTED] wrote:
 Hi,

 This is a patch by David Adams, implementing D3DRMVector* functions in 
d3drm.dll
 I am sending the patch to this mailing list as this was posted on
 bugzilla and awaiting review.


A few comments:

- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
0;2110;-130;1, USA
I don't think that change should be there.

+LPD3DVECTOR result=(LPD3DVECTOR)(malloc(sizeof(LPD3DVECTOR)));
That and other places in that patch should be using HeapAlloc/HeapFree

+LPD3DVECTOR D3DRMAPI D3DRMVectorRandom(LPD3DVECTOR d)
+{
+
+srand(time(NULL));
+d-x=(float)(rand());
+d-y=(float)(rand());
+d-z=(float)(rand());
+TRACE(Random vector=(%f,%f,%f)\n,d-x,d-y,d-z);
+return d;
+}
I'm not sure about this, but I'm thinking it might be better to
generate a normalized vector there.

- The indentation in D3DRMVectorRotate is a bit of a mess
- Writing test cases doesn't hurt, and in this case should be pretty easy








Re: Add implementation of D3DRMVector* functions

2007-03-12 Thread Vijay Kiran Kamuju

Hi,

Currently I dont have a wine repository, so that I could not apply and test it.
No time to change it :(
Next will check properly.

Thanks,
VJ

On 3/12/07, Dmitry Timoshkov [EMAIL PROTECTED] wrote:

Vijay Kiran Kamuju [EMAIL PROTECTED] wrote:

 This is a patch by David Adams, implementing D3DRMVector* functions in 
d3drm.dll
 I am sending the patch to this mailing list as this was posted on
 bugzilla and awaiting review.

1. it's not really nice to send something with name attachment.cgi as a patch.
2. the patch has inconsistent formatting and very hard to read due to that
3. the patch is extremely buggy in memory allocations: instead of allocating
the space for an object it allocates the space only for a pointer. I'd suggest
to allocate all the objects on the stack instead.

--
Dmitry.