From: Jim Wilson <jimw@sifive.com>
To: gdb-patches@sourceware.org
Cc: Jim Wilson <jimw@sifive.com>
Subject: [PATCH 2/2] Improve comments in print-utils.h.
Date: Thu, 10 Oct 2019 23:55:00 -0000 [thread overview]
Message-ID: <20191010235523.27098-1-jimw@sifive.com> (raw)
In-Reply-To: <CAFyWVaYZZ4PNygCCbXfKPDZMAvKgZYTn+yqzJkXRYbH3z_tVQg@mail.gmail.com>
Since I had to look at these function comments to fix the RISC-V ARI warnings,
I noticed that they make no sense. The pulongest and plongest comments are
swapped. phex is missing a comment. And phex_nz doesn't mention how it is
different from phex.
* gdbsupport/print-utils.h (pulongest): Fix comment.
(plongest): Likewise.
(phex): Add missing comment, mention leading zeros.
(phex_nz): Add mention of no leading zeros to comment.
---
gdb/gdbsupport/print-utils.h | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/gdb/gdbsupport/print-utils.h b/gdb/gdbsupport/print-utils.h
index 815b14cbed..d52bcf8f61 100644
--- a/gdb/gdbsupport/print-utils.h
+++ b/gdb/gdbsupport/print-utils.h
@@ -24,20 +24,23 @@
cell. */
#define PRINT_CELL_SIZE 50
-/* %d for LONGEST. The result is stored in a circular static buffer,
+/* %u for ULONGEST. The result is stored in a circular static buffer,
NUMCELLS deep. */
extern char *pulongest (ULONGEST u);
-/* %u for ULONGEST. The result is stored in a circular static buffer,
+/* %d for LONGEST. The result is stored in a circular static buffer,
NUMCELLS deep. */
extern char *plongest (LONGEST l);
+/* Convert a ULONGEST into a HEX string, like %lx, with leading zeros.
+ The result is stored in a circular static buffer, NUMCELLS deep. */
+
extern char *phex (ULONGEST l, int sizeof_l);
-/* Convert a ULONGEST into a HEX string, like %lx. The result is
- stored in a circular static buffer, NUMCELLS deep. */
+/* Convert a ULONGEST into a HEX string, like %lx, without leading zeros.
+ The result is stored in a circular static buffer, NUMCELLS deep. */
extern char *phex_nz (ULONGEST l, int sizeof_l);
--
2.17.1
next prev parent reply other threads:[~2019-10-10 23:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 23:54 [PATCH 0/2] fix ARI warnings for RISC-V port and fallout Jim Wilson
2019-10-10 23:55 ` [PATCH 1/2] RISC-V: Fix two ARI warnings Jim Wilson
2019-10-10 23:55 ` Jim Wilson [this message]
2019-10-11 13:15 ` [PATCH 0/2] fix ARI warnings for RISC-V port and fallout Tom Tromey
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=20191010235523.27098-1-jimw@sifive.com \
--to=jimw@sifive.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).