From patchwork Tue Oct 24 16:36:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 23787 Received: (qmail 87549 invoked by alias); 24 Oct 2017 16:37:56 -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 87425 invoked by uid 89); 24 Oct 2017 16:37:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*de.ibm.com, Hx-languages-length:1202 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Oct 2017 16:37:54 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9OGbgGJ162511 for ; Tue, 24 Oct 2017 12:37:52 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2dt68spxgc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 24 Oct 2017 12:37:50 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Oct 2017 17:36:43 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 24 Oct 2017 17:36:42 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9OGafcR13631680 for ; Tue, 24 Oct 2017 16:36:41 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EEF3FAE04D for ; Tue, 24 Oct 2017 17:30:38 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DEC3CAE045 for ; Tue, 24 Oct 2017 17:30:38 +0100 (BST) Received: from oc3748833570.ibm.com (unknown [9.152.213.178]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP for ; Tue, 24 Oct 2017 17:30:38 +0100 (BST) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id 68B9DD807E2; Tue, 24 Oct 2017 18:36:41 +0200 (CEST) Subject: [pushed] Use const reference for decimal_from_string argument To: gdb-patches@sourceware.org Date: Tue, 24 Oct 2017 18:36:41 +0200 (CEST) From: "Ulrich Weigand" MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17102416-0040-0000-0000-0000040669A6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17102416-0041-0000-0000-000020A8D71A Message-Id: <20171024163641.68B9DD807E2@oc3748833570.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-24_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710240228 Hello, I've just pushed this trivial patch. ChangeLog: * dfp.h (decimal_from_string): Use const reference for argument. * dfp.c (decimal_from_string): Likewise. diff --git a/gdb/dfp.c b/gdb/dfp.c index 1cdb35c..a13e260 100644 --- a/gdb/dfp.c +++ b/gdb/dfp.c @@ -190,7 +190,7 @@ decimal_to_string (const gdb_byte *decbytes, int len, decimal64 and 16 bytes for decimal128. */ bool decimal_from_string (gdb_byte *decbytes, int len, enum bfd_endian byte_order, - std::string string) + const std::string &string) { decContext set; gdb_byte dec[16]; diff --git a/gdb/dfp.h b/gdb/dfp.h index 2f76043..e17f1ce 100644 --- a/gdb/dfp.h +++ b/gdb/dfp.h @@ -31,7 +31,7 @@ extern std::string decimal_to_string (const gdb_byte *, int, enum bfd_endian, const char *format = nullptr); extern bool decimal_from_string (gdb_byte *, int, enum bfd_endian, - std::string string); + const std::string &string); extern void decimal_from_longest (LONGEST from, gdb_byte *to, int len, enum bfd_endian byte_order); extern void decimal_from_ulongest (ULONGEST from, gdb_byte *to,