This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[pushed] Use const reference for decimal_from_string argument


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,
-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]