/* The common simulator framework for GDB, the GNU Debugger.
- Copyright 2002, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright 2002-2016 Free Software Foundation, Inc.
Contributed by Andrew Cagney and Red Hat.
#include "sim-io.h"
#include "sim-assert.h"
-struct hw_instance_data {
+struct hw_instance_data
+{
hw_finish_instance_method *to_finish;
struct hw_instance *instances;
};
struct hw *me = hw_instance_hw (instance);
if (instance->to_instance_delete == NULL)
hw_abort (me, "no delete method");
- instance->method->delete(instance);
+ instance->method->delete (instance);
if (instance->args != NULL)
- zfree (instance->args);
+ free (instance->args);
if (instance->path != NULL)
- zfree (instance->path);
+ free (instance->path);
if (instance->child == NULL)
{
/* only remove leaf nodes */
struct hw_instance *curr = me->instances;
while (curr != NULL)
{
- ASSERT(curr != instance);
+ ASSERT (curr != instance);
curr = curr->next;
}
/* unlink the child */
instance->child->parent = NULL;
}
cap_remove (me->ihandles, instance);
- zfree (instance);
+ free (instance);
#endif
}
hw_instance_call_method (struct hw_instance *instance,
const char *method_name,
int n_stack_args,
- unsigned_cell stack_args[/*n_stack_args*/],
+ unsigned_cell stack_args[/*n_stack_args*/],
int n_stack_returns,
unsigned_cell stack_returns[/*n_stack_args*/])
{
}
while (method->name != NULL)
{
- if (strcmp(method->name, method_name) == 0)
+ if (strcmp (method->name, method_name) == 0)
{
return method->method (instance,
n_stack_args, stack_args,
*previous = instance;
}
instance->data = data;
- instance->args = (args == NULL ? NULL : (char *) strdup(args));
- instance->path = (path == NULL ? NULL : (char *) strdup(path));
+ instance->args = (args == NULL ? NULL : (char *) strdup (args));
+ instance->path = (path == NULL ? NULL : (char *) strdup (path));
cap_add (instance->owner->ihandles, instance);
return instance;
#endif