From c3de4d92dfd0a1fa8d32a00bbb99de2a4ee0e140 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 17 Nov 2015 15:17:45 +0000 Subject: [PATCH] [C++/mingw] gdbserver casts A set of obviously-needed C++ casts. gdb/gdbserver/ChangeLog: 2015-11-17 Pedro Alves * win32-i386-low.c (update_debug_registers_callback) (win32_get_current_dr): Add cast. * win32-low.c (thread_rec, delete_thread_info) (continue_one_thread): Add casts. (strwinerror): Cast FormatMessage argument to LPTSTR instead of LPVOID. (win32_create_inferior, suspend_one_thread): Add casts. --- gdb/ChangeLog | 10 ++++++++++ gdb/gdbserver/win32-i386-low.c | 5 +++-- gdb/gdbserver/win32-low.c | 19 ++++++++++--------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8de7c2585f..ddd17a7a0a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2015-11-17 Pedro Alves + + * win32-i386-low.c (update_debug_registers_callback) + (win32_get_current_dr): Add cast. + * win32-low.c (thread_rec, delete_thread_info) + (continue_one_thread): Add casts. + (strwinerror): Cast FormatMessage argument to LPTSTR instead of + LPVOID. + (win32_create_inferior, suspend_one_thread): Add casts. + 2015-11-17 Pedro Alves * windows-nat.c (AdjustTokenPrivileges_ftype) diff --git a/gdb/gdbserver/win32-i386-low.c b/gdb/gdbserver/win32-i386-low.c index 7c22f058fe..686521f253 100644 --- a/gdb/gdbserver/win32-i386-low.c +++ b/gdb/gdbserver/win32-i386-low.c @@ -45,7 +45,7 @@ update_debug_registers_callback (struct inferior_list_entry *entry, void *pid_p) { struct thread_info *thr = (struct thread_info *) entry; - win32_thread_info *th = inferior_target_data (thr); + win32_thread_info *th = (win32_thread_info *) inferior_target_data (thr); int pid = *(int *) pid_p; /* Only update the threads of this process. */ @@ -89,7 +89,8 @@ x86_dr_low_set_control (unsigned long control) static DWORD64 win32_get_current_dr (int dr) { - win32_thread_info *th = inferior_target_data (current_thread); + win32_thread_info *th + = (win32_thread_info *) inferior_target_data (current_thread); win32_require_context (th); diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c index 6e33509c0b..2b40ca32ff 100644 --- a/gdb/gdbserver/win32-low.c +++ b/gdb/gdbserver/win32-low.c @@ -198,7 +198,7 @@ thread_rec (ptid_t ptid, int get_context) if (thread == NULL) return NULL; - th = inferior_target_data (thread); + th = (win32_thread_info *) inferior_target_data (thread); if (get_context) win32_require_context (th); return th; @@ -229,11 +229,12 @@ child_add_thread (DWORD pid, DWORD tid, HANDLE h, void *tlb) /* Delete a thread from the list of threads. */ static void -delete_thread_info (struct inferior_list_entry *thread) +delete_thread_info (struct inferior_list_entry *entry) { - win32_thread_info *th = inferior_target_data ((struct thread_info *) thread); + struct thread_info *thread = (struct thread_info *) entry; + win32_thread_info *th = (win32_thread_info *) inferior_target_data (thread); - remove_thread ((struct thread_info *) thread); + remove_thread (thread); CloseHandle (th->h); free (th); } @@ -432,7 +433,7 @@ continue_one_thread (struct inferior_list_entry *this_thread, void *id_ptr) { struct thread_info *thread = (struct thread_info *) this_thread; int thread_id = * (int *) id_ptr; - win32_thread_info *th = inferior_target_data (thread); + win32_thread_info *th = (win32_thread_info *) inferior_target_data (thread); if (thread_id == -1 || thread_id == th->tid) { @@ -523,7 +524,7 @@ strwinerror (DWORD error) NULL, error, 0, /* Default language */ - (LPVOID)&msgbuf, + (LPTSTR) &msgbuf, 0, NULL); if (chars != 0) @@ -654,7 +655,7 @@ win32_create_inferior (char *program, char **program_args) argslen = 1; for (argc = 1; program_args[argc]; argc++) argslen += strlen (program_args[argc]) + 1; - args = alloca (argslen); + args = (char *) alloca (argslen); args[0] = '\0'; for (argc = 1; program_args[argc]; argc++) { @@ -673,7 +674,7 @@ win32_create_inferior (char *program, char **program_args) err = GetLastError (); if (!ret && err == ERROR_FILE_NOT_FOUND) { - char *exename = alloca (strlen (program) + 5); + char *exename = (char *) alloca (strlen (program) + 5); strcat (strcpy (exename, program), ".exe"); ret = create_process (exename, args, flags, &pi); err = GetLastError (); @@ -1344,7 +1345,7 @@ static void suspend_one_thread (struct inferior_list_entry *entry) { struct thread_info *thread = (struct thread_info *) entry; - win32_thread_info *th = inferior_target_data (thread); + win32_thread_info *th = (win32_thread_info *) inferior_target_data (thread); if (!th->suspended) { -- 2.34.1