Re: [PATCH] ws2_32: Turn SIO_GET_EXTENSION_FUNCTION_POINTER into a table
On 02.03.2017 06:38, Bruno Jesus wrote:
From: Bruno Jesus <bjesus(a)codeweavers.com>
I could not find any better way to avoid compilation warning than using a typedef for the function pointer. If there is a better way I'm all ears.
Signed-off-by: Bruno Jesus <bjesus(a)codeweavers.com> --- dlls/ws2_32/socket.c | 94 +++++++++++++++++++++++----------------------------- 1 file changed, 41 insertions(+), 53 deletions(-)
It works fine here without any typedefs: --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -4945,10 +4945,8 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID if (found) { - typedef void (*func_ptr)(void); - TRACE("-> got %s\n", guid_funcs[i].name); - *(func_ptr *)out_buff = guid_funcs[i].func_ptr; + *(void **)out_buff = guid_funcs[i].func_ptr; break; } What kind of compiler warning do you get?
On Thu, Mar 2, 2017 at 2:48 PM, Sebastian Lackner <sebastian(a)fds-team.de> wrote:
On 02.03.2017 06:38, Bruno Jesus wrote:
From: Bruno Jesus <bjesus(a)codeweavers.com>
I could not find any better way to avoid compilation warning than using a typedef for the function pointer. If there is a better way I'm all ears.
Signed-off-by: Bruno Jesus <bjesus(a)codeweavers.com> --- dlls/ws2_32/socket.c | 94 +++++++++++++++++++++++----------------------------- 1 file changed, 41 insertions(+), 53 deletions(-)
It works fine here without any typedefs:
--- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -4945,10 +4945,8 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
if (found) { - typedef void (*func_ptr)(void); - TRACE("-> got %s\n", guid_funcs[i].name); - *(func_ptr *)out_buff = guid_funcs[i].func_ptr; + *(void **)out_buff = guid_funcs[i].func_ptr; break; }
What kind of compiler warning do you get?
Thank you very much, I guess I tried everything but what you propose =) I'll send an updated version.
participants (2)
-
Bruno Jesus -
Sebastian Lackner