From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36641 invoked by alias); 2 Nov 2015 19:44:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 35221 invoked by uid 89); 2 Nov 2015 19:44:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 02 Nov 2015 19:44:38 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 3E391C0B5931 for ; Mon, 2 Nov 2015 19:36:17 +0000 (UTC) Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA2JaAPw009459 for ; Mon, 2 Nov 2015 14:36:16 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 05/11] [C++/mingw] gdbserver casts Date: Mon, 02 Nov 2015 19:44:00 -0000 Message-Id: <1446492970-21432-6-git-send-email-palves@redhat.com> In-Reply-To: <1446492970-21432-1-git-send-email-palves@redhat.com> References: <1446492970-21432-1-git-send-email-palves@redhat.com> X-SW-Source: 2015-11/txt/msg00037.txt.bz2 A set of obviously-needed C++ casts. gdb/gdbserver/ChangeLog: 2015-11-01 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/gdbserver/win32-i386-low.c | 5 +++-- gdb/gdbserver/win32-low.c | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/gdb/gdbserver/win32-i386-low.c b/gdb/gdbserver/win32-i386-low.c index 7c22f05..686521f 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 6e33509..2b40ca3 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) { -- 1.9.3