From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [RFC 1/5] Add helper functions check_for_flags and check_for_flags_vqcs
Date: Fri, 18 May 2018 23:39:00 -0000 [thread overview]
Message-ID: <1526679741.1604.9.camel@skynet.be> (raw)
In-Reply-To: <0a630fc9-18bd-6d3b-5558-9a0389c64d4f@simark.ca>
On Thu, 2018-05-17 at 21:22 -0400, Simon Marchi wrote:
> > + /* First set the flags_counts to 0. */
> > + {
> > + const char *f = flags;
> > + while (*f)
> > + {
> > + flags_counts[f - flags] = 0;
> > + f++;
> > + }
> > + }
>
> What about something like
>
> memset (flags_count, 0, sizeof (flags_count[0]) * strlen (flags));
The code initialising the flags_counts is somewhat similar in structure
to the code that increments the flags_counts.
So, it looks more clear to me to have the zero-ing code and
the incrementing code looking like each other.
But if for gdb, using memset is the typical pattern to zero
an array of int, fine for me.
What do you think ?
Philippe
next prev parent reply other threads:[~2018-05-18 21:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-05 19:28 [RFC 0/5] Implenent 'frame apply COMMAND', enhance 'thread apply COMMAND' Philippe Waroquiers
2018-05-05 19:28 ` [RFC 4/5] Documentation changes for 'frame apply' and 'thread apply' Philippe Waroquiers
2018-05-06 19:40 ` Eli Zaretskii
2018-05-05 19:28 ` [RFC 2/5] Implement frame apply [all | COUNT | -COUNT] [-FLAGS...] COMMAND Philippe Waroquiers
2018-05-06 19:16 ` Eli Zaretskii
2018-05-18 1:58 ` Simon Marchi
2018-05-19 5:16 ` Philippe Waroquiers
2018-05-18 9:46 ` Simon Marchi
2018-05-05 19:28 ` [RFC 1/5] Add helper functions check_for_flags and check_for_flags_vqcs Philippe Waroquiers
2018-05-18 1:56 ` Simon Marchi
2018-05-18 23:39 ` Philippe Waroquiers [this message]
2018-05-19 6:47 ` Simon Marchi
2018-05-19 6:59 ` Philippe Waroquiers
2018-05-05 19:28 ` [RFC 5/5] Announce 'frame apply', faas, taas, tfaas commands and -FLAGS... arg for frame apply Philippe Waroquiers
2018-05-06 19:13 ` Eli Zaretskii
2018-05-05 19:28 ` [RFC 3/5] Add -FLAGS... argument to thread apply Philippe Waroquiers
2018-05-06 19:09 ` Eli Zaretskii
2018-05-18 10:42 ` [RFC 0/5] Implenent 'frame apply COMMAND', enhance 'thread apply COMMAND' Simon Marchi
2018-05-18 22:06 ` Philippe Waroquiers
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=1526679741.1604.9.camel@skynet.be \
--to=philippe.waroquiers@skynet.be \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/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