RE: xinput: Add stub XInputEnable

2008-12-28 Thread ricardo filipe

yup, the patches look good on a quick glance.


> Date: Mon, 29 Dec 2008 02:30:26 +0700
> From: andrewf...@gmail.com
> To: hverb...@gmail.com; wine-de...@kievinfo.com; ricardo_barb...@hotmail.com
> Subject: Re: xinput: Add stub XInputEnable
> CC: wine-devel@winehq.org
>
> Sorry guys, that was a really bad patch I submitted much better ones
> to wine-patches already.
>
> [1/2] xinput: Added prototypes to header file
> [2/2] xinput: Added stub for XInputEnable

>> 2008/12/28 ricardo filipe :
>> it's almost that. but it needs some changes.
>> first you put the prototypes after the defines and typedefs, they may be 
>> needed for the prototypes.
>> second you don't put variable names in the protypes, it should be something 
>> like:
>> DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*);
> No, variable names are optional, but not forbidden. Usually it makesthings 
> more readable to include them. 
> It's a bit awkward to write "XINPUT_STATE* pState" though, since the *is part 
> of the declarator in C, not part of the base type.
 
i just meant you usually don't put the variable names, as we can see in most 
other headers in wine. but sure you are right ofc :)
_
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/



Re: xinput: Add stub XInputEnable

2008-12-28 Thread Andrew Fenn
Sorry guys, that was a really bad patch I submitted much better ones
to wine-patches already.

[1/2] xinput: Added prototypes to header file
[2/2] xinput: Added stub for XInputEnable




Re: xinput: Add stub XInputEnable

2008-12-28 Thread Henri Verbeet
2008/12/28 Andrew Fenn :
> On Sun, Dec 28, 2008 at 9:39 PM, Henri Verbeet  wrote:
>> Also, don't forget to add the prototype to the header, I noticed they're 
>> missing for all the other xinput functions as well.
>
> I think I have added the prototypes correctly to the header file.
> Could you have a quick look at my patch and tell me if I am doing that
> right?
>
Other than the missing semicolon Vitaliy already mentioned, and the
types being defined after their first use, I think it's useful to
specify C linkage for C++ applications that might include the header.

2008/12/28 ricardo filipe :
>
> it's almost that. but it needs some changes.
> first you put the prototypes after the defines and typedefs, they may be 
> needed for the prototypes.
> second you don't put variable names in the protypes, it should be something 
> like:
>
> DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*);
>
No, variable names are optional, but not forbidden. Usually it makes
things more readable to include them.

It's a bit awkward to write "XINPUT_STATE* pState" though, since the *
is part of the declarator in C, not part of the base type.




Re: xinput: Add stub XInputEnable

2008-12-28 Thread Vitaliy Margolen
Andrew Fenn wrote:
> I think I have added the prototypes correctly to the header file.
> Could you have a quick look at my patch and tell me if I am doing that
> right?
> 
> +XINPUT_CAPABILITIES* pCapabilities)

Missing semicolon.

Vitaliy.




RE: xinput: Add stub XInputEnable

2008-12-28 Thread ricardo filipe

it's almost that. but it needs some changes.
first you put the prototypes after the defines and typedefs, they may be needed 
for the prototypes.
second you don't put variable names in the protypes, it should be something 
like:

DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*);

see the xinput.h file from the windows SDK for more details. :)

btw you could make a patch to include all the prototypes and defines of the 
header too.
regards.

> Date: Sun, 28 Dec 2008 23:41:57 +0700
> From: andrewf...@gmail.com
> To: wine-devel@winehq.org
> Subject: Re: xinput: Add stub XInputEnable
>
> On Sun, Dec 28, 2008 at 9:39 PM, Henri Verbeet  wrote:
>> Also, don't forget to add the prototype to the header, I noticed they're 
>> missing for all the other xinput functions as well.
>
> I think I have added the prototypes correctly to the header file.
> Could you have a quick look at my patch and tell me if I am doing that
> right?

_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/photos.aspx



Re: xinput: Add stub XInputEnable

2008-12-28 Thread Andrew Fenn
On Sun, Dec 28, 2008 at 9:39 PM, Henri Verbeet  wrote:
> Also, don't forget to add the prototype to the header, I noticed they're 
> missing for all the other xinput functions as well.

I think I have added the prototypes correctly to the header file.
Could you have a quick look at my patch and tell me if I am doing that
right?
From 7653e90dfca104c19c074274c723446a6f7cfd1d Mon Sep 17 00:00:00 2001
From: Andrew Fenn 
Date: Sun, 28 Dec 2008 23:31:24 +0700
Subject: xinput: Added prototypes to header

---
 include/xinput.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/xinput.h b/include/xinput.h
index 46fd0ac..afb1198 100644
--- a/include/xinput.h
+++ b/include/xinput.h
@@ -22,6 +22,12 @@
 
 #include 
 
+DWORD WINAPI XInputGetState(DWORD dwUserIndex,
+XINPUT_STATE* pState);
+DWORD WINAPI XInputGetCapabilities(DWORD dwUserIndex,
+DWORD dwFlags,
+XINPUT_CAPABILITIES* pCapabilities)
+
 /*
  * Bitmasks for the joysticks buttons, determines what has
  * been pressed on the joystick, these need to be mapped
-- 
1.5.4.3




Re: xinput: Add stub XInputEnable

2008-12-28 Thread Henri Verbeet
2008/12/28 Andrew Fenn :
> +void WINAPI XInputEnable(bool enable)

Does this compile? "bool" is a C++ type. Also, don't forget to add the
prototype to the header, I noticed they're missing for all the other
xinput functions as well.