From 308a8808668c1edec499d244773b86761b7c873c Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Fri, 9 Jan 2009 10:48:36 +0000 Subject: [PATCH] * win32-nat.c (has_detach_ability, set_process_privilege): Cast the result of GetProcAddress to (void *) to avoid a compilation warning. --- gdb/ChangeLog | 6 ++++++ gdb/win32-nat.c | 19 ++++++++++--------- gdb/windows-nat.c | 19 ++++++++++--------- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d05370f848b..8015767b3af 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2009-01-09 Joel Brobecker + + * win32-nat.c (has_detach_ability, set_process_privilege): + Cast the result of GetProcAddress to (void *) to avoid + a compilation warning. + 2009-01-09 Joel Brobecker * win32-nat.c (CONTEXT_EXTENDED_REGISTERS): Define to 0 if not diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index 1b15dfbccc1..5300731595c 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -1600,11 +1600,11 @@ has_detach_ability (void) if (kernel32) { if (!kernel32_DebugSetProcessKillOnExit) - kernel32_DebugSetProcessKillOnExit = GetProcAddress (kernel32, - "DebugSetProcessKillOnExit"); + kernel32_DebugSetProcessKillOnExit = + (void *) GetProcAddress (kernel32, "DebugSetProcessKillOnExit"); if (!kernel32_DebugActiveProcessStop) - kernel32_DebugActiveProcessStop = GetProcAddress (kernel32, - "DebugActiveProcessStop"); + kernel32_DebugActiveProcessStop = + (void *) GetProcAddress (kernel32, "DebugActiveProcessStop"); if (kernel32_DebugSetProcessKillOnExit && kernel32_DebugActiveProcessStop) return 1; @@ -1641,13 +1641,14 @@ set_process_privilege (const char *privilege, BOOL enable) if (!(advapi32 = LoadLibrary ("advapi32.dll"))) goto out; if (!OpenProcessToken) - OpenProcessToken = GetProcAddress (advapi32, "OpenProcessToken"); + OpenProcessToken = + (void *) GetProcAddress (advapi32, "OpenProcessToken"); if (!LookupPrivilegeValue) - LookupPrivilegeValue = GetProcAddress (advapi32, - "LookupPrivilegeValueA"); + LookupPrivilegeValue = + (void *) GetProcAddress (advapi32, "LookupPrivilegeValueA"); if (!AdjustTokenPrivileges) - AdjustTokenPrivileges = GetProcAddress (advapi32, - "AdjustTokenPrivileges"); + AdjustTokenPrivileges = + (void *) GetProcAddress (advapi32, "AdjustTokenPrivileges"); if (!OpenProcessToken || !LookupPrivilegeValue || !AdjustTokenPrivileges) { advapi32 = NULL; diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 1b15dfbccc1..5300731595c 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1600,11 +1600,11 @@ has_detach_ability (void) if (kernel32) { if (!kernel32_DebugSetProcessKillOnExit) - kernel32_DebugSetProcessKillOnExit = GetProcAddress (kernel32, - "DebugSetProcessKillOnExit"); + kernel32_DebugSetProcessKillOnExit = + (void *) GetProcAddress (kernel32, "DebugSetProcessKillOnExit"); if (!kernel32_DebugActiveProcessStop) - kernel32_DebugActiveProcessStop = GetProcAddress (kernel32, - "DebugActiveProcessStop"); + kernel32_DebugActiveProcessStop = + (void *) GetProcAddress (kernel32, "DebugActiveProcessStop"); if (kernel32_DebugSetProcessKillOnExit && kernel32_DebugActiveProcessStop) return 1; @@ -1641,13 +1641,14 @@ set_process_privilege (const char *privilege, BOOL enable) if (!(advapi32 = LoadLibrary ("advapi32.dll"))) goto out; if (!OpenProcessToken) - OpenProcessToken = GetProcAddress (advapi32, "OpenProcessToken"); + OpenProcessToken = + (void *) GetProcAddress (advapi32, "OpenProcessToken"); if (!LookupPrivilegeValue) - LookupPrivilegeValue = GetProcAddress (advapi32, - "LookupPrivilegeValueA"); + LookupPrivilegeValue = + (void *) GetProcAddress (advapi32, "LookupPrivilegeValueA"); if (!AdjustTokenPrivileges) - AdjustTokenPrivileges = GetProcAddress (advapi32, - "AdjustTokenPrivileges"); + AdjustTokenPrivileges = + (void *) GetProcAddress (advapi32, "AdjustTokenPrivileges"); if (!OpenProcessToken || !LookupPrivilegeValue || !AdjustTokenPrivileges) { advapi32 = NULL; -- 2.30.2