sim: reorder header includes
authorMike Frysinger <vapier@gentoo.org>
Sun, 5 Dec 2021 01:24:55 +0000 (20:24 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 5 Dec 2021 03:09:26 +0000 (22:09 -0500)
We're including system headers after local headers in a bunch of
places, but this leads to conflicts when our local headers happen
to define symbols that show up in the system headers.

Use the more standard order of:
* config.h (via defs.h)
* system headers
* local library headers (e.g. bfd & libiberty)
* sim specific headers

45 files changed:
include/sim/callback.h
sim/common/callback.c
sim/common/cgen-par.c
sim/common/cgen-scache.c
sim/common/cgen-trace.c
sim/common/cgen-utils.c
sim/common/dv-cfi.c
sim/common/dv-glue.c
sim/common/dv-pal.c
sim/common/dv-sockser.c
sim/common/genmloop.sh
sim/common/hw-alloc.c
sim/common/hw-base.c
sim/common/hw-device.c
sim/common/hw-events.c
sim/common/hw-handles.c
sim/common/hw-ports.c
sim/common/hw-properties.c
sim/common/hw-tree.c
sim/common/nrun.c
sim/common/sim-arange.c
sim/common/sim-assert.h
sim/common/sim-basics.h
sim/common/sim-config.c
sim/common/sim-core.c
sim/common/sim-cpu.c
sim/common/sim-engine.c
sim/common/sim-events.c
sim/common/sim-fpu.c
sim/common/sim-hload.c
sim/common/sim-hw.c
sim/common/sim-io.c
sim/common/sim-io.h
sim/common/sim-load.c
sim/common/sim-memopt.c
sim/common/sim-model.c
sim/common/sim-module.c
sim/common/sim-options.c
sim/common/sim-profile.c
sim/common/sim-reason.c
sim/common/sim-signal.c
sim/common/sim-trace.c
sim/common/sim-utils.c
sim/common/sim-watch.c
sim/common/syscall.c

index a51c4de9c3aafb6cfe0ee21b4d524d09e70dcbae..a6eb38ffd4e1316a1be38c8bb758fd5587520624 100644 (file)
 #ifndef SIM_CALLBACK_H
 #define SIM_CALLBACK_H
 
-#include <ansidecl.h>
 #include <stdarg.h>
 #include <stdint.h>
+
+#include <ansidecl.h>
 /* Needed for enum bfd_endian.  */
-#include "bfd.h"
+#include <bfd.h>
 \f
 /* Mapping of host/target values.  */
 /* ??? For debugging purposes, one might want to add a string of the
index a5f0fbe435589297845a8f254a4faf706ac689e5..105488db262f2bd4c1910e88bb8528f4e4f6587a 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "ansidecl.h"
+#include <errno.h>
+#include <fcntl.h>
+/* For PIPE_BUF.  */
+#include <limits.h>
+#include <signal.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-/* For PIPE_BUF.  */
-#include <limits.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
 #include <time.h>
-#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include <sys/stat.h>
-#include "sim/callback.h"
+#include <sys/types.h>
+
+#include "ansidecl.h"
 /* For xmalloc.  */
 #include "libiberty.h"
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include "sim/callback.h"
 
 #ifndef PIPE_BUF
 #define PIPE_BUF 512
index b535edfdaec099fb8e20fbdff97671069b26bf39..24642291dfb32c97c48b98c1f0097e13d97f4c53 100644 (file)
@@ -20,8 +20,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "sim-main.h"
 #include <stdlib.h>
+
+#include "sim-main.h"
 #include "cgen-mem.h"
 #include "cgen-par.h"
 
index c14d5d22c6d6819f3ec7b4899c4b2c74279a79b8..fd4f1f9eb002b8efd7500aad4cad376394cbcb88 100644 (file)
@@ -22,9 +22,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define SCACHE_DEFINE_INLINE
 
-#include "sim-main.h"
 #include <stdlib.h>
+
 #include "libiberty.h"
+
+#include "sim-main.h"
 #include "sim-options.h"
 #include "sim-io.h"
 
index f5483fd39eaf57af110499bf5e31ffc31886c9c2..f372c471d34d2526b90a9408a148e3096a68d080 100644 (file)
@@ -22,9 +22,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
 #include <stdlib.h>
+
+#include "bfd.h"
 #include "diagnostics.h"
 #include "dis-asm.h"
-#include "bfd.h"
+
 #include "sim-main.h"
 #include "sim-fpu.h"
 #include "sim/callback.h"
index d9c3ea9aa80432812efba6edebaee95c3c85bd87..cae21fff5eaf547e5d2d34462aab03fa4fc8ddf8 100644 (file)
@@ -21,9 +21,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "defs.h"
 
 #include "bfd.h"
+#include "dis-asm.h"
+
 #include "sim-main.h"
 #include "sim-signal.h"
-#include "dis-asm.h"
 
 #define MEMOPS_DEFINE_INLINE
 #include "cgen-mem.h"
index 02a2cedd558b8fb16b7f68ba4f81cd98cfc4d571..f719ca44385616615a0ffdf899ca167b0b81f1e0 100644 (file)
@@ -25,9 +25,9 @@
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include <math.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <math.h>
 #include <stdbool.h>
 #include <unistd.h>
 #ifdef HAVE_SYS_MMAN_H
index 7c8e1f877af27d3c9f3da70ba62b00b619c2e12a..4f2bbf5c308a734a7373865a0b318aa419716938 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "hw-main.h"
-
 #include <string.h>
 
+#include "hw-main.h"
+
 /* DEVICE
 
 
index c60f524ea8ea4000e3d3e8d0123f8bd6ff8497c7..3f6a95e47e28a25919270d9ca748aca789114460 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 #include "sim-main.h"
 #include "hw-main.h"
 #include "sim-io.h"
    its immediate domain */
 #include "hw-tree.h"
 
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <stdlib.h>
-
 /* DEVICE
 
 
index 477e8f681af72d9a5f1d4189258850877e7040a3..69338f9c660340e509df74402df5688202b1d573 100644 (file)
@@ -21,24 +21,23 @@ 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 <signal.h>
-#include <stdlib.h>
+#include <errno.h>
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
+#include <netdb.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
-#include <netdb.h>
+#include <netinet/in.h>
 #include <sys/select.h>
 #include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/types.h>
 
 #include "sim-main.h"
 #include "sim-assert.h"
index b8a0f435a09b5bfa150d15a36d25cac8be6369da..e1eb08c1bdfd8a33bfaefe51c127971a0c6d59ac 100755 (executable)
@@ -312,8 +312,9 @@ cat << EOF
 #define WANT_CPU @cpu@
 #define WANT_CPU_@CPU@
 
-#include "sim-main.h"
 #include "bfd.h"
+
+#include "sim-main.h"
 #include "cgen-mem.h"
 #include "cgen-ops.h"
 #include "sim-assert.h"
index a16666b931a08ae7ceba1fcb167de5cd6915c3a0..b3633da4858a8a19420e831285689644dadcb8ca 100644 (file)
@@ -20,11 +20,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <stdlib.h>
+
 #include "hw-main.h"
 #include "hw-base.h"
 
-#include <stdlib.h>
-
 struct hw_alloc_data
 {
   void *alloc;
index dee9359a7b5b916cc74780e91e5905274a7a84c2..238d3fea109c796dbde9d042a217ee9306c6e317 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "hw-main.h"
-#include "hw-base.h"
-
-#include <string.h>
-#include <stdlib.h>
 #include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
 
+#include "hw-main.h"
+#include "hw-base.h"
 #include "hw-config.h"
 
 struct hw_base_data
index 9b743ead1f2c88e3a0033fcedc2f97fb132493a5..b30eede5e3b762f0ce9a85927eee00f1f013823b 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "hw-main.h"
-#include "hw-base.h"
-
 #include <stdlib.h>
 #include <string.h>
 
+#include "hw-main.h"
+#include "hw-base.h"
+
 /* Address methods */
 
 const hw_unit *
index 620b47d5255aa8ab2a2a96b4ef51fd4fa27560c7..301f868ce2ee2049d188cb37d99d0a541d0583b5 100644 (file)
@@ -20,13 +20,13 @@ 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"
 
-#include <string.h>
-
 /* The hw-events object is implemented using sim-events */
 
 struct hw_event
@@ -179,10 +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,
index fb878e4927745708afbb779e25cc4ea9f8915fd7..62b3ca38acb9ad259924053996fe7d9d59994fa1 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <stdlib.h>
+
 #include "hw-main.h"
 #include "hw-base.h"
 
-#include <stdlib.h>
-
 struct hw_handle_mapping
 {
   cell_word external;
index fbc7278ddd1ff042518246a9af1bba6e04db7130..6029814ee72f4c7dab5fe01366e0d75add89e12b 100644 (file)
@@ -20,13 +20,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "hw-main.h"
-#include "hw-base.h"
-
+#include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 
+#include "hw-main.h"
+#include "hw-base.h"
 
 struct hw_port_edge
 {
index 3836aa73527ef79d6270c868e6456493e99f7659..f608ba94323732564e0491f405be111c0b291021 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <string.h>
+
 #include "hw-main.h"
 #include "hw-base.h"
 
 #include "sim-io.h"
 #include "sim-assert.h"
 
-#include <string.h>
-
 /* property entries */
 
 struct hw_property_data
index 1bf4edab746b9581f59011e76a94a5cab24df991..2e441cec98b18299654666ecdaf4879186fffc65 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "hw-main.h"
 #include "hw-base.h"
 #include "hw-tree.h"
 #include "sim-io.h"
 #include "sim-assert.h"
 
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
 /* manipulate/lookup device names */
 
 typedef struct _name_specifier
index 557a060e569120cedcd5c31690c24a2e423187be..2985bda08a27ee55246d31c1ec2d12f6f443d4ae 100644 (file)
@@ -21,24 +21,23 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <stdlib.h>
 /* For strsignal.  */
 #include <string.h>
+#ifdef HAVE_UNISTD_H
+/* For chdir.  */
+#include <unistd.h>
+#endif
+
+#include "bfd.h"
+#include "environ.h"
 
 #include "sim-main.h"
 #include "sim-signal.h"
 #include "sim/callback.h"
 
-#include "bfd.h"
-#include "environ.h"
-
 #ifndef HAVE_STRSIGNAL
 /* While libiberty provides a fallback, it doesn't provide a prototype.  */
 extern const char *strsignal (int);
 #endif
 
-#ifdef HAVE_UNISTD_H
-/* For chdir.  */
-#include <unistd.h>
-#endif
-
 static void usage (void);
 
 extern host_callback default_callback;
index 5a28a2c0c495e623d20ca2679dbf40aa03920676..96b1af3e6cd0ab4bdbda7702af9831d64260f573 100644 (file)
@@ -23,13 +23,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <stdlib.h>
+#include <string.h>
+
 #include "libiberty.h"
+
 #include "sim-basics.h"
 #include "sim-arange.h"
 
-#include <stdlib.h>
-#include <string.h>
-
 /* Insert a range.  */
 
 static void
index c6b877bc9101e402c02091d7404a67d2ca791bea..43b0b9dc33a4cec5d738594b576ee129e79da279 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef SIM_ASSERT_H
 #define SIM_ASSERT_H
 
+#include "libiberty.h"
+
 /* The subtle difference between SIM_ASSERT and ASSERT is that
    SIM_ASSERT passes `sd' to sim_io_error for the SIM_DESC,
    ASSERT passes NULL.  */
@@ -28,7 +30,6 @@
 #if !defined (SIM_ASSERT)
 #if defined (WITH_ASSERT)
 #include "sim-io.h"
-#include "libiberty.h"
 #define SIM_ASSERT(EXPRESSION) \
 do \
   { \
@@ -51,7 +52,6 @@ while (0)
 #if !defined (ASSERT)
 #if defined (WITH_ASSERT)
 #include "sim-io.h"
-#include "libiberty.h"
 #define ASSERT(EXPRESSION) \
 do \
   { \
index 32995a870d13959103188b0c9892d8851b54105d..f09a4f26720586ee5ea7b8e35f9dc031d13aafdd 100644 (file)
@@ -31,9 +31,9 @@
 /* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will
    bring potential conflicts out in the open */
 
+#include <setjmp.h>
 #include <stdarg.h>
 #include <stdio.h>
-#include <setjmp.h>
 
 
 #ifndef min
index fc6b09a7238d13ebf779e57ebe2878d6e2779229..d6c307525a896cbbf8123190edeff7461786a503 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include "bfd.h"
+
 #include "sim-main.h"
 #include "sim-assert.h"
-#include "bfd.h"
 
 
 enum bfd_endian current_target_byte_order = BFD_ENDIAN_UNKNOWN;
index 2c568dc3e36496bdc97e13a591b62b16ca4f09dd..8d13020df16352142529b382b55934c15ef49972 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <stdlib.h>
+
+#include "libiberty.h"
+
 #include "sim-main.h"
 #include "sim-assert.h"
 #include "sim-signal.h"
-#include "libiberty.h"
 
 #if (WITH_HW)
 #include "sim-hw.h"
 #endif
 
-#include <stdlib.h>
-
 /* "core" module install handler.
 
    This is called via sim_module_install to install the "core"
index bde3e617ce319d369730e93d338b6de7a9dc3e5e..49bd850e87fe1cc93fe9ed43b2a03665da5ecb72 100644 (file)
@@ -22,9 +22,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
 
-#include "sim-main.h"
 #include "bfd.h"
 
+#include "sim-main.h"
+
 /* Allocate space for all cpus in the simulator.
    Space for the cpu must currently exist prior to parsing ARGV.  */
 /* ??? wip.  better solution must wait.  */
index 2a0fb72d75030200247aa7a359db7ba8e5f8ee17..0e06b55bfa1280922f64ae53be588a5e9f4609d7 100644 (file)
@@ -20,13 +20,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <stdio.h>
+#include <stdlib.h>
+
 #include "sim-main.h"
 #include "sim-assert.h"
 #include "sim-signal.h"
 
-#include <stdio.h>
-#include <stdlib.h>
-
 /* Get the run state.
    REASON/SIGRC are the values returned by sim_stop_reason.
    ??? Should each cpu have its own copy?  */
index ee031c9376b240605857956ed13c8a0ddf8071e6..a5ec32d05c8012701d467b59dc9ceefea7377e0f 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <signal.h> /* For SIGPROCMASK et al. */
+#include <stdlib.h>
+#include <string.h>
+
+#include "libiberty.h"
+
 #include "sim-main.h"
 #include "sim-assert.h"
 #include "sim-cpu.h"
-#include "libiberty.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <signal.h> /* For SIGPROCMASK et al. */
 
 typedef enum {
   watch_invalid,
index fe8ecf8a3ce52ecb098ae1cee5a73fd115a9b334..e49d2e3238df2ad8c998331a3e434e2ecfff4774 100644 (file)
@@ -38,14 +38,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <stdlib.h>
+
 #include "sim-basics.h"
 #include "sim-fpu.h"
 
 #include "sim-io.h"
 #include "sim-assert.h"
 
-#include <stdlib.h>
-
 /* Debugging support.
    If digits is -1, then print all digits.  */
 
index f33dcf6368a854f207666346343378adb1487aab..c42590c26947dd0ccf7884d49eabb8421544b531 100644 (file)
@@ -20,8 +20,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "sim-main.h"
 #include "bfd.h"
+
+#include "sim-main.h"
 #include "sim-utils.h"
 #include "sim-assert.h"
 
index 9a3db171d1b3d884d3f6339556a83243ebe0aa54..1b086433e7846959538c5d449b91d4ba5337db2c 100644 (file)
@@ -20,6 +20,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <ctype.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "sim-main.h"
 #include "sim-assert.h"
 #include "sim-options.h"
@@ -32,12 +37,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "hw-main.h"
 #include "hw-base.h"
 
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-
-
 struct sim_hw {
   struct hw *tree;
   int trace_p;
index 9fdc79e0301b856f637a192750f374d8439d0fbd..5a47f65d8e5ae9c4f8abf92b41759a8982682e6d 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "sim-main.h"
-#include "sim-io.h"
-#include "sim/callback.h"
-
 #include <errno.h>
 #if HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
-
+#include <stdlib.h>
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
-#include <stdlib.h>
+#include "sim-main.h"
+#include "sim-io.h"
+#include "sim/callback.h"
 
 #undef open
 
index 9536e4b587a29209838a6fe710e78da4d497d9f6..f9fd1978ee29e49705f84adf220e9864791a3540 100644 (file)
@@ -23,6 +23,9 @@
 #ifndef SIM_IO_H
 #define SIM_IO_H
 
+#include <sys/stat.h>
+#include <sys/types.h>
+
 /* See the file include/callbacks.h for a description */
 
 int sim_io_init (SIM_DESC sd);
@@ -86,9 +89,6 @@ void sim_io_poll_quit (SIM_DESC sd);
 /* Returns -1 and sets (host) EAGAIN if not ready. */
 int sim_io_poll_read (SIM_DESC sd, int, char *, int);
 
-#include <sys/types.h>
-#include <sys/stat.h>
-
 int sim_io_stat (SIM_DESC sd, const char *path, struct stat *buf);
 
 int sim_io_fstat (SIM_DESC sd, int fd, struct stat *buf);
index ec5df418d9de6c4b203fdfc7666926445519e732..c91d90a55ebf46253948d13f9d9445ea411ecd92 100644 (file)
@@ -21,12 +21,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "ansidecl.h"
-#include <stdio.h> /* for NULL */
 #include <stdarg.h>
+#include <stdio.h> /* for NULL */
 #include <stdlib.h>
 #include <time.h>
 
+#include "ansidecl.h"
 #include "bfd.h"
 
 #include "sim/callback.h"
index 636f6a9a0febb94fffc00a64079427587da214a6..093958e1f257b8386d079b2fee4aed8f4e268e79 100644 (file)
@@ -20,25 +20,25 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "sim-main.h"
-#include "sim-assert.h"
-#include "sim-options.h"
-
-#include <string.h>
-#include <stdlib.h>
 #include <errno.h>
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+
+#include "sim-main.h"
+#include "sim-assert.h"
+#include "sim-options.h"
 
 /* Memory fill byte. */
 static unsigned8 fill_byte_value;
index 98dcbeae6cc16a2dbac52c7e3914afc53336abf3..a4e2d915e455e0fe6ee75cec2311ca44cd1fc88d 100644 (file)
@@ -20,13 +20,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include "bfd.h"
+#include "libiberty.h"
+
 #include "sim-main.h"
 #include "sim-model.h"
-#include "libiberty.h"
 #include "sim-options.h"
 #include "sim-io.h"
 #include "sim-assert.h"
-#include "bfd.h"
 
 static void model_set (sim_cpu *, const SIM_MODEL *);
 
index d2b220ab3fb2bce9933549e451a077f7ef33a0d2..dfbb6f93562b7d7224bef4735cd25f6dd7b54331 100644 (file)
@@ -22,15 +22,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <stdlib.h>
+
+#include "libiberty.h"
+
 #include "sim-main.h"
 #include "sim-io.h"
 #include "sim-options.h"
 #include "sim-assert.h"
 
-#include "libiberty.h"
-
-#include <stdlib.h>
-
 /* List of all early/core modules.
    TODO: Should trim this list by converting to sim_install_* framework.  */
 static MODULE_INSTALL_FN * const early_modules[] = {
index 8c9b7cfec370d43dac5b425bd43beab64150f7b4..5991ddeba3fb9920b52d5906bbf7fcc80e0161eb 100644 (file)
@@ -20,21 +20,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "sim-main.h"
-#include <string.h>
-#include <stdlib.h>
 #include <ctype.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
+
+#include "bfd.h"
+#include "environ.h"
+#include "hashtab.h"
 #include "libiberty.h"
+
+#include "sim-main.h"
 #include "sim-options.h"
 #include "sim-io.h"
 #include "sim-assert.h"
-#include "environ.h"
 #include "version.h"
-#include "hashtab.h"
-
-#include "bfd.h"
 
 /* Add a set of options to the simulator.
    TABLE is an array of OPTIONS terminated by a NULL `opt.name' entry.
index 1459ae70ab284980b82f933575b9020d8b3b891a..adde403186cce3befcf7543cce8161f4bd41319f 100644 (file)
@@ -20,15 +20,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "sim-main.h"
 #include "sim-io.h"
 #include "sim-options.h"
 #include "sim-assert.h"
 
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
 #if !WITH_PROFILE_PC_P
 static unsigned int _profile_stub;
 # define PROFILE_PC_FREQ(p) _profile_stub
index fa3683793d2d4cd09d8d2d75b682117972fda3e6..27746ea295a680ba7eb66b01f88f88ca36759e1f 100644 (file)
@@ -20,12 +20,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <stdlib.h>
+
 #include "sim-main.h"
 #include "sim-assert.h"
 #include "sim-signal.h"
 
-#include <stdlib.h>
-
 /* Generic implementation of sim_stop_reason */
 
 void
index d5186043824066c5f1b38552a425cc1d73306645..0fe5e1509f98596af4f222741640721555154ca0 100644 (file)
@@ -21,6 +21,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "defs.h"
 
 #include <signal.h>
+
 #include "sim-main.h"
 #include "sim-signal.h"
 
index 9ebb86d70e2e173776193ad224aee4d8cc4fe433..f4712aae78b9c853e61130af2e44723dc784716a 100644 (file)
@@ -20,21 +20,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "sim-main.h"
-#include "sim-io.h"
-#include "sim-options.h"
-#include "sim-fpu.h"
-#include "sim/callback.h"
+#include <stdlib.h>
+#include <string.h>
 
 #include "bfd.h"
-#include "libiberty.h"
-
 #include "dis-asm.h"
+#include "libiberty.h"
 
+#include "sim-main.h"
 #include "sim-assert.h"
-
-#include <string.h>
-#include <stdlib.h>
+#include "sim-io.h"
+#include "sim-options.h"
+#include "sim-fpu.h"
+#include "sim/callback.h"
 
 #ifndef SIZE_PHASE
 #define SIZE_PHASE 8
index ff6234b1c9848c291c622edadb5d39ec37135918..e30627b88b309d0a97348aa64f8cf5b8a112bb23 100644 (file)
@@ -21,16 +21,16 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "defs.h"
 
 #include <stdlib.h>
+#include <string.h>
 #include <time.h>
-#include <sys/time.h> /* needed by sys/resource.h */
-
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
-#include <string.h>
+#include <sys/time.h> /* needed by sys/resource.h */
 
-#include "libiberty.h"
 #include "bfd.h"
+#include "libiberty.h"
+
 #include "sim-main.h"
 #include "sim-assert.h"
 #include "sim-utils.h"
index bc6c44bcfd17937796f7e0720ca468a4ca36a3b9..624580d9fc71e8a99fb6ea5b488767de8212957a 100644 (file)
@@ -20,18 +20,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libiberty.h"
+
 #include "sim-main.h"
 #include "sim-options.h"
 #include "sim-signal.h"
-#include "libiberty.h"
-
 #include "sim-assert.h"
 
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
 enum {
   OPTION_WATCH_DELETE                      = OPTION_START,
 
index df9dd92e6dac43eb2f21f881cd5d94b2a02a2603..c64e78fe5f6ba6d049b98c780fe000b6e464394f 100644 (file)
 /* This must come before any other includes.  */
 #include "defs.h"
 
-#include "ansidecl.h"
-#include "libiberty.h"
+#include <errno.h>
+#include <fcntl.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#include <errno.h>
-#include <fcntl.h>
-#include <time.h>
-#include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+
+#include "ansidecl.h"
+#include "libiberty.h"
+
 #include "sim/callback.h"
 
 #ifndef ENOSYS