]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Cast GetVolumeInformationByHandleW to (void *)
authorDavid Woodhouse <dwmw2@infradead.org>
Sat, 27 Mar 2021 15:00:34 +0000 (15:00 +0000)
committerDavid Woodhouse <dwmw2@infradead.org>
Sat, 27 Mar 2021 15:00:34 +0000 (15:00 +0000)
The 64-bit Windows build was complaining of pointer type mismatches but
I'm fairly sure it was a false positive:

../ssl.c: In function 'openconnect_passphrase_from_fsid':
../ssl.c:598:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, WCHAR *, DWORD,  DWORD *, DWORD *, DWORD *, WCHAR *, DWORD)' {aka 'int (*)(void *, short unsigned int *, long unsigned int,  long unsigned int *, long unsigned int *, long unsigned int *, short unsigned int *, long unsigned int)'} [-Wcast-function-type]
  598 |  func = (GVIBH)GetProcAddress(kernlib, "GetVolumeInformationByHandleW");
      |         ^

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
ssl.c

diff --git a/ssl.c b/ssl.c
index f68e91f5bcbe83bc7569901690ff8b3e5154c57e..dc81887f023ebdf91348d8e3c580731525ea87d2 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -595,7 +595,7 @@ int openconnect_passphrase_from_fsid(struct openconnect_info *vpninfo)
                             _("Could not obtain file system ID for passphrase\n"));
                return -EOPNOTSUPP;
        }
-       func = (GVIBH)GetProcAddress(kernlib, "GetVolumeInformationByHandleW");
+       func = (void *)GetProcAddress(kernlib, "GetVolumeInformationByHandleW");
        FreeLibrary(kernlib);
        if (!func)
                goto notsupp;