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]

[3/5] FYI: change val_print to return void


I'm checking this in.

Nothing uses val_print's return value.
This changes it to return void.

Tom

b/gdb/ChangeLog:
2012-03-01  Tom Tromey  <tromey@redhat.com>

	* value.h (val_print): Return void.
	* valprint.c (val_print): Return void.

>From df368f7a2096d2e62f1db89d3402495fd0742968 Mon Sep 17 00:00:00 2001
From: Tom Tromey <tromey@redhat.com>
Date: Fri, 3 Feb 2012 08:53:28 -0700
Subject: [PATCH 3/5] change val_print to return void

---
 gdb/ChangeLog  |    5 +++++
 gdb/valprint.c |   17 ++++++-----------
 gdb/value.h    |   12 ++++++------
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/gdb/valprint.c b/gdb/valprint.c
index a543552..0bdde01 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -330,12 +330,9 @@ val_print_invalid_address (struct ui_file *stream)
 
    RECURSE indicates the amount of indentation to supply before
    continuation lines; this amount is roughly twice the value of
-   RECURSE.
+   RECURSE.  */
 
-   If the data is printed as a string, returns the number of string
-   characters printed.  */
-
-int
+void
 val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 	   CORE_ADDR address, struct ui_file *stream, int recurse,
 	   const struct value *val,
@@ -361,11 +358,11 @@ val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
     {
       fprintf_filtered (stream, _("<incomplete type>"));
       gdb_flush (stream);
-      return (0);
+      return;
     }
 
   if (!valprint_check_validity (stream, real_type, embedded_offset, val))
-    return 0;
+    return;
 
   if (!options->raw)
     {
@@ -373,7 +370,7 @@ val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 				      address, stream, recurse,
 				      val, options, language);
       if (ret)
-	return ret;
+	return;
     }
 
   /* Handle summary mode.  If the value is a scalar, print it;
@@ -381,7 +378,7 @@ val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
   if (options->summary && !scalar_type_p (type))
     {
       fprintf_filtered (stream, "...");
-      return 0;
+      return;
     }
 
   TRY_CATCH (except, RETURN_MASK_ERROR)
@@ -392,8 +389,6 @@ val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
     }
   if (except.reason < 0)
     fprintf_filtered (stream, _("<error reading variable>"));
-
-  return ret;
 }
 
 /* Check whether the value VAL is printable.  Return 1 if it is;
diff --git a/gdb/value.h b/gdb/value.h
index bb6f1f6..f0fdb4c 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -817,12 +817,12 @@ extern void value_print_array_elements (struct value *val,
 
 extern struct value *value_release_to_mark (struct value *mark);
 
-extern int val_print (struct type *type, const gdb_byte *valaddr,
-		      int embedded_offset, CORE_ADDR address,
-		      struct ui_file *stream, int recurse,
-		      const struct value *val,
-		      const struct value_print_options *options,
-		      const struct language_defn *language);
+extern void val_print (struct type *type, const gdb_byte *valaddr,
+		       int embedded_offset, CORE_ADDR address,
+		       struct ui_file *stream, int recurse,
+		       const struct value *val,
+		       const struct value_print_options *options,
+		       const struct language_defn *language);
 
 extern void common_val_print (struct value *val,
 			      struct ui_file *stream, int recurse,
-- 
1.7.7.6


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