Commit b34976b6 authored by Alan Modra's avatar Alan Modra

s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. Simplify

comparisons of bfd_boolean vars with TRUE/FALSE.  Formatting.
parent 583d52d7
2002-11-30 Alan Modra <amodra@bigpond.net.au>
* bfd-in.h (TRUE_FALSE_ALREADY_DEFINED, BFD_TRUE_FALSE): Delete.
(enum bfd_boolean, boolean): Delete.
(bfd_boolean): Typedef to an int.
(FALSE, TRUE): Define.
* aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c, aout-cris.c,
aout-encap.c, aout-ns32k.c, aout-target.h, aout-tic30.c, aoutf1.h,
aoutx.h, archive.c, archive64.c, archures.c, bfd-in.h, bfd.c, bfdwin.c,
binary.c, bout.c, cache.c, cisco-core.c, coff-a29k.c, coff-alpha.c,
coff-apollo.c, coff-arm.c, coff-aux.c, coff-h8300.c, coff-h8500.c,
coff-i386.c, coff-i860.c, coff-i960.c, coff-ia64.c, coff-m68k.c,
coff-m88k.c, coff-mcore.c, coff-mips.c, coff-or32.c, coff-ppc.c,
coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, coff-tic30.c,
coff-tic4x.c, coff-tic54x.c, coff-tic80.c, coff-w65.c, coff-we32k.c,
coff-z8k.c, coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c,
corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c,
cpu-cris.c, cpu-d10v.c, cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c,
cpu-h8300.c, cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c,
cpu-i860.c, cpu-i960.c, cpu-ia64.c, cpu-ip2k.c, cpu-m10200.c,
cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c, cpu-m68hc12.c, cpu-m68k.c,
cpu-m88k.c, cpu-mcore.c, cpu-mips.c, cpu-mmix.c, cpu-ns32k.c,
cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c,
cpu-rs6000.c, cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c,
cpu-tic4x.c, cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c,
cpu-w65.c, cpu-we32k.c, cpu-xstormy16.c, cpu-z8k.c, dwarf1.c,
dwarf2.c, ecoff.c, ecofflink.c, efi-app-ia32.c, efi-app-ia64.c,
elf-bfd.h, elf-eh-frame.c, elf-hppa.h, elf-m10200.c, elf-m10300.c,
elf-strtab.c, elf.c, elf32-arc.c, elf32-arm.h, elf32-avr.c,
elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c,
elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-hppa.h,
elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
elf32-pj.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-sh64-com.c,
elf32-sh64.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c,
elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c,
elfarm-oabi.c, elfcode.h, elfcore.h, elflink.c, elflink.h,
elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h,
elfxx-target.h, format.c, freebsd.h, genlink.h, hash.c, hp300hpux.c,
hppabsd-core.c, hpux-core.c, i386aout.c, i386linux.c, i386lynx.c,
i386mach3.c, i386msdos.c, i386os9k.c, ieee.c, ihex.c, irix-core.c,
libaout.h, libbfd-in.h, libbfd.c, libcoff-in.h, libecoff.h, libieee.h,
libnlm.h, liboasys.h, libpei.h, libxcoff.h, linker.c, lynx-core.c,
m68klinux.c, m68klynx.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c,
mmo.c, netbsd-core.c, netbsd.h, nlm.c, nlm32-alpha.c, nlm32-i386.c,
nlm32-ppc.c, nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c, pe-mcore.c, pe-mips.c,
pe-sh.c, peXXigen.c, pef.c, pei-arm.c, pei-i386.c, pei-mcore.c,
pei-mips.c, pei-sh.c, peicode.h, ppcboot.c, ptrace-core.c, reloc.c,
reloc16.c, riscix.c, rs6000-core.c, sco5-core.c, section.c, simple.c,
som.c, som.h, sparclinux.c, sparclynx.c, srec.c, stabs.c, sunos.c,
syms.c, targets.c, tekhex.c, ticoff.h, trad-core.c, versados.c,
vms-gsd.c, vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h,
xcoff-target.h, xcofflink.c, xsym.c, xsym.h: Replace boolean with
bfd_boolean, true with TRUE, false with FALSE. Simplify comparisons
of bfd_boolean vars with TRUE/FALSE. Formatting.
* bfd-in2.h, libbfd.h, libcoff.h: Regenerate
2002-11-28 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h: Replace occurrences of Elf32_Internal_* and
......
......@@ -204,13 +204,13 @@ aix386_core_file_failing_signal (abfd)
return core_hdr (abfd)->cd_cursig;
}
static boolean
static bfd_boolean
aix386_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd;
bfd *exec_bfd;
{
/* FIXME: We have no way of telling at this point. */
return true;
return TRUE;
}
/* If somebody calls any byte-swapping routines, shoot them. */
......
......@@ -28,10 +28,14 @@
#include "sysdep.h"
#include "libbfd.h"
const bfd_target * xcoff64_core_p PARAMS ((bfd *));
boolean xcoff64_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
char * xcoff64_core_file_failing_command PARAMS ((bfd *));
int xcoff64_core_file_failing_signal PARAMS ((bfd *));
const bfd_target *xcoff64_core_p
PARAMS ((bfd *));
bfd_boolean xcoff64_core_file_matches_executable_p
PARAMS ((bfd *, bfd *));
char *xcoff64_core_file_failing_command
PARAMS ((bfd *));
int xcoff64_core_file_failing_signal
PARAMS ((bfd *));
/* Aix 5.1 system include file. */
......@@ -62,11 +66,11 @@ xcoff64_core_p (abfd)
if (bfd_seek (abfd, 0, SEEK_SET) != 0)
goto xcoff64_core_p_error;
if (sizeof (struct core_dumpxx)
if (sizeof (struct core_dumpxx)
!= bfd_bread (&core, sizeof (struct core_dumpxx), abfd))
goto xcoff64_core_p_error;
if (bfd_stat (abfd, &statbuf) < 0)
if (bfd_stat (abfd, &statbuf) < 0)
goto xcoff64_core_p_error;
/* Sanity checks
......@@ -82,24 +86,24 @@ xcoff64_core_p (abfd)
See rs6000-core.c for comment on size of core
If there isn't enough of a real core file, bail. */
if ((CORE_VERSION_1 != (core.c_flag & CORE_VERSION_1))
|| (0 != core.c_entries)
|| (! (IS_PROC64 (&core.c_u.U_proc)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_fdsinfox)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_loader)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_loader + core.c_lsize)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_thr)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_segregion)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_stack)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_stack + core.c_size)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_data)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_data + core.c_datasize)))
|| (! (core.c_flag & UBLOCK_VALID))
|| (! (core.c_flag & LE_VALID)))
if ((CORE_VERSION_1 != (core.c_flag & CORE_VERSION_1))
|| (0 != core.c_entries)
|| (! (IS_PROC64 (&core.c_u.U_proc)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_fdsinfox)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_loader)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_loader + core.c_lsize)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_thr)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_segregion)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_stack)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_stack + core.c_size)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_data)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_data + core.c_datasize)))
|| (! (core.c_flag & UBLOCK_VALID))
|| (! (core.c_flag & LE_VALID)))
goto xcoff64_core_p_error;
/* Check for trucated stack or general truncating. */
if ((! (core.c_flag & USTACK_VALID))
if ((! (core.c_flag & USTACK_VALID))
|| (core.c_flag & CORE_TRUNC))
{
bfd_set_error (bfd_error_file_truncated);
......@@ -109,7 +113,7 @@ xcoff64_core_p (abfd)
new_core_hdr = (struct core_dumpxx *)
bfd_zalloc (abfd, sizeof (struct core_dumpxx));
if (NULL == new_core_hdr)
if (NULL == new_core_hdr)
return return_value;
memcpy (new_core_hdr, &core, sizeof (struct core_dumpxx));
......@@ -117,7 +121,7 @@ xcoff64_core_p (abfd)
/* .stack section. */
sec = bfd_make_section_anyway (abfd, ".stack");
if (NULL == sec)
if (NULL == sec)
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
......@@ -127,7 +131,7 @@ xcoff64_core_p (abfd)
/* .reg section for all registers. */
sec = bfd_make_section_anyway (abfd, ".reg");
if (NULL == sec)
if (NULL == sec)
return return_value;
sec->flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY;
......@@ -138,7 +142,7 @@ xcoff64_core_p (abfd)
/* .ldinfo section.
To actually find out how long this section is in this particular
core dump would require going down the whole list of struct
core dump would require going down the whole list of struct
ld_info's. See if we can just fake it. */
sec = bfd_make_section_anyway (abfd, ".ldinfo");
if (NULL == sec)
......@@ -152,10 +156,10 @@ xcoff64_core_p (abfd)
/* AIX 4 adds data sections from loaded objects to the core file,
which can be found by examining ldinfo, and anonymously mmapped
regions. */
/* .data section from executable. */
sec = bfd_make_section_anyway (abfd, ".data");
if (NULL == sec)
if (NULL == sec)
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
......@@ -165,20 +169,20 @@ xcoff64_core_p (abfd)
/* .data sections from loaded objects. */
ld_offset = core.c_loader;
while (1)
while (1)
{
if (bfd_seek (abfd, ld_offset, SEEK_SET) != 0)
if (bfd_seek (abfd, ld_offset, SEEK_SET) != 0)
return return_value;
if (sizeof (struct __ld_info64) !=
bfd_bread (&ldinfo, sizeof (struct __ld_info64), abfd))
bfd_bread (&ldinfo, sizeof (struct __ld_info64), abfd))
return return_value;
if (ldinfo.ldinfo_core)
if (ldinfo.ldinfo_core)
{
sec = bfd_make_section_anyway (abfd, ".data");
if (NULL == sec)
if (NULL == sec)
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
......@@ -193,20 +197,20 @@ xcoff64_core_p (abfd)
}
/* .vmdata sections from anonymously mmapped regions. */
if (core.c_vmregions)
if (core.c_vmregions)
{
if (bfd_seek (abfd, core.c_vmm, SEEK_SET) != 0)
if (bfd_seek (abfd, core.c_vmm, SEEK_SET) != 0)
return return_value;
for (i = 0; i < core.c_vmregions; i++)
for (i = 0; i < core.c_vmregions; i++)
if (sizeof (struct vm_infox) !=
bfd_bread (&vminfo, sizeof (struct vm_infox), abfd))
bfd_bread (&vminfo, sizeof (struct vm_infox), abfd))
return return_value;
if (vminfo.vminfo_offset)
if (vminfo.vminfo_offset)
{
sec = bfd_make_section_anyway (abfd, ".vmdata");
if (NULL == sec)
if (NULL == sec)
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
......@@ -217,17 +221,17 @@ xcoff64_core_p (abfd)
}
return_value = abfd->xvec; /* This is garbage for now. */
xcoff64_core_p_error:
if (bfd_get_error () != bfd_error_system_call)
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
return return_value;
}
/* Return `true' if given core is from the given executable. */
/* Return `TRUE' if given core is from the given executable. */
boolean
bfd_boolean
xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd;
bfd *exec_bfd;
......@@ -236,22 +240,22 @@ xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
char *path, *s;
size_t alloc;
const char *str1, *str2;
boolean return_value = false;
bfd_boolean return_value = FALSE;
/* Get the header. */
if (bfd_seek (core_bfd, 0, SEEK_SET) != 0)
if (bfd_seek (core_bfd, 0, SEEK_SET) != 0)
return return_value;
if (sizeof (struct core_dumpxx) !=
bfd_bread (&core, sizeof (struct core_dumpxx), core_bfd))
bfd_bread (&core, sizeof (struct core_dumpxx), core_bfd))
return return_value;
if (bfd_seek (core_bfd, core.c_loader, SEEK_SET) != 0)
if (bfd_seek (core_bfd, core.c_loader, SEEK_SET) != 0)
return return_value;
alloc = 100;
path = bfd_malloc (alloc);
if (path == NULL)
if (path == NULL)
return return_value;
s = path;
......@@ -264,13 +268,13 @@ xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
if (*s == '\0')
break;
++s;
if (s == path + alloc)
if (s == path + alloc)
{
char *n;
alloc *= 2;
n = bfd_realloc (path, alloc);
if (n == NULL)
if (n == NULL)
goto xcoff64_core_file_matches_executable_p_end_1;
s = n + (path - s);
......@@ -285,8 +289,8 @@ xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
str1 = str1 != NULL ? str1 + 1 : path;
str2 = str2 != NULL ? str2 + 1 : exec_bfd->filename;
if (strcmp (str1, str2) == 0)
return_value = true;
if (strcmp (str1, str2) == 0)
return_value = TRUE;
xcoff64_core_file_matches_executable_p_end_1:
free (path);
......@@ -300,7 +304,7 @@ xcoff64_core_file_failing_command (abfd)
struct core_dumpxx *c = core_hdr (abfd);
char *return_value = 0;
if (NULL != c)
if (NULL != c)
return_value = c->c_u.U_proc.pi_comm;
return return_value;
......@@ -313,7 +317,7 @@ xcoff64_core_file_failing_signal (abfd)
struct core_dumpxx *c = core_hdr (abfd);
int return_value = 0;
if (NULL != c)
if (NULL != c)
return_value = c->c_signo;
return return_value;
......@@ -321,10 +325,14 @@ xcoff64_core_file_failing_signal (abfd)
#else /* AIX_5_CORE */
const bfd_target * xcoff64_core_p PARAMS ((bfd *));
boolean xcoff64_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
char * xcoff64_core_file_failing_command PARAMS ((bfd *));
int xcoff64_core_file_failing_signal PARAMS ((bfd *));
const bfd_target *xcoff64_core_p
PARAMS ((bfd *));
bfd_boolean xcoff64_core_file_matches_executable_p
PARAMS ((bfd *, bfd *));
char *xcoff64_core_file_failing_command
PARAMS ((bfd *));
int xcoff64_core_file_failing_signal
PARAMS ((bfd *));
const bfd_target *
xcoff64_core_p (abfd)
......@@ -334,12 +342,12 @@ xcoff64_core_p (abfd)
return 0;
}
boolean
bfd_boolean
xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd ATTRIBUTE_UNUSED;
bfd *exec_bfd ATTRIBUTE_UNUSED;
{
return false;
return FALSE;
}
char *
......
......@@ -32,19 +32,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Forward decl. */
extern const bfd_target a_out_adobe_vec;
static const bfd_target *aout_adobe_callback PARAMS ((bfd *));
extern boolean aout_32_slurp_symbol_table PARAMS ((bfd *abfd));
extern boolean aout_32_write_syms PARAMS ((bfd *));
static void aout_adobe_write_section PARAMS ((bfd *abfd, sec_ptr sect));
static const bfd_target * aout_adobe_object_p PARAMS ((bfd *));
static boolean aout_adobe_mkobject PARAMS ((bfd *));
static boolean aout_adobe_write_object_contents PARAMS ((bfd *));
static boolean aout_adobe_set_section_contents
static const bfd_target *aout_adobe_callback
PARAMS ((bfd *));
extern bfd_boolean aout_32_slurp_symbol_table
PARAMS ((bfd *abfd));
extern bfd_boolean aout_32_write_syms
PARAMS ((bfd *));
static void aout_adobe_write_section
PARAMS ((bfd *abfd, sec_ptr sect));
static const bfd_target * aout_adobe_object_p
PARAMS ((bfd *));
static bfd_boolean aout_adobe_mkobject
PARAMS ((bfd *));
static bfd_boolean aout_adobe_write_object_contents
PARAMS ((bfd *));
static bfd_boolean aout_adobe_set_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
static boolean aout_adobe_set_arch_mach
static bfd_boolean aout_adobe_set_arch_mach
PARAMS ((bfd *, enum bfd_architecture, unsigned long));
static int aout_adobe_sizeof_headers PARAMS ((bfd *, boolean));
static int aout_adobe_sizeof_headers
PARAMS ((bfd *, bfd_boolean));
/* Swaps the information in an executable header taken from a raw byte
stream memory image, into the internal exec_header structure. */
......@@ -271,7 +278,7 @@ struct bout_data_struct
struct internal_exec e;
};
static boolean
static bfd_boolean
aout_adobe_mkobject (abfd)
bfd *abfd;
{
......@@ -280,7 +287,7 @@ aout_adobe_mkobject (abfd)
rawptr = (struct bout_data_struct *) bfd_zalloc (abfd, amt);
if (rawptr == NULL)
return false;
return FALSE;
abfd->tdata.bout_data = rawptr;
exec_hdr (abfd) = &rawptr->e;
......@@ -291,10 +298,10 @@ aout_adobe_mkobject (abfd)
adata (abfd).segment_size = 1; /* Not applicable. */
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return true;
return TRUE;
}
static boolean
static bfd_boolean
aout_adobe_write_object_contents (abfd)
bfd *abfd;
{
......@@ -342,7 +349,7 @@ aout_adobe_write_object_contents (abfd)
amt = EXEC_BYTES_SIZE;
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
|| bfd_bwrite ((PTR) &swapped_hdr, amt, abfd) != amt)
return false;
return FALSE;
/* Now write out the section information. Text first, data next, rest
afterward. */
......@@ -362,38 +369,38 @@ aout_adobe_write_object_contents (abfd)
/* Write final `sentinel` section header (with type of 0). */
amt = sizeof (*sentinel);
if (bfd_bwrite ((PTR) sentinel, amt, abfd) != amt)
return false;
return FALSE;
/* Now write out reloc info, followed by syms and strings. */
if (bfd_get_symcount (abfd) != 0)
{
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*exec_hdr (abfd))), SEEK_SET)
!= 0)
return false;
return FALSE;
if (! aout_32_write_syms (abfd))
return false;
return FALSE;
if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*exec_hdr (abfd))), SEEK_SET)
!= 0)
return false;
return FALSE;
for (sect = abfd->sections; sect; sect = sect->next)
if (sect->flags & SEC_CODE)
if (!aout_32_squirt_out_relocs (abfd, sect))
return false;
return FALSE;
if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*exec_hdr (abfd))), SEEK_SET)
!= 0)
return false;
return FALSE;
for (sect = abfd->sections; sect; sect = sect->next)
if (sect->flags & SEC_DATA)
if (!aout_32_squirt_out_relocs (abfd, sect))
return false;
return FALSE;
}
return true;
return TRUE;
}
static void
......@@ -404,7 +411,7 @@ aout_adobe_write_section (abfd, sect)
/* FIXME XXX */
}
static boolean
static bfd_boolean
aout_adobe_set_section_contents (abfd, section, location, offset, count)
bfd *abfd;
asection *section;
......@@ -457,34 +464,34 @@ aout_adobe_set_section_contents (abfd, section, location, offset, count)
/* Regardless, once we know what we're doing, we might as well get
going. */
if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0)
return false;
return FALSE;
if (count == 0)
return true;
return TRUE;
return bfd_bwrite ((PTR) location, count, abfd) == count;
}
static boolean
static bfd_boolean
aout_adobe_set_arch_mach (abfd, arch, machine)
bfd *abfd;
enum bfd_architecture arch;
unsigned long machine;
{
if (! bfd_default_set_arch_mach (abfd, arch, machine))
return false;
return FALSE;
if (arch == bfd_arch_unknown
|| arch == bfd_arch_m68k)
return true;
return TRUE;
return false;
return FALSE;
}
static int
aout_adobe_sizeof_headers (ignore_abfd, ignore)
bfd *ignore_abfd ATTRIBUTE_UNUSED;