This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: type flag bit nits in c-lang.c
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- To: fnf at redhat dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: 08 Dec 2001 23:20:10 -0500
- Subject: Re: RFA: type flag bit nits in c-lang.c
- References: <200112090117.fB91Hl200420@fishpond.ninemoons.com>
Thanks! Please commit this.
Fred Fish <fnf@ns1.ninemoons.com> writes:
>
> The file c-lang.c has a call to init_type() that is immediately
> followed by setting one of the type flag bits in the newly created
> type. All the other calls to init_type() provide the appropriate flag
> bits to init_type(). This patch fixes the oddball call to match the
> other calls to init_type(), and also removes a couple of extraneous
> blank lines that are not in the other case statements.
>
> -Fred
>
> 2001-12-08 Fred Fish <fnf@redhat.com>
>
> * c-lang.c (c_create_fundamental_type): For FT_CHAR, pass
> TYPE_FLAG_NOSIGN to init_type() rather than setting it after the
> type is created.
>
> Index: c-lang.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/c-lang.c,v
> retrieving revision 1.6
> diff -c -p -r1.6 c-lang.c
> *** c-lang.c 2001/03/06 08:21:06 1.6
> --- c-lang.c 2001/12/09 01:18:42
> *************** c_create_fundamental_type (struct objfil
> *** 240,252 ****
> type = init_type (TYPE_CODE_BOOL,
> TARGET_CHAR_BIT / TARGET_CHAR_BIT,
> 0, "bool", objfile);
> -
> break;
> case FT_CHAR:
> type = init_type (TYPE_CODE_INT,
> TARGET_CHAR_BIT / TARGET_CHAR_BIT,
> ! 0, "char", objfile);
> ! TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
> break;
> case FT_SIGNED_CHAR:
> type = init_type (TYPE_CODE_INT,
> --- 240,250 ----
> type = init_type (TYPE_CODE_BOOL,
> TARGET_CHAR_BIT / TARGET_CHAR_BIT,
> 0, "bool", objfile);
> break;
> case FT_CHAR:
> type = init_type (TYPE_CODE_INT,
> TARGET_CHAR_BIT / TARGET_CHAR_BIT,
> ! TYPE_FLAG_NOSIGN, "char", objfile);
> break;
> case FT_SIGNED_CHAR:
> type = init_type (TYPE_CODE_INT,
> *************** c_create_fundamental_type (struct objfil
> *** 337,343 ****
> type = init_type (TYPE_CODE_TEMPLATE_ARG,
> 0,
> 0, "<template arg>", objfile);
> -
> break;
> }
> return (type);
> --- 335,340 ----
>