From 015dc7e1f8a971692a910e6cfc64faf9216e75c3 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 31 Mar 2021 10:39:37 +1030 Subject: Use bool in binutils * sysdep.h (POISON_BFD_BOOLEAN): Define. * addr2line.c, * ar.c, * arsup.c, * bfdtest2.c, * binemul.c, * binemul.h, * bucomm.c, * bucomm.h, * budbg.h, * coffgrok.c, * debug.c, * debug.h, * dlltool.c, * dwarf.c, * dwarf.h, * elfedit.c, * emul_aix.c, * mclex.c, * nm.c, * objcopy.c, * objdump.c, * od-macho.c, * prdbg.c, * rdcoff.c, * rddbg.c, * readelf.c, * rename.c, * stabs.c, * strings.c, * windint.h, * windmc.c, * windmc.h, * windres.c, * winduni.c, * wrstabs.c: Replace bfd_boolean with bool, FALSE with false, and TRUE with true throughout. --- binutils/rdcoff.c | 138 +++++++++++++++++++++++++++--------------------------- 1 file changed, 69 insertions(+), 69 deletions(-) (limited to 'binutils/rdcoff.c') diff --git a/binutils/rdcoff.c b/binutils/rdcoff.c index 8e2ae07..a00e39f 100644 --- a/binutils/rdcoff.c +++ b/binutils/rdcoff.c @@ -86,7 +86,7 @@ struct coff_types static debug_type *coff_get_slot (struct coff_types *, long); static debug_type parse_coff_type (bfd *, struct coff_symbols *, struct coff_types *, long, int, - union internal_auxent *, bfd_boolean, void *); + union internal_auxent *, bool, void *); static debug_type parse_coff_base_type (bfd *, struct coff_symbols *, struct coff_types *, long, int, union internal_auxent *, void *); @@ -96,10 +96,10 @@ static debug_type parse_coff_struct_type static debug_type parse_coff_enum_type (bfd *, struct coff_symbols *, struct coff_types *, union internal_auxent *, void *); -static bfd_boolean parse_coff_symbol +static bool parse_coff_symbol (bfd *, struct coff_types *, asymbol *, long, struct internal_syment *, - void *, debug_type, bfd_boolean); -static bfd_boolean external_coff_symbol_p (int sym_class); + void *, debug_type, bool); +static bool external_coff_symbol_p (int sym_class); /* Return the slot for a type. */ @@ -140,7 +140,7 @@ coff_get_slot (struct coff_types *types, long indx) static debug_type parse_coff_type (bfd *abfd, struct coff_symbols *symbols, struct coff_types *types, long coff_symno, int ntype, - union internal_auxent *pauxent, bfd_boolean useaux, + union internal_auxent *pauxent, bool useaux, void *dhandle) { debug_type type; @@ -162,7 +162,7 @@ parse_coff_type (bfd *abfd, struct coff_symbols *symbols, type = parse_coff_type (abfd, symbols, types, coff_symno, newtype, pauxent, useaux, dhandle); type = debug_make_function_type (dhandle, type, (debug_type *) NULL, - FALSE); + false); } else if (ISARY (ntype)) { @@ -188,14 +188,14 @@ parse_coff_type (bfd *abfd, struct coff_symbols *symbols, } type = parse_coff_type (abfd, symbols, types, coff_symno, newtype, - pauxent, FALSE, dhandle); + pauxent, false, dhandle); type = debug_make_array_type (dhandle, type, parse_coff_base_type (abfd, symbols, types, coff_symno, T_INT, NULL, dhandle), - 0, n - 1, FALSE); + 0, n - 1, false); } else { @@ -240,7 +240,7 @@ parse_coff_base_type (bfd *abfd, struct coff_symbols *symbols, union internal_auxent *pauxent, void *dhandle) { debug_type ret; - bfd_boolean set_basic; + bool set_basic; const char *name; debug_type *slot; @@ -249,7 +249,7 @@ parse_coff_base_type (bfd *abfd, struct coff_symbols *symbols, && types->basic[ntype] != DEBUG_TYPE_NULL) return types->basic[ntype]; - set_basic = TRUE; + set_basic = true; name = NULL; switch (ntype) @@ -265,23 +265,23 @@ parse_coff_base_type (bfd *abfd, struct coff_symbols *symbols, break; case T_CHAR: - ret = debug_make_int_type (dhandle, 1, FALSE); + ret = debug_make_int_type (dhandle, 1, false); name = "char"; break; case T_SHORT: - ret = debug_make_int_type (dhandle, 2, FALSE); + ret = debug_make_int_type (dhandle, 2, false); name = "short"; break; case T_INT: /* FIXME: Perhaps the size should depend upon the architecture. */ - ret = debug_make_int_type (dhandle, 4, FALSE); + ret = debug_make_int_type (dhandle, 4, false); name = "int"; break; case T_LONG: - ret = debug_make_int_type (dhandle, 4, FALSE); + ret = debug_make_int_type (dhandle, 4, false); name = "long"; break; @@ -301,28 +301,28 @@ parse_coff_base_type (bfd *abfd, struct coff_symbols *symbols, break; case T_UCHAR: - ret = debug_make_int_type (dhandle, 1, TRUE); + ret = debug_make_int_type (dhandle, 1, true); name = "unsigned char"; break; case T_USHORT: - ret = debug_make_int_type (dhandle, 2, TRUE); + ret = debug_make_int_type (dhandle, 2, true); name = "unsigned short"; break; case T_UINT: - ret = debug_make_int_type (dhandle, 4, TRUE); + ret = debug_make_int_type (dhandle, 4, true); name = "unsigned int"; break; case T_ULONG: - ret = debug_make_int_type (dhandle, 4, TRUE); + ret = debug_make_int_type (dhandle, 4, true); name = "unsigned long"; break; case T_STRUCT: if (pauxent == NULL) - ret = debug_make_struct_type (dhandle, TRUE, 0, + ret = debug_make_struct_type (dhandle, true, 0, (debug_field *) NULL); else ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, @@ -331,12 +331,12 @@ parse_coff_base_type (bfd *abfd, struct coff_symbols *symbols, slot = coff_get_slot (types, coff_symno); *slot = ret; - set_basic = FALSE; + set_basic = false; break; case T_UNION: if (pauxent == NULL) - ret = debug_make_struct_type (dhandle, FALSE, 0, (debug_field *) NULL); + ret = debug_make_struct_type (dhandle, false, 0, (debug_field *) NULL); else ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle); @@ -344,7 +344,7 @@ parse_coff_base_type (bfd *abfd, struct coff_symbols *symbols, slot = coff_get_slot (types, coff_symno); *slot = ret; - set_basic = FALSE; + set_basic = false; break; case T_ENUM: @@ -357,7 +357,7 @@ parse_coff_base_type (bfd *abfd, struct coff_symbols *symbols, slot = coff_get_slot (types, coff_symno); *slot = ret; - set_basic = FALSE; + set_basic = false; break; } @@ -383,7 +383,7 @@ parse_coff_struct_type (bfd *abfd, struct coff_symbols *symbols, int alloc; debug_field *fields; int count; - bfd_boolean done; + bool done; symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l; @@ -391,7 +391,7 @@ parse_coff_struct_type (bfd *abfd, struct coff_symbols *symbols, fields = (debug_field *) xmalloc (alloc * sizeof *fields); count = 0; - done = FALSE; + done = false; while (! done && symbols->coff_symno < symend && symbols->symno < symbols->symcount) @@ -446,7 +446,7 @@ parse_coff_struct_type (bfd *abfd, struct coff_symbols *symbols, break; case C_EOS: - done = TRUE; + done = true; break; } @@ -456,7 +456,7 @@ parse_coff_struct_type (bfd *abfd, struct coff_symbols *symbols, debug_field f; ftype = parse_coff_type (abfd, symbols, types, this_coff_symno, - syment.n_type, psubaux, TRUE, dhandle); + syment.n_type, psubaux, true, dhandle); f = debug_make_field (dhandle, bfd_asymbol_name (sym), ftype, bitpos, bitsize, DEBUG_VISIBILITY_PUBLIC); if (f == DEBUG_FIELD_NULL) @@ -493,7 +493,7 @@ parse_coff_enum_type (bfd *abfd, struct coff_symbols *symbols, const char **names; bfd_signed_vma *vals; int count; - bfd_boolean done; + bool done; symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l; @@ -502,7 +502,7 @@ parse_coff_enum_type (bfd *abfd, struct coff_symbols *symbols, vals = (bfd_signed_vma *) xmalloc (alloc * sizeof *vals); count = 0; - done = FALSE; + done = false; while (! done && symbols->coff_symno < symend && symbols->symno < symbols->symcount) @@ -542,7 +542,7 @@ parse_coff_enum_type (bfd *abfd, struct coff_symbols *symbols, break; case C_EOS: - done = TRUE; + done = true; break; } } @@ -554,11 +554,11 @@ parse_coff_enum_type (bfd *abfd, struct coff_symbols *symbols, /* Handle a single COFF symbol. */ -static bfd_boolean +static bool parse_coff_symbol (bfd *abfd ATTRIBUTE_UNUSED, struct coff_types *types, asymbol *sym, long coff_symno, struct internal_syment *psyment, void *dhandle, - debug_type type, bfd_boolean within_function) + debug_type type, bool within_function) { switch (psyment->n_sclass) { @@ -568,14 +568,14 @@ parse_coff_symbol (bfd *abfd ATTRIBUTE_UNUSED, struct coff_types *types, case C_AUTO: if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type, DEBUG_LOCAL, bfd_asymbol_value (sym))) - return FALSE; + return false; break; case C_WEAKEXT: case C_EXT: if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type, DEBUG_GLOBAL, bfd_asymbol_value (sym))) - return FALSE; + return false; break; case C_STAT: @@ -584,14 +584,14 @@ parse_coff_symbol (bfd *abfd ATTRIBUTE_UNUSED, struct coff_types *types, ? DEBUG_LOCAL_STATIC : DEBUG_STATIC), bfd_asymbol_value (sym))) - return FALSE; + return false; break; case C_REG: /* FIXME: We may need to convert the register number. */ if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type, DEBUG_REGISTER, bfd_asymbol_value (sym))) - return FALSE; + return false; break; case C_LABEL: @@ -600,20 +600,20 @@ parse_coff_symbol (bfd *abfd ATTRIBUTE_UNUSED, struct coff_types *types, case C_ARG: if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type, DEBUG_PARM_STACK, bfd_asymbol_value (sym))) - return FALSE; + return false; break; case C_REGPARM: /* FIXME: We may need to convert the register number. */ if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type, DEBUG_PARM_REG, bfd_asymbol_value (sym))) - return FALSE; + return false; break; case C_TPDEF: type = debug_name_type (dhandle, bfd_asymbol_name (sym), type); if (type == DEBUG_TYPE_NULL) - return FALSE; + return false; break; case C_STRTAG: @@ -624,7 +624,7 @@ parse_coff_symbol (bfd *abfd ATTRIBUTE_UNUSED, struct coff_types *types, type = debug_tag_type (dhandle, bfd_asymbol_name (sym), type); if (type == DEBUG_TYPE_NULL) - return FALSE; + return false; /* Store the named type into the slot, so that references get the name. */ @@ -637,29 +637,29 @@ parse_coff_symbol (bfd *abfd ATTRIBUTE_UNUSED, struct coff_types *types, break; } - return TRUE; + return true; } /* Determine if a symbol has external visibility. */ -static bfd_boolean +static bool external_coff_symbol_p (int sym_class) { switch (sym_class) { case C_EXT: case C_WEAKEXT: - return TRUE; + return true; default: break; } - return FALSE; + return false; } /* This is the main routine. It looks through all the symbols and handles them. */ -bfd_boolean +bool parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) { struct coff_symbols symbols; @@ -671,7 +671,7 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) int fntype; bfd_vma fnend; alent *linenos; - bfd_boolean within_function; + bool within_function; long this_coff_symno; symbols.syms = syms; @@ -689,7 +689,7 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) fntype = 0; fnend = 0; linenos = NULL; - within_function = FALSE; + within_function = false; while (symbols.symno < symcount) { @@ -706,7 +706,7 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) { non_fatal (_("bfd_coff_get_syment failed: %s"), bfd_errmsg (bfd_get_error ())); - return FALSE; + return false; } name = bfd_asymbol_name (sym); @@ -726,7 +726,7 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) { non_fatal (_("bfd_coff_get_auxent failed: %s"), bfd_errmsg (bfd_get_error ())); - return FALSE; + return false; } paux = &auxent; } @@ -736,7 +736,7 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) /* The last C_FILE symbol points to the first external symbol. */ if (! debug_set_filename (dhandle, "*globals*")) - return FALSE; + return false; } switch (syment.n_sclass) @@ -754,7 +754,7 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) case C_FILE: next_c_file = syment.n_value; if (! debug_set_filename (dhandle, name)) - return FALSE; + return false; break; case C_STAT: @@ -778,12 +778,12 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) break; } type = parse_coff_type (abfd, &symbols, &types, this_coff_symno, - syment.n_type, paux, TRUE, dhandle); + syment.n_type, paux, true, dhandle); if (type == DEBUG_TYPE_NULL) - return FALSE; + return false; if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment, dhandle, type, within_function)) - return FALSE; + return false; break; case C_FCN: @@ -793,18 +793,18 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) { non_fatal (_("%ld: .bf without preceding function"), this_coff_symno); - return FALSE; + return false; } type = parse_coff_type (abfd, &symbols, &types, this_coff_symno, - DECREF (fntype), paux, FALSE, dhandle); + DECREF (fntype), paux, false, dhandle); if (type == DEBUG_TYPE_NULL) - return FALSE; + return false; if (! debug_record_function (dhandle, fnname, type, external_coff_symbol_p (fnclass), bfd_asymbol_value (sym))) - return FALSE; + return false; if (linenos != NULL) { @@ -825,7 +825,7 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) if (! debug_record_line (dhandle, linenos->line_number + base, linenos->u.offset + addr)) - return FALSE; + return false; ++linenos; } } @@ -835,23 +835,23 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) fnclass = 0; fntype = 0; - within_function = TRUE; + within_function = true; } else if (strcmp (name, ".ef") == 0) { if (! within_function) { non_fatal (_("%ld: unexpected .ef\n"), this_coff_symno); - return FALSE; + return false; } if (bfd_asymbol_value (sym) > fnend) fnend = bfd_asymbol_value (sym); if (! debug_end_function (dhandle, fnend)) - return FALSE; + return false; fnend = 0; - within_function = FALSE; + within_function = false; } break; @@ -859,26 +859,26 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) if (strcmp (name, ".bb") == 0) { if (! debug_start_block (dhandle, bfd_asymbol_value (sym))) - return FALSE; + return false; } else if (strcmp (name, ".eb") == 0) { if (! debug_end_block (dhandle, bfd_asymbol_value (sym))) - return FALSE; + return false; } break; default: type = parse_coff_type (abfd, &symbols, &types, this_coff_symno, - syment.n_type, paux, TRUE, dhandle); + syment.n_type, paux, true, dhandle); if (type == DEBUG_TYPE_NULL) - return FALSE; + return false; if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment, dhandle, type, within_function)) - return FALSE; + return false; break; } } - return TRUE; + return true; } -- cgit v1.1