[PATCH] ws2_32: Turn SIO_GET_EXTENSION_FUNCTION_POINTER into a table

Sebastian Lackner sebastian at fds-team.de
Thu Mar 2 11:48:50 CST 2017


On 02.03.2017 06:38, Bruno Jesus wrote:
> From: Bruno Jesus <bjesus at 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 at 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?




More information about the wine-devel mailing list