From patchwork Wed May 21 18:57:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 1060 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id B4D86360079 for ; Wed, 21 May 2014 11:57:34 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14314964) id 43358573EE63; Wed, 21 May 2014 11:57:34 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id E70FC573EE63 for ; Wed, 21 May 2014 11:57:33 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=HwirsB813d8rKTx4MuAsf9TCKZQF9 GAgwqFDDLZj31LPsiISQ2O27xH5xwfWUn2QWmXO/a6NPaNxQzhagk0rZ7p9U7/oW tnghglhbjsloxqB/Rub1RF2tpNJ7gOCy8+chPDQruaZHiaxSJ+IJwJE2vz6rjEFI P+U3UCJ5mMBmlI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=CQ8V2KMlOnuyFVv5WXa5yl2fVKs=; b=QR8 LipXC1l+5IGWjPpuOKUh6rOfib2yTsRIvD6RhHIsz1CMPVq+p5SLpxYn33sbDcz7 hn47Qt1LyklEyyfAje96JL6Vn09N6rEdDJF2a5elbGuzMLT2DkZmw89Dx2NKg73K ydpm8bOlW5bGBxG7DjXO36FYsfutjv+l6sUhgTuc= Received: (qmail 10570 invoked by alias); 21 May 2014 18:57:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10551 invoked by uid 89); 21 May 2014 18:57:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f171.google.com Received: from mail-pd0-f171.google.com (HELO mail-pd0-f171.google.com) (209.85.192.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 21 May 2014 18:57:29 +0000 Received: by mail-pd0-f171.google.com with SMTP id y13so1654277pdi.2 for ; Wed, 21 May 2014 11:57:27 -0700 (PDT) X-Received: by 10.66.253.170 with SMTP id ab10mr61547040pad.53.1400698647565; Wed, 21 May 2014 11:57:27 -0700 (PDT) Received: from seba.sebabeach.org.gmail.com (173-13-178-50-sfba.hfc.comcastbusiness.net. [173.13.178.50]) by mx.google.com with ESMTPSA id wg7sm9293155pbc.73.2014.05.21.11.57.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 May 2014 11:57:27 -0700 (PDT) From: Doug Evans To: gdb-patches@sourceware.org Subject: [commit] misc minor guile cleanups Date: Wed, 21 May 2014 11:57:09 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Hi. fyi, I have committed this. For reference sake, I have/had a few patches that use gdbscm_scm_to_target_string_unsafe but they're not checked in so this function is currently unused. It can be put back when checked in code uses it. 2014-05-21 Doug Evans * scm-exception.c (gdbscm_invalid_object_error): Make result is void. (gdbscm_out_of_range_error): Ditto. (gdbscm_memory_error): Ditto. * scm-string.c (gdbscm_scm_to_target_string_unsafe): Delete. * guile-internal.h (gdbscm_invalid_object_error): Update. (gdbscm_out_of_range_error): Update. (gdbscm_memory_error): Update. (gdbscm_scm_to_target_string_unsafe): Delete. diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h index f95f092..b6d01f4 100644 --- a/gdb/guile/guile-internal.h +++ b/gdb/guile/guile-internal.h @@ -274,15 +274,15 @@ extern SCM gdbscm_make_type_error (const char *subr, int arg_pos, extern SCM gdbscm_make_invalid_object_error (const char *subr, int arg_pos, SCM bad_value, const char *error); -extern SCM gdbscm_invalid_object_error (const char *subr, int arg_pos, - SCM bad_value, const char *error) +extern void gdbscm_invalid_object_error (const char *subr, int arg_pos, + SCM bad_value, const char *error) ATTRIBUTE_NORETURN; extern SCM gdbscm_make_out_of_range_error (const char *subr, int arg_pos, SCM bad_value, const char *error); -extern SCM gdbscm_out_of_range_error (const char *subr, int arg_pos, - SCM bad_value, const char *error) +extern void gdbscm_out_of_range_error (const char *subr, int arg_pos, + SCM bad_value, const char *error) ATTRIBUTE_NORETURN; extern SCM gdbscm_make_misc_error (const char *subr, int arg_pos, @@ -307,7 +307,8 @@ extern excp_matcher_func gdbscm_memory_error_p; extern SCM gdbscm_make_memory_error (const char *subr, const char *msg, SCM args); -extern SCM gdbscm_memory_error (const char *subr, const char *msg, SCM args); +extern void gdbscm_memory_error (const char *subr, const char *msg, SCM args) + ATTRIBUTE_NORETURN; /* scm-safe-call.c */ @@ -441,9 +442,6 @@ extern char *gdbscm_scm_to_string (SCM string, size_t *lenp, extern SCM gdbscm_scm_from_string (const char *string, size_t len, const char *charset, int strict); -extern char *gdbscm_scm_to_target_string_unsafe (SCM string, size_t *lenp, - struct gdbarch *gdbarch); - /* scm-symbol.c */ extern int syscm_is_symbol (SCM scm); diff --git a/gdb/guile/scm-exception.c b/gdb/guile/scm-exception.c index a96a350..ffe83ed 100644 --- a/gdb/guile/scm-exception.c +++ b/gdb/guile/scm-exception.c @@ -332,7 +332,7 @@ gdbscm_make_invalid_object_error (const char *subr, int arg_pos, SCM bad_value, /* Throw an invalid-object error. OBJECT is the name of the kind of object that is invalid. */ -SCM +void gdbscm_invalid_object_error (const char *subr, int arg_pos, SCM bad_value, const char *object) { @@ -356,7 +356,7 @@ gdbscm_make_out_of_range_error (const char *subr, int arg_pos, SCM bad_value, /* Throw an out-of-range error. This is the standard Guile out-of-range exception. */ -SCM +void gdbscm_out_of_range_error (const char *subr, int arg_pos, SCM bad_value, const char *error) { @@ -387,7 +387,7 @@ gdbscm_make_memory_error (const char *subr, const char *msg, SCM args) /* Throw a gdb:memory-error exception. */ -SCM +void gdbscm_memory_error (const char *subr, const char *msg, SCM args) { SCM exception = gdbscm_make_memory_error (subr, msg, args); diff --git a/gdb/guile/scm-string.c b/gdb/guile/scm-string.c index 87ecabf..c8d81c4 100644 --- a/gdb/guile/scm-string.c +++ b/gdb/guile/scm-string.c @@ -183,19 +183,6 @@ gdbscm_scm_from_string (const char *string, size_t len, return scm_result; } -/* Convert an SCM string to a target string. - This function will thrown a conversion error if there's a problem. - Space for the result is allocated with malloc, caller must free. - It is an error to call this if STRING is not a string. */ - -char * -gdbscm_scm_to_target_string_unsafe (SCM string, size_t *lenp, - struct gdbarch *gdbarch) -{ - return scm_to_stringn (string, lenp, target_charset (gdbarch), - SCM_FAILED_CONVERSION_ERROR); -} - /* (string->argv string) -> list Return list of strings split up according to GDB's argv parsing rules. This is useful when writing GDB commands in Scheme. */