This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Use const reference for decimal_from_string argument
- From: Ulrich Weigand <uweigand at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 24 Oct 2017 16:35:43 -0000
- Subject: [binutils-gdb] Use const reference for decimal_from_string argument
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=09a7c6aa7a07f874f5357cde62b5753a10a5e107
commit 09a7c6aa7a07f874f5357cde62b5753a10a5e107
Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Date: Tue Oct 24 18:34:41 2017 +0200
Use const reference for decimal_from_string argument
No functional change.
gdb/ChangeLog:
2017-10-24 Ulrich Weigand <uweigand@de.ibm.com>
* dfp.h (decimal_from_string): Use const reference for argument.
* dfp.c (decimal_from_string): Likewise.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/dfp.c | 2 +-
gdb/dfp.h | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b84ec6d..7c792a3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2017-10-24 Ulrich Weigand <uweigand@de.ibm.com>
+ * dfp.h (decimal_from_string): Use const reference for argument.
+ * dfp.c (decimal_from_string): Likewise.
+
+2017-10-24 Ulrich Weigand <uweigand@de.ibm.com>
+
* i387-tdep.c (print_i387_value): Use floatformat_to_string.
* sh64-tdep.c (sh64_do_fp_register): Likewise.
* mips-tdep.c (mips_print_fp_register): 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,