/* addrmap.c --- implementation of address map data structure.
- Copyright (C) 2007-2015 Free Software Foundation, Inc.
+ Copyright (C) 2007-2020 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdb_obstack.h"
#include "addrmap.h"
+/* Make sure splay trees can actually hold the values we want to
+ store in them. */
+gdb_static_assert (sizeof (splay_tree_key) >= sizeof (CORE_ADDR *));
+gdb_static_assert (sizeof (splay_tree_value) >= sizeof (void *));
+
\f
/* The "abstract class". */
static int
addrmap_mutable_foreach_worker (splay_tree_node node, void *data)
{
- struct mutable_foreach_data *foreach_data = data;
+ struct mutable_foreach_data *foreach_data
+ = (struct mutable_foreach_data *) data;
return foreach_data->fn (foreach_data->data,
addrmap_node_key (node),
static void *
splay_obstack_alloc (int size, void *closure)
{
- struct addrmap_mutable *map = closure;
+ struct addrmap_mutable *map = (struct addrmap_mutable *) closure;
splay_tree_node n;
/* We should only be asked to allocate nodes and larger things.
static void
splay_obstack_free (void *obj, void *closure)
{
- struct addrmap_mutable *map = closure;
- splay_tree_node n = obj;
+ struct addrmap_mutable *map = (struct addrmap_mutable *) closure;
+ splay_tree_node n = (splay_tree_node) obj;
/* We've asserted in the allocation function that we only allocate
nodes or larger things, so it should be safe to put whatever
return (struct addrmap *) map;
}
-
-
-\f
-/* Initialization. */
-
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_addrmap;
-
-void
-_initialize_addrmap (void)
-{
- /* Make sure splay trees can actually hold the values we want to
- store in them. */
- gdb_assert (sizeof (splay_tree_key) >= sizeof (CORE_ADDR *));
- gdb_assert (sizeof (splay_tree_value) >= sizeof (void *));
-}