aboutsummaryrefslogtreecommitdiff
path: root/gdb/bcache.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-09-01 12:54:38 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-09-01 12:55:57 -0400
commitef5e5b0b6534bed8e9dcd6494acf3f8ee418f8e5 (patch)
tree9b864d1f92574dd5b51d29e7cc4bac2dd2555404 /gdb/bcache.c
parent4c8584be76a2b95cd4876ac8622cb0f2d0fc1ad4 (diff)
downloadgdb-ef5e5b0b6534bed8e9dcd6494acf3f8ee418f8e5.zip
gdb-ef5e5b0b6534bed8e9dcd6494acf3f8ee418f8e5.tar.gz
gdb-ef5e5b0b6534bed8e9dcd6494acf3f8ee418f8e5.tar.bz2
gdb: change bcache::insert `added` parameter to bool
It is currently an int, but it is used as a bool. gdb/ChangeLog: * bcache.h (struct bcache) <insert>: Change type of `added` to pointer to bool. * bcache.c (bcache::insert): Likewise. * gdbtypes.c (check_types_worklist): Adjust. * psymtab.c (add_psymbol_to_bcache): Adjust. Change-Id: I06b1041636c656782a89cb6106c9ae2593f61616
Diffstat (limited to 'gdb/bcache.c')
-rw-r--r--gdb/bcache.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/bcache.c b/gdb/bcache.c
index 49d9d3f..9a8fb87 100644
--- a/gdb/bcache.c
+++ b/gdb/bcache.c
@@ -140,15 +140,15 @@ bcache::expand_hash_table ()
returning an old entry. */
const void *
-bcache::insert (const void *addr, int length, int *added)
+bcache::insert (const void *addr, int length, bool *added)
{
unsigned long full_hash;
unsigned short half_hash;
int hash_index;
struct bstring *s;
- if (added)
- *added = 0;
+ if (added != nullptr)
+ *added = false;
/* Lazily initialize the obstack. This can save quite a bit of
memory in some cases. */
@@ -203,8 +203,8 @@ bcache::insert (const void *addr, int length, int *added)
m_unique_size += length;
m_structure_size += BSTRING_SIZE (length);
- if (added)
- *added = 1;
+ if (added != nullptr)
+ *added = true;
return &newobj->d.data;
}