sim: reorder header includes
[binutils-gdb.git] / sim / common / hw-events.c
index fc73be8f60eb105fd4ccff9bc1ed5735818454d7..301f868ce2ee2049d188cb37d99d0a541d0583b5 100644 (file)
@@ -1,5 +1,5 @@
 /* Hardware event manager.
-   Copyright (C) 1998, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1998-2021 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
@@ -17,16 +17,20 @@ 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/>.  */
 
+/* This must come before any other includes.  */
+#include "defs.h"
+
+#include <string.h>
 
 #include "hw-main.h"
 #include "hw-base.h"
 
 #include "sim-events.h"
 
-
 /* The hw-events object is implemented using sim-events */
 
-struct hw_event {
+struct hw_event
+{
   void *data;
   struct hw *me;
   hw_event_callback *callback;
@@ -34,7 +38,8 @@ struct hw_event {
   struct hw_event_data *entry;
 };
 
-struct hw_event_data {
+struct hw_event_data
+{
   struct hw_event event;
   struct hw_event_data *next;
 };
@@ -85,12 +90,7 @@ hw_event_queue_schedule (struct hw *me,
                         hw_event_callback *callback,
                         void *data)
 {
-  struct hw_event *event;
-  va_list dummy;
-  memset (&dummy, 0, sizeof dummy);
-  event = hw_event_queue_schedule_vtracef (me, delta_time, callback, data,
-                                          NULL, dummy);
-  return event;
+  return hw_event_queue_schedule_tracef (me, delta_time, callback, data, NULL);
 }
 
 struct hw_event *
@@ -179,9 +179,11 @@ hw_event_remain_time (struct hw *me, struct hw_event *event)
    Build with `make test-hw-events' in sim/<cpu> directory*/
 
 #if defined (MAIN)
-#include "sim-main.h"
-#include <string.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "sim-main.h"
 
 static void
 test_handler (struct hw *me,