public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Fix some value comments
Date: Wed,  1 Mar 2023 14:30:09 -0700	[thread overview]
Message-ID: <20230301213009.4030832-1-tromey@adacore.com> (raw)

I noticed a very stale comment in valarith.c.  This patch fixes a few
comments in this area.
---
 gdb/valarith.c | 6 +++++-
 gdb/value.h    | 5 +++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/gdb/valarith.c b/gdb/valarith.c
index 6ea0cd9e8d1..4c2b44360bb 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -1884,7 +1884,7 @@ value_less (struct value *arg1, struct value *arg2)
     }
 }
 \f
-/* The unary operators +, - and ~.  They free the argument ARG1.  */
+/* See value.h.  */
 
 struct value *
 value_pos (struct value *arg1)
@@ -1902,6 +1902,8 @@ value_pos (struct value *arg1)
     error (_("Argument to positive operation not a number."));
 }
 
+/* See value.h.  */
+
 struct value *
 value_neg (struct value *arg1)
 {
@@ -1948,6 +1950,8 @@ value_neg (struct value *arg1)
     error (_("Argument to negate operation not a number."));
 }
 
+/* See value.h.  */
+
 struct value *
 value_complement (struct value *arg1)
 {
diff --git a/gdb/value.h b/gdb/value.h
index c3eb96bf143..d83c4ab3674 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -1206,10 +1206,15 @@ extern struct value *value_ref (struct value *arg1, enum type_code refcode);
 extern struct value *value_assign (struct value *toval,
 				   struct value *fromval);
 
+/* The unary + operation.  */
 extern struct value *value_pos (struct value *arg1);
 
+/* The unary - operation.  */
 extern struct value *value_neg (struct value *arg1);
 
+/* The unary ~ operation -- but note that it also implements the GCC
+   extension, where ~ of a complex number is the complex
+   conjugate.  */
 extern struct value *value_complement (struct value *arg1);
 
 extern struct value *value_struct_elt (struct value **argp,
-- 
2.39.1


             reply	other threads:[~2023-03-01 21:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 21:30 Tom Tromey [this message]
2023-03-02  9:29 ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230301213009.4030832-1-tromey@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).