Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org, Tom Tromey <tromey@adacore.com>
Subject: Re: [PATCH 3/5] Let phex and phex_nz handle sizeof_l==1
Date: Tue, 01 Mar 2022 07:32:03 -0700	[thread overview]
Message-ID: <87h78hlp5o.fsf@tromey.com> (raw)
In-Reply-To: <e5cc72be-27ec-52d7-8f8a-6b638ea8ff44@polymtl.ca> (Simon Marchi's message of "Tue, 1 Mar 2022 09:26:50 -0500")

>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

>> str = get_print_cell ();
>> xsnprintf (str, PRINT_CELL_SIZE, "%04x", (unsigned short) (l & 0xffff));
>> break;
>> +    case 1:
>> +      str = get_print_cell ();
>> +      xsnprintf (str, PRINT_CELL_SIZE, "%02x", (unsigned short) (l & 0xff));

Simon> I'm just wondering why you're casting to unsigned short specifically (and not
Simon> unsigned char).  But in practice it works, the patch LGTM.

I just copied the code above.  I think any integer type that isn't wider
than "int" would be ok here, as they all get promoted.

Tom

  reply	other threads:[~2022-03-01 14:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 18:32 [PATCH 0/5] Handle non-ASCII identifiers in Ada Tom Tromey via Gdb-patches
2022-02-28 18:33 ` [PATCH 1/5] Simplify a regular expression in ada-lex.l Tom Tromey via Gdb-patches
2022-02-28 18:33 ` [PATCH 2/5] Don't pre-size result string in ada_decode Tom Tromey via Gdb-patches
2022-02-28 18:33 ` [PATCH 3/5] Let phex and phex_nz handle sizeof_l==1 Tom Tromey via Gdb-patches
2022-03-01 14:26   ` Simon Marchi via Gdb-patches
2022-03-01 14:32     ` Tom Tromey via Gdb-patches [this message]
2022-02-28 18:33 ` [PATCH 4/5] Define HOST_UTF32 in charset.h Tom Tromey via Gdb-patches
2022-02-28 18:33 ` [PATCH 5/5] Handle non-ASCII identifiers in Ada Tom Tromey via Gdb-patches
2022-02-28 18:59   ` Eli Zaretskii via Gdb-patches
2022-02-28 20:59     ` Tom Tromey via Gdb-patches
2022-03-01  3:28       ` Eli Zaretskii via Gdb-patches
2022-03-01 14:49         ` Tom Tromey via Gdb-patches
2022-03-01 15:17           ` Eli Zaretskii via Gdb-patches
2022-03-01 15:33   ` Tom Tromey via Gdb-patches
2022-03-07 14:52 ` [PATCH 0/5] " Tom Tromey via Gdb-patches

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=87h78hlp5o.fsf@tromey.com \
    --to=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --cc=tromey@adacore.com \
    /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