]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: add missing values to array initializers
authorMike Frysinger <vapier@gentoo.org>
Mon, 12 Apr 2010 16:53:33 +0000 (16:53 +0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 12 Apr 2010 16:53:33 +0000 (16:53 +0000)
The sim code has a lot of static initializer for options and devices, but
since they aren't using newer struct style, they have to specify a value
for every option otherwise gcc spits a lot of warnings about "missing
initializer".  So add NULL/0 stubs for pointers/values.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 files changed:
sim/common/ChangeLog
sim/common/dv-core.c
sim/common/dv-glue.c
sim/common/dv-pal.c
sim/common/dv-sockser.c
sim/common/hw-ports.c
sim/common/sim-hw.c
sim/common/sim-model.c
sim/common/sim-options.c
sim/common/sim-profile.c
sim/common/sim-trace.c
sim/common/sim-watch.c

index 1bf564af84cdd3b30a28d44499b12e13740ec20e..4e0aaf0b7b872f6efab0362347111d89d346df3b 100644 (file)
@@ -1,3 +1,17 @@
+2010-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * dv-core.c (dv_core_descriptor): Add NULL initializer.
+       * dv-glue.c (hw_glue_ports, dv_glue_descriptor): Likewise.
+       * dv-pal.c (hw_pal_ports, dv_pal_descriptor): Likewise.
+       * dv-sockser.c (sockser_options): Likewise.
+       * hw-ports.c (empty_hw_ports): Likewise.
+       * sim-hw.c (hw_options): Likewise.
+       * sim-model.c (model_options): Likewise.
+       * sim-options.c (standard_options): Likewise.
+       * sim-profile.c (profile_options): Likewise.
+       * sim-trace.c (trace_options): Likewise.
+       * sim-watch.c (watchpoint_options): Likewise.
+
 2010-04-12  Mike Frysinger  <vapier@gentoo.org>
 
        * sim-options.c (dup_arg_p): Add "const" to the "arg" argument,
index 771690daaf5f1e59b342dd8f58b0a8612196ac7e..87a9ebe0e850033b780a5893a733a67e7be71da6 100644 (file)
@@ -113,5 +113,5 @@ dv_core_finish (struct hw *me)
 
 const struct hw_descriptor dv_core_descriptor[] = {
   { "core", dv_core_finish, },
-  { NULL },
+  { NULL, NULL },
 };
index 7720e3f9c639236fdbd06de573b88594d8c8ea5a..58978d871cdea5701603eb2f1c38f086e4a5504f 100644 (file)
@@ -357,8 +357,8 @@ hw_glue_port_event (struct hw *me,
 
 
 static const struct hw_port_descriptor hw_glue_ports[] = {
-  { "int", 0, max_nr_ports },
-  { NULL }
+  { "int", 0, max_nr_ports, 0 },
+  { NULL, 0, 0, 0 }
 };
 
 
@@ -370,5 +370,5 @@ const struct hw_descriptor dv_glue_descriptor[] = {
   { "glue-xor", hw_glue_finish, },
   { "glue-nor", hw_glue_finish, },
   { "glue-not", hw_glue_finish, },
-  { NULL },
+  { NULL, NULL },
 };
index 9b1bc74a9568fbc13a77afed677a229213dc465f..5717820e64c43c495be880652bda7bf8ce9d8e5c 100644 (file)
@@ -212,7 +212,7 @@ static const struct hw_port_descriptor hw_pal_ports[] = {
   { "countdown", COUNTDOWN_PORT, 0, output_port, },
   { "timer", TIMER_PORT, 0, output_port, },
   { "int", INT_PORT, MAX_NR_PROCESSORS, output_port, },
-  { NULL }
+  { NULL, 0, 0, 0 }
 };
 
 
@@ -602,5 +602,5 @@ hw_pal_finish (struct hw *hw)
 
 const struct hw_descriptor dv_pal_descriptor[] = {
   { "pal", hw_pal_finish, },
-  { NULL },
+  { NULL, NULL },
 };
index 03d49da3f337f5a689ada8213d487eb98d14e7f2..1e530e2eb0f0466ee55e6f973b6bcb30d3f95834 100644 (file)
@@ -104,8 +104,8 @@ static const OPTION sockser_options[] =
 {
   { { "sockser-addr", required_argument, NULL, OPTION_ADDR },
       '\0', "SOCKET ADDRESS", "Set serial emulation socket address",
-      sockser_option_handler },
-  { { NULL, no_argument, NULL, 0 }, '\0', NULL, NULL, NULL }
+      sockser_option_handler, NULL },
+  { { NULL, no_argument, NULL, 0 }, '\0', NULL, NULL, NULL, NULL }
 };
 
 static SIM_RC
index 8f88cb3fe4ef80de7436be2dc0e01c0b8eacd023..2cd469dc99edecf05d163f994c0a082173da0faa 100644 (file)
@@ -51,7 +51,7 @@ struct hw_port_data {
 };
 
 const struct hw_port_descriptor empty_hw_ports[] = {
-  { NULL, },
+  { NULL, 0, 0, 0 },
 };
 
 static void
index 74814920feff78476d005d16059a1ed946936680..6b6b2216942ee415168cec1c5e1072f981154d30 100644 (file)
@@ -110,31 +110,31 @@ static const OPTION hw_options[] =
 {
   { {"hw-info", no_argument, NULL, OPTION_HW_INFO },
       '\0', NULL, "List configurable hw regions",
-      hw_option_handler },
+      hw_option_handler, NULL },
   { {"info-hw", no_argument, NULL, OPTION_HW_INFO },
       '\0', NULL, NULL,
-      hw_option_handler },
+      hw_option_handler, NULL },
 
   { {"hw-trace", optional_argument, NULL, OPTION_HW_TRACE },
       '\0', "on|off", "Trace all hardware devices",
-      hw_option_handler },
+      hw_option_handler, NULL },
   { {"trace-hw", optional_argument, NULL, OPTION_HW_TRACE },
       '\0', NULL, NULL,
-      hw_option_handler },
+      hw_option_handler, NULL },
 
   { {"hw-device", required_argument, NULL, OPTION_HW_DEVICE },
       '\0', "DEVICE", "Add the specified device",
-      hw_option_handler },
+      hw_option_handler, NULL },
 
   { {"hw-list", no_argument, NULL, OPTION_HW_LIST },
       '\0', NULL, "List the device tree",
-      hw_option_handler },
+      hw_option_handler, NULL },
 
   { {"hw-file", required_argument, NULL, OPTION_HW_FILE },
       '\0', "FILE", "Add the devices listed in the file",
-      hw_option_handler },
+      hw_option_handler, NULL },
 
-  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
+  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL, NULL }
 };
 
 
index 06fa93195e8ccd12c64bc1a0d1961bc2781aff2a..ddcb2de2be0d303a96a78d0c9f2290841cfd7ba3 100644 (file)
@@ -37,8 +37,8 @@ static MODULE_INIT_FN sim_model_init;
 static const OPTION model_options[] = {
   { {"model", required_argument, NULL, OPTION_MODEL},
       '\0', "MODEL", "Specify model to simulate",
-      model_option_handler },
-  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
+      model_option_handler, NULL },
+  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL, NULL }
 };
 
 static SIM_RC
index 02ad40e60b58d1e201c149e7c3ae1f18be0e3db4..c01cce5426b3cb8bcf6d1036b52233625d9f06e4 100644 (file)
@@ -120,11 +120,11 @@ static const OPTION standard_options[] =
 {
   { {"verbose", no_argument, NULL, OPTION_VERBOSE},
       'v', NULL, "Verbose output",
-      standard_option_handler },
+      standard_option_handler, NULL },
 
   { {"endian", required_argument, NULL, OPTION_ENDIAN},
       'E', "big|little", "Set endianness",
-      standard_option_handler },
+      standard_option_handler, NULL },
 
 #ifdef SIM_HAVE_ENVIRONMENT
   /* This option isn't supported unless all choices are supported in keeping
@@ -205,9 +205,9 @@ static const OPTION standard_options[] =
   { {"sysroot", required_argument, NULL, OPTION_SYSROOT},
       '\0', "SYSROOT",
     "Root for system calls with absolute file-names and cwd at start",
-      standard_option_handler },
+      standard_option_handler, NULL },
 
-  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
+  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL, NULL }
 };
 
 static SIM_RC
index dabf14a1d653c883f1ae197003f5d90ee3659fb4..5f6b3f1fb32f00e6e5d27a689267ce6086e71a7b 100644 (file)
@@ -60,56 +60,56 @@ enum {
 static const OPTION profile_options[] = {
   { {"profile", optional_argument, NULL, 'p'},
       'p', "on|off", "Perform profiling",
-      profile_option_handler },
+      profile_option_handler, NULL },
   { {"profile-insn", optional_argument, NULL, OPTION_PROFILE_INSN},
       '\0', "on|off", "Perform instruction profiling",
-      profile_option_handler },
+      profile_option_handler, NULL },
   { {"profile-memory", optional_argument, NULL, OPTION_PROFILE_MEMORY},
       '\0', "on|off", "Perform memory profiling",
-      profile_option_handler },
+      profile_option_handler, NULL },
   { {"profile-core", optional_argument, NULL, OPTION_PROFILE_CORE},
       '\0', "on|off", "Perform CORE profiling",
-      profile_option_handler },
+      profile_option_handler, NULL },
   { {"profile-model", optional_argument, NULL, OPTION_PROFILE_MODEL},
       '\0', "on|off", "Perform model profiling",
-      profile_option_handler },
+      profile_option_handler, NULL },
   { {"profile-cpu-frequency", required_argument, NULL,
      OPTION_PROFILE_CPU_FREQUENCY},
       '\0', "CPU FREQUENCY", "Specify the speed of the simulated cpu clock",
-      profile_option_handler },
+      profile_option_handler, NULL },
 
   { {"profile-file", required_argument, NULL, OPTION_PROFILE_FILE},
       '\0', "FILE NAME", "Specify profile output file",
-      profile_option_handler },
+      profile_option_handler, NULL },
 
   { {"profile-pc", optional_argument, NULL, OPTION_PROFILE_PC},
       '\0', "on|off", "Perform PC profiling",
-      profile_option_handler },
+      profile_option_handler, NULL },
   { {"profile-pc-frequency", required_argument, NULL, 'F'},
       'F', "PC PROFILE FREQUENCY", "Specified PC profiling frequency",
-      profile_option_handler },
+      profile_option_handler, NULL },
   { {"profile-pc-size", required_argument, NULL, 'S'},
       'S', "PC PROFILE SIZE", "Specify PC profiling size",
-      profile_option_handler },
+      profile_option_handler, NULL },
   { {"profile-pc-granularity", required_argument, NULL, OPTION_PROFILE_PC_GRANULARITY},
       '\0', "PC PROFILE GRANULARITY", "Specify PC profiling sample coverage",
-      profile_option_handler },
+      profile_option_handler, NULL },
   { {"profile-pc-range", required_argument, NULL, OPTION_PROFILE_PC_RANGE},
       '\0', "BASE,BOUND", "Specify PC profiling address range",
-      profile_option_handler },
+      profile_option_handler, NULL },
 
 #ifdef SIM_HAVE_ADDR_RANGE
   { {"profile-range", required_argument, NULL, OPTION_PROFILE_RANGE},
       '\0', "START,END", "Specify range of addresses for instruction and model profiling",
-      profile_option_handler },
+      profile_option_handler, NULL },
 #if 0 /*wip*/
   { {"profile-function", required_argument, NULL, OPTION_PROFILE_FUNCTION},
       '\0', "FUNCTION", "Specify function to profile",
-      profile_option_handler },
+      profile_option_handler, NULL },
 #endif
 #endif
 
-  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
+  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL, NULL }
 };
 
 /* Set/reset the profile options indicated in MASK.  */
index 358a01dce9a153380f45d4e88ddf5e5d71ed5942..84db811205226a4daccdc84d60d12986ef7b6b4f 100644 (file)
@@ -85,63 +85,63 @@ static const OPTION trace_options[] =
   /* This table is organized to group related instructions together.  */
   { {"trace", optional_argument, NULL, 't'},
       't', "on|off", "Trace useful things",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-insn", optional_argument, NULL, OPTION_TRACE_INSN},
       '\0', "on|off", "Perform instruction tracing",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-decode", optional_argument, NULL, OPTION_TRACE_DECODE},
       '\0', "on|off", "Trace instruction decoding",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-extract", optional_argument, NULL, OPTION_TRACE_EXTRACT},
       '\0', "on|off", "Trace instruction extraction",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-linenum", optional_argument, NULL, OPTION_TRACE_LINENUM},
       '\0', "on|off", "Perform line number tracing (implies --trace-insn)",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-memory", optional_argument, NULL, OPTION_TRACE_MEMORY},
       '\0', "on|off", "Trace memory operations",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-alu", optional_argument, NULL, OPTION_TRACE_ALU},
       '\0', "on|off", "Trace ALU operations",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-fpu", optional_argument, NULL, OPTION_TRACE_FPU},
       '\0', "on|off", "Trace FPU operations",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-vpu", optional_argument, NULL, OPTION_TRACE_VPU},
       '\0', "on|off", "Trace VPU operations",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-branch", optional_argument, NULL, OPTION_TRACE_BRANCH},
       '\0', "on|off", "Trace branching",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-semantics", optional_argument, NULL, OPTION_TRACE_SEMANTICS},
       '\0', "on|off", "Perform ALU, FPU, MEMORY, and BRANCH tracing",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-model", optional_argument, NULL, OPTION_TRACE_MODEL},
       '\0', "on|off", "Include model performance data",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-core", optional_argument, NULL, OPTION_TRACE_CORE},
       '\0', "on|off", "Trace core operations",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-events", optional_argument, NULL, OPTION_TRACE_EVENTS},
       '\0', "on|off", "Trace events",
-      trace_option_handler },
+      trace_option_handler, NULL },
 #ifdef SIM_HAVE_ADDR_RANGE
   { {"trace-range", required_argument, NULL, OPTION_TRACE_RANGE},
       '\0', "START,END", "Specify range of addresses for instruction tracing",
-      trace_option_handler },
+      trace_option_handler, NULL },
 #if 0 /*wip*/
   { {"trace-function", required_argument, NULL, OPTION_TRACE_FUNCTION},
       '\0', "FUNCTION", "Specify function to trace",
-      trace_option_handler },
+      trace_option_handler, NULL },
 #endif
 #endif
   { {"trace-debug", optional_argument, NULL, OPTION_TRACE_DEBUG},
       '\0', "on|off", "Add information useful for debugging the simulator to the tracing output",
-      trace_option_handler },
+      trace_option_handler, NULL },
   { {"trace-file", required_argument, NULL, OPTION_TRACE_FILE},
       '\0', "FILE NAME", "Specify tracing output file",
-      trace_option_handler },
-  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
+      trace_option_handler, NULL },
+  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL, NULL }
 };
 
 /* Set/reset the trace options indicated in MASK.  */
index 17125afb9a53a0bcaa842fbee31b82335184a618..1bf27039f8c100eff77e901039b6e591863e6530 100644 (file)
@@ -372,13 +372,13 @@ static const OPTION watchpoint_options[] =
 {
   { {"watch-delete", required_argument, NULL, OPTION_WATCH_DELETE },
       '\0', "IDENT|all|pc|cycles|clock", "Delete a watchpoint",
-      watchpoint_option_handler },
+      watchpoint_option_handler, NULL },
 
   { {"watch-info", no_argument, NULL, OPTION_WATCH_INFO },
       '\0', NULL, "List scheduled watchpoints",
-      watchpoint_option_handler },
+      watchpoint_option_handler, NULL },
 
-  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
+  { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL, NULL }
 };
 
 static const char *default_interrupt_names[] = { "int", 0, };