1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 09:12:24 +00:00

More assorted Winelib warning fixes.

The previous fix on pre-0.77 was non-disruptive and just enough to get
through my Coverity build (which uses winelib); but now that I look at
the rest of the Winelib build output, there are some further warnings
I should fix on main.

Most of them are more long/LONG confusion (specific to Winelib, rather
than real Windows); also, there's a multiple macro definition in
jump-list.c because Winelib defines _PROPVARIANT_INIT_DEFINED_ in
place of _PROPVARIANTINIT_DEFINED_ which we were testing for. (Bah.)
And in windows/window.c I used wcscmp without including <wchar.h>.

In spite of long vs LONG I still had to turn off one or two more
DLL-loading typechecks.
This commit is contained in:
Simon Tatham 2022-05-08 11:06:14 +01:00
parent e29b6eb5d2
commit e9de549e7e
5 changed files with 18 additions and 14 deletions

View File

@ -227,7 +227,8 @@ struct ssh_gss_liblist *ssh_gss_setup(Conf *conf)
lib->gsslogmsg = "Using SSPI from SECUR32.DLL"; lib->gsslogmsg = "Using SSPI from SECUR32.DLL";
lib->handle = (void *)module; lib->handle = (void *)module;
GET_WINDOWS_FUNCTION(module, AcquireCredentialsHandleA); /* No typecheck because Winelib thinks one PVOID is a PLUID */
GET_WINDOWS_FUNCTION_NO_TYPECHECK(module, AcquireCredentialsHandleA);
GET_WINDOWS_FUNCTION(module, InitializeSecurityContextA); GET_WINDOWS_FUNCTION(module, InitializeSecurityContextA);
GET_WINDOWS_FUNCTION(module, FreeContextBuffer); GET_WINDOWS_FUNCTION(module, FreeContextBuffer);
GET_WINDOWS_FUNCTION(module, FreeCredentialsHandle); GET_WINDOWS_FUNCTION(module, FreeCredentialsHandle);

View File

@ -41,7 +41,7 @@ typedef struct _tagpropertykey {
typedef PROPVARIANT *REFPROPVARIANT; typedef PROPVARIANT *REFPROPVARIANT;
#endif #endif
/* MinGW doesn't define this yet: */ /* MinGW doesn't define this yet: */
#ifndef _PROPVARIANTINIT_DEFINED_ #if !defined _PROPVARIANTINIT_DEFINED_ && !defined _PROPVARIANT_INIT_DEFINED_
#define _PROPVARIANTINIT_DEFINED_ #define _PROPVARIANTINIT_DEFINED_
#define PropVariantInit(pvar) memset((pvar),0,sizeof(PROPVARIANT)) #define PropVariantInit(pvar) memset((pvar),0,sizeof(PROPVARIANT))
#endif #endif

View File

@ -180,16 +180,16 @@ static int cmpforsearch(void *av, void *bv)
DECL_WINDOWS_FUNCTION(static, int, WSAStartup, (WORD, LPWSADATA)); DECL_WINDOWS_FUNCTION(static, int, WSAStartup, (WORD, LPWSADATA));
DECL_WINDOWS_FUNCTION(static, int, WSACleanup, (void)); DECL_WINDOWS_FUNCTION(static, int, WSACleanup, (void));
DECL_WINDOWS_FUNCTION(static, int, closesocket, (SOCKET)); DECL_WINDOWS_FUNCTION(static, int, closesocket, (SOCKET));
DECL_WINDOWS_FUNCTION(static, u_long, ntohl, (u_long)); DECL_WINDOWS_FUNCTION(static, ULONG, ntohl, (ULONG));
DECL_WINDOWS_FUNCTION(static, u_long, htonl, (u_long)); DECL_WINDOWS_FUNCTION(static, ULONG, htonl, (ULONG));
DECL_WINDOWS_FUNCTION(static, u_short, htons, (u_short)); DECL_WINDOWS_FUNCTION(static, USHORT, htons, (USHORT));
DECL_WINDOWS_FUNCTION(static, u_short, ntohs, (u_short)); DECL_WINDOWS_FUNCTION(static, USHORT, ntohs, (USHORT));
DECL_WINDOWS_FUNCTION(static, int, gethostname, (char *, int)); DECL_WINDOWS_FUNCTION(static, int, gethostname, (char *, int));
DECL_WINDOWS_FUNCTION(static, struct hostent FAR *, gethostbyname, DECL_WINDOWS_FUNCTION(static, struct hostent FAR *, gethostbyname,
(const char FAR *)); (const char FAR *));
DECL_WINDOWS_FUNCTION(static, struct servent FAR *, getservbyname, DECL_WINDOWS_FUNCTION(static, struct servent FAR *, getservbyname,
(const char FAR *, const char FAR *)); (const char FAR *, const char FAR *));
DECL_WINDOWS_FUNCTION(static, unsigned long, inet_addr, (const char FAR *)); DECL_WINDOWS_FUNCTION(static, ULONG, inet_addr, (const char FAR *));
DECL_WINDOWS_FUNCTION(static, char FAR *, inet_ntoa, (struct in_addr)); DECL_WINDOWS_FUNCTION(static, char FAR *, inet_ntoa, (struct in_addr));
DECL_WINDOWS_FUNCTION(static, const char FAR *, inet_ntop, DECL_WINDOWS_FUNCTION(static, const char FAR *, inet_ntop,
(int, void FAR *, char *, size_t)); (int, void FAR *, char *, size_t));
@ -204,7 +204,7 @@ DECL_WINDOWS_FUNCTION(static, int, listen, (SOCKET, int));
DECL_WINDOWS_FUNCTION(static, int, send, (SOCKET, const char FAR *, int, int)); DECL_WINDOWS_FUNCTION(static, int, send, (SOCKET, const char FAR *, int, int));
DECL_WINDOWS_FUNCTION(static, int, shutdown, (SOCKET, int)); DECL_WINDOWS_FUNCTION(static, int, shutdown, (SOCKET, int));
DECL_WINDOWS_FUNCTION(static, int, ioctlsocket, DECL_WINDOWS_FUNCTION(static, int, ioctlsocket,
(SOCKET, long, u_long FAR *)); (SOCKET, LONG, ULONG FAR *));
DECL_WINDOWS_FUNCTION(static, SOCKET, accept, DECL_WINDOWS_FUNCTION(static, SOCKET, accept,
(SOCKET, struct sockaddr FAR *, int FAR *)); (SOCKET, struct sockaddr FAR *, int FAR *));
DECL_WINDOWS_FUNCTION(static, int, getpeername, DECL_WINDOWS_FUNCTION(static, int, getpeername,
@ -305,10 +305,12 @@ void sk_init(void)
GET_WINDOWS_FUNCTION(winsock_module, WSAStartup); GET_WINDOWS_FUNCTION(winsock_module, WSAStartup);
GET_WINDOWS_FUNCTION(winsock_module, WSACleanup); GET_WINDOWS_FUNCTION(winsock_module, WSACleanup);
GET_WINDOWS_FUNCTION(winsock_module, closesocket); GET_WINDOWS_FUNCTION(winsock_module, closesocket);
GET_WINDOWS_FUNCTION(winsock_module, ntohl); /* Winelib maps ntohl and friends to things like
GET_WINDOWS_FUNCTION(winsock_module, htonl); * __wine_ulong_swap, which fail these type checks hopelessly */
GET_WINDOWS_FUNCTION(winsock_module, htons); GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, ntohl);
GET_WINDOWS_FUNCTION(winsock_module, ntohs); GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, htonl);
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, htons);
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, ntohs);
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, gethostname); GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, gethostname);
GET_WINDOWS_FUNCTION(winsock_module, gethostbyname); GET_WINDOWS_FUNCTION(winsock_module, gethostbyname);
GET_WINDOWS_FUNCTION(winsock_module, getservbyname); GET_WINDOWS_FUNCTION(winsock_module, getservbyname);

View File

@ -306,9 +306,9 @@ Socket *sk_newlistener_unix(const char *socketpath, Plug *plug);
* here they are. * here they are.
*/ */
DECL_WINDOWS_FUNCTION(extern, int, WSAAsyncSelect, DECL_WINDOWS_FUNCTION(extern, int, WSAAsyncSelect,
(SOCKET, HWND, u_int, long)); (SOCKET, HWND, u_int, LONG));
DECL_WINDOWS_FUNCTION(extern, int, WSAEventSelect, DECL_WINDOWS_FUNCTION(extern, int, WSAEventSelect,
(SOCKET, WSAEVENT, long)); (SOCKET, WSAEVENT, LONG));
DECL_WINDOWS_FUNCTION(extern, int, WSAGetLastError, (void)); DECL_WINDOWS_FUNCTION(extern, int, WSAGetLastError, (void));
DECL_WINDOWS_FUNCTION(extern, int, WSAEnumNetworkEvents, DECL_WINDOWS_FUNCTION(extern, int, WSAEnumNetworkEvents,
(SOCKET, WSAEVENT, LPWSANETWORKEVENTS)); (SOCKET, WSAEVENT, LPWSANETWORKEVENTS));

View File

@ -9,6 +9,7 @@
#include <time.h> #include <time.h>
#include <limits.h> #include <limits.h>
#include <assert.h> #include <assert.h>
#include <wchar.h>
#define COMPILE_MULTIMON_STUBS #define COMPILE_MULTIMON_STUBS