summaryrefslogtreecommitdiff
path: root/binutils/ar.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-03-31 10:39:37 +1030
committerAlan Modra <amodra@gmail.com>2021-03-31 10:49:23 +1030
commit015dc7e1f8a971692a910e6cfc64faf9216e75c3 (patch)
tree53f0eb6489d86f4a6b734115c79c4e131af5416c /binutils/ar.c
parent78933a4ad9ae9c2e274d41e6b3036ea582c47810 (diff)
downloadbinutils-gdb-015dc7e1f8a971692a910e6cfc64faf9216e75c3.tar.gz
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.
Diffstat (limited to 'binutils/ar.c')
-rw-r--r--binutils/ar.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/binutils/ar.c b/binutils/ar.c
index fb19b14fec5..71bbde65ed6 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -54,7 +54,7 @@ static void delete_members (bfd *, char **files_to_delete);
static void move_members (bfd *, char **files_to_move);
static void replace_members
- (bfd *, char **files_to_replace, bfd_boolean quick);
+ (bfd *, char **files_to_replace, bool quick);
static void print_descr (bfd * abfd);
static void write_archive (bfd *);
static int ranlib_only (const char *archname);
@@ -124,19 +124,19 @@ get_pos_bfd (bfd **, enum pos, const char *);
/* For extract/delete only. If COUNTED_NAME_MODE is TRUE, we only
extract the COUNTED_NAME_COUNTER instance of that name. */
-static bfd_boolean counted_name_mode = 0;
+static bool counted_name_mode = 0;
static int counted_name_counter = 0;
/* Whether to truncate names of files stored in the archive. */
-static bfd_boolean ar_truncate = FALSE;
+static bool ar_truncate = false;
/* Whether to use a full file name match when searching an archive.
This is convenient for archives created by the Microsoft lib
program. */
-static bfd_boolean full_pathname = FALSE;
+static bool full_pathname = false;
/* Whether to create a "thin" archive (symbol index only -- no files). */
-static bfd_boolean make_thin_archive = FALSE;
+static bool make_thin_archive = false;
#define LIBDEPS "__.LIBDEP"
/* Text to store in the __.LIBDEP archive element for the linker to use. */
@@ -215,7 +215,7 @@ map_over_members (bfd *arch, void (*function)(bfd *), char **files, int count)
for (; count > 0; files++, count--)
{
- bfd_boolean found = FALSE;
+ bool found = false;
match_count = 0;
for (head = arch->archive_next; head; head = head->archive_next)
@@ -257,7 +257,7 @@ map_over_members (bfd *arch, void (*function)(bfd *), char **files, int count)
continue;
}
- found = TRUE;
+ found = true;
function (head);
head->archive_pass = 1;
/* PR binutils/15796: Once a file has been matched, do not
@@ -275,7 +275,7 @@ map_over_members (bfd *arch, void (*function)(bfd *), char **files, int count)
}
}
-bfd_boolean operation_alters_arch = FALSE;
+bool operation_alters_arch = false;
static void
usage (int help)
@@ -519,22 +519,22 @@ decode_options (int argc, char **argv)
break;
case 'd':
operation = del;
- operation_alters_arch = TRUE;
+ operation_alters_arch = true;
break;
case 'm':
operation = move;
- operation_alters_arch = TRUE;
+ operation_alters_arch = true;
break;
case 'p':
operation = print_files;
break;
case 'q':
operation = quick_append;
- operation_alters_arch = TRUE;
+ operation_alters_arch = true;
break;
case 'r':
operation = replace;
- operation_alters_arch = TRUE;
+ operation_alters_arch = true;
break;
case 't':
operation = print_table;
@@ -557,7 +557,7 @@ decode_options (int argc, char **argv)
display_offsets = 1;
break;
case 'V':
- show_version = TRUE;
+ show_version = true;
break;
case 's':
write_armap = 1;
@@ -584,22 +584,22 @@ decode_options (int argc, char **argv)
mri_mode = 1;
break;
case 'N':
- counted_name_mode = TRUE;
+ counted_name_mode = true;
break;
case 'f':
- ar_truncate = TRUE;
+ ar_truncate = true;
break;
case 'P':
- full_pathname = TRUE;
+ full_pathname = true;
break;
case 'T':
- make_thin_archive = TRUE;
+ make_thin_archive = true;
break;
case 'D':
- deterministic = TRUE;
+ deterministic = true;
break;
case 'U':
- deterministic = FALSE;
+ deterministic = false;
break;
case OPTION_PLUGIN:
#if BFD_SUPPORTS_PLUGINS
@@ -650,7 +650,7 @@ static void
ranlib_main (int argc, char **argv)
{
int arg_index, status = 0;
- bfd_boolean touch = FALSE;
+ bool touch = false;
int c;
while ((c = getopt_long (argc, argv, "DhHUvVt", long_options, NULL)) != EOF)
@@ -658,17 +658,17 @@ ranlib_main (int argc, char **argv)
switch (c)
{
case 'D':
- deterministic = TRUE;
+ deterministic = true;
break;
case 'U':
- deterministic = FALSE;
+ deterministic = false;
break;
case 'h':
case 'H':
show_help = 1;
break;
case 't':
- touch = TRUE;
+ touch = true;
break;
case 'v':
case 'V':
@@ -1292,7 +1292,7 @@ write_archive (bfd *iarch)
obfd->flags |= BFD_ARCHIVE_FULL_PATH;
if (make_thin_archive || bfd_is_thin_archive (iarch))
- bfd_set_thin_archive (obfd, TRUE);
+ bfd_set_thin_archive (obfd, true);
if (!bfd_set_archive_head (obfd, contents_head))
bfd_fatal (old_name);
@@ -1307,7 +1307,7 @@ write_archive (bfd *iarch)
/* We don't care if this fails; we might be creating the archive. */
bfd_close (iarch);
- if (smart_rename (new_name, old_name, tmpfd, NULL, FALSE) != 0)
+ if (smart_rename (new_name, old_name, tmpfd, NULL, false) != 0)
xexit (1);
free (old_name);
free (new_name);
@@ -1357,8 +1357,8 @@ static void
delete_members (bfd *arch, char **files_to_delete)
{
bfd **current_ptr_ptr;
- bfd_boolean found;
- bfd_boolean something_changed = FALSE;
+ bool found;
+ bool something_changed = false;
int match_count;
for (; *files_to_delete != NULL; ++files_to_delete)
@@ -1371,12 +1371,12 @@ delete_members (bfd *arch, char **files_to_delete)
if (!strcmp (*files_to_delete, "__.SYMDEF"))
{
- arch->has_armap = FALSE;
+ arch->has_armap = false;
write_armap = -1;
continue;
}
- found = FALSE;
+ found = false;
match_count = 0;
current_ptr_ptr = &(arch->archive_next);
while (*current_ptr_ptr)
@@ -1393,8 +1393,8 @@ delete_members (bfd *arch, char **files_to_delete)
}
else
{
- found = TRUE;
- something_changed = TRUE;
+ found = true;
+ something_changed = true;
if (verbose)
printf ("d - %s\n",
*files_to_delete);
@@ -1471,9 +1471,9 @@ move_members (bfd *arch, char **files_to_move)
/* Ought to default to replacing in place, but this is existing practice! */
static void
-replace_members (bfd *arch, char **files_to_move, bfd_boolean quick)
+replace_members (bfd *arch, char **files_to_move, bool quick)
{
- bfd_boolean changed = FALSE;
+ bool changed = false;
bfd **after_bfd; /* New entries go after this one. */
bfd *current;
bfd **current_ptr;
@@ -1493,7 +1493,7 @@ replace_members (bfd *arch, char **files_to_move, bfd_boolean quick)
normalize (bfd_get_filename (current), arch)) == 0
&& current->arelt_data != NULL)
{
- bfd_boolean replaced;
+ bool replaced;
if (newer_only)
{
struct stat fsbuf, asbuf;
@@ -1531,7 +1531,7 @@ replace_members (bfd *arch, char **files_to_move, bfd_boolean quick)
{
/* Snip out this entry from the chain. */
*current_ptr = (*current_ptr)->archive_next;
- changed = TRUE;
+ changed = true;
}
goto next_file;