This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cu_offset vs. sect_offset field names bikeshedding [Re: [patch 2/2] typedef-checking for CU relative vs. absolute offsets]


Hi,

On Thu, 08 Mar 2012 22:53:08 +0100, Tom Tromey wrote:
> I think this patch is a good idea.  I find that it does not clutter up
> the code very much (which was my main concern), and it adds type-safety
> to an area where we've clearly already had review and/or reasoning
> failures.

that's great, thanks for the agreement.

Now just how to call them:

> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> Jan> typedef struct { unsigned int co; } cu_offset;
> Jan> typedef struct { unsigned int so; } sect_offset;

I find 'cu_offset' + 'sect_offset' names for the types are OK, any objective?

I do not find 'co' + 'so' great myself.

'val' + 'val' I do not find acceptable, it needs to differ, otherwise the
expressions are a mess, the type of variable is not immediately visible.

'rel_off' + 'abs_off'?  It no longer matches 'cu_offset' + 'sect_offset'.
Moreover rel + abs I do not find so great, cu + sect I find better.

'rel_off' would be 7 characters, 23 lines of 143 lines of the patch would need
reindentation overflowing 80 characters.

	field length | overflown lines of patch
	3	3
	4	7
	5	13
	6	15
	7	23
	8	27
	9	31
	10	35
	11	41
	12	45
	13	47
	14	47
	15	49

Another proposal is 'cu_o' and 'sect_o' or even 'cu_off' or 'sect_off'.


Regards,
Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]