]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/common/hw-instances.c
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / sim / common / hw-instances.c
index 22c1cd9e9a90341eb378d5ad9da8df166d279d01..7f65ecafc84401f1c6dac2640e351705d2092120 100644 (file)
@@ -1,22 +1,23 @@
-/*  This file is part of the program psim.
+/* The common simulator framework for GDB, the GNU Debugger.
 
-    Copyright (C) 1994-1998, Andrew Cagney <cagney@highland.com.au>
+   Copyright 2002-2013 Free Software Foundation, Inc.
 
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
+   Contributed by Andrew Cagney and Red Hat.
 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-    */
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
 #include "hw-main.h"
@@ -25,7 +26,8 @@
 #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;
 };
@@ -85,11 +87,11 @@ hw_instance_delete (struct hw_instance *instance)
   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 */
@@ -107,7 +109,7 @@ hw_instance_delete (struct hw_instance *instance)
       struct hw_instance *curr = me->instances;
       while (curr != NULL)
        {
-         ASSERT(curr != instance);
+         ASSERT (curr != instance);
          curr = curr->next;
        }
       /* unlink the child */
@@ -115,7 +117,7 @@ hw_instance_delete (struct hw_instance *instance)
       instance->child->parent = NULL;
     }
   cap_remove (me->ihandles, instance);
-  zfree (instance);
+  free (instance);
 #endif
 }
 
@@ -155,7 +157,7 @@ int
 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*/])
 {
@@ -171,7 +173,7 @@ hw_instance_call_method (struct hw_instance *instance,
     }
   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,
@@ -278,8 +280,8 @@ hw_instance_interceed (struct hw_instance *parent,
       *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