summaryrefslogtreecommitdiff
path: root/bfd/cache.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-11-30 08:39:46 +0000
committerAlan Modra <amodra@gmail.com>2002-11-30 08:39:46 +0000
commitb34976b65aea8f33690229600bbf4527ec3118e1 (patch)
tree6411348664ef81ca2aa2e3ff325116e6e6502edf /bfd/cache.c
parent583d52d728c60410c0d39bae68ee536a7b9e7a6c (diff)
downloadbinutils-b34976b65aea8f33690229600bbf4527ec3118e1.tar.gz
binutils-b34976b65aea8f33690229600bbf4527ec3118e1.tar.bz2
binutils-b34976b65aea8f33690229600bbf4527ec3118e1.zip
s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. Simplify
comparisons of bfd_boolean vars with TRUE/FALSE. Formatting.
Diffstat (limited to 'bfd/cache.c')
-rw-r--r--bfd/cache.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/bfd/cache.c b/bfd/cache.c
index df01a1f990a..98a1c72e884 100644
--- a/bfd/cache.c
+++ b/bfd/cache.c
@@ -42,8 +42,8 @@ SECTION
static void insert PARAMS ((bfd *));
static void snip PARAMS ((bfd *));
-static boolean close_one PARAMS ((void));
-static boolean bfd_cache_delete PARAMS ((bfd *));
+static bfd_boolean close_one PARAMS ((void));
+static bfd_boolean bfd_cache_delete PARAMS ((bfd *));
/*
INTERNAL_FUNCTION
@@ -133,7 +133,7 @@ snip (abfd)
/* We need to open a new file, and the cache is full. Find the least
recently used cacheable BFD and close it. */
-static boolean
+static bfd_boolean
close_one ()
{
register bfd *kill;
@@ -157,7 +157,7 @@ close_one ()
if (kill == NULL)
{
/* There are no open cacheable BFD's. */
- return true;
+ return TRUE;
}
kill->where = ftell ((FILE *) kill->iostream);
@@ -167,17 +167,17 @@ close_one ()
/* Close a BFD and remove it from the cache. */
-static boolean
+static bfd_boolean
bfd_cache_delete (abfd)
bfd *abfd;
{
- boolean ret;
+ bfd_boolean ret;
if (fclose ((FILE *) abfd->iostream) == 0)
- ret = true;
+ ret = TRUE;
else
{
- ret = false;
+ ret = FALSE;
bfd_set_error (bfd_error_system_call);
}
@@ -194,13 +194,13 @@ INTERNAL_FUNCTION
bfd_cache_init
SYNOPSIS
- boolean bfd_cache_init (bfd *abfd);
+ bfd_boolean bfd_cache_init (bfd *abfd);
DESCRIPTION
Add a newly opened BFD to the cache.
*/
-boolean
+bfd_boolean
bfd_cache_init (abfd)
bfd *abfd;
{
@@ -208,11 +208,11 @@ bfd_cache_init (abfd)
if (open_files >= BFD_CACHE_MAX_OPEN)
{
if (! close_one ())
- return false;
+ return FALSE;
}
insert (abfd);
++open_files;
- return true;
+ return TRUE;
}
/*
@@ -220,24 +220,24 @@ INTERNAL_FUNCTION
bfd_cache_close
SYNOPSIS
- boolean bfd_cache_close (bfd *abfd);
+ bfd_boolean bfd_cache_close (bfd *abfd);
DESCRIPTION
Remove the BFD @var{abfd} from the cache. If the attached file is open,
then close it too.
RETURNS
- <<false>> is returned if closing the file fails, <<true>> is
+ <<FALSE>> is returned if closing the file fails, <<TRUE>> is
returned if all is well.
*/
-boolean
+bfd_boolean
bfd_cache_close (abfd)
bfd *abfd;
{
if (abfd->iostream == NULL
|| (abfd->flags & BFD_IN_MEMORY) != 0)
- return true;
+ return TRUE;
return bfd_cache_delete (abfd);
}
@@ -261,7 +261,7 @@ FILE *
bfd_open_file (abfd)
bfd *abfd;
{
- abfd->cacheable = true; /* Allow it to be closed later. */
+ abfd->cacheable = TRUE; /* Allow it to be closed later. */
if (open_files >= BFD_CACHE_MAX_OPEN)
{
@@ -312,7 +312,7 @@ bfd_open_file (abfd)
unlink (abfd->filename);
#endif
abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WUB);
- abfd->opened_once = true;
+ abfd->opened_once = TRUE;
}
break;
}