sim: add missing values to array initializers

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>
This commit is contained in:
Mike Frysinger 2010-04-12 16:53:33 +00:00
parent 0d18d7205b
commit 21cf617c69
12 changed files with 74 additions and 60 deletions

View 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,

View 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 },
};

View 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 },
};

View 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 },
};

View 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

View File

@ -51,7 +51,7 @@ struct hw_port_data {
};
const struct hw_port_descriptor empty_hw_ports[] = {
{ NULL, },
{ NULL, 0, 0, 0 },
};
static void

View 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 }
};

View 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

View 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

View 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. */

View 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. */

View 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, };