This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 1/9]#2 Rename `enum target_signal' to target_signal_t
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, Mark Kettenis <mark dot kettenis at xs4all dot nl>, gdb-patches at sourceware dot org
- Date: Wed, 1 Sep 2010 20:29:43 +0200
- Subject: Re: [patch 1/9]#2 Rename `enum target_signal' to target_signal_t
- References: <E1Oq55N-0006ia-B0@fencepost.gnu.org> <20100830140814.GE2986@adacore.com> <20100831182829.GA16136@host1.dyn.jankratochvil.net> <20100901181830.GB2986@adacore.com>
On Wed, 01 Sep 2010 20:18:30 +0200, Joel Brobecker wrote:
> > I would prefer gdb_target_signal_t or also gdb_target_signal.
> >
> > Is one of those approved?
>
> I've just realize that this specific patch really only renames
> the type, in addition to adding a typedef.
>
> I'm just wondering why this is actually useful to you. I would have
> thought that we could avoid this patch entirely, and then let the
> next patch which introduces the gdb_target_signal as a struct just
> update all uses of the enum type. Once the struct has been introduced,
> we could do a rename if we feel that a better name of the enum can
> be found - I think that doing the rename would produce a patch
> that is smaller if done after introducing the struct wrapper first.
I found target_signal_t to be more convenient than `struct target_signal'.
Some coding styles never use the `struct' types and always use typedef for any
struct defined (more matching C++). target_signal operations are mostly fully
encapsulated in the patch so it does not have to be clear to its user it is in
fact a dereferencable struct.
Another point I was tracking with these changes is to make the patching
easier=automatic. I can do s/\benum target_signal\b/target_signal_t/g and be
done with it as strlen rhs is smaller than strlen of lhs.
`struct target_signal' is longer and thus causing line wrapping requiring many
adjustments of GNU coding style 78 columns compliance by hand.
(This reindentation affects also the typedef name `gdb_target_signal_t'
although it would not affect `gdb_target_signal'. Still there would be less
reindentation cases than in the `struct gdb_target_signal' case.)
These were the reasons for the typedef but I do not mind and I can
monkey-patch whatever gets agreed upon and be done with this part which
accidentally became a code cleanup only patch.
Thanks,
Jan