sim: convert old style function definitions
GCC currently emits warnings like: nrun.c: In function 'usage': nrun.c:223: warning: old-style function definition
This commit is contained in:
parent
f68eb6123c
commit
dc41661593
5 changed files with 21 additions and 26 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
2010-03-30 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* nrun.c (usage): Use void in definition.
|
||||||
|
* sim-options.c (dup_arg_p): Convert old-style function definition.
|
||||||
|
(sim_parse_args): Likewise.
|
||||||
|
(sim_print_help): Likewise.
|
||||||
|
* sim-trace.c (set_trace_option_mask): Likewise.
|
||||||
|
(set_trace_option): Likewise.
|
||||||
|
* sim-utils.c (sim_analyze_program): Likewise.
|
||||||
|
(sim_elapsed_time_get): Likewise.
|
||||||
|
(sim_elapsed_time_since): Likewise.
|
||||||
|
|
||||||
2010-03-22 Mike Frysinger <vapier@gentoo.org>
|
2010-03-22 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* sim/common/sim-options.c (enum): Remove SIM_HAVE_BIENDIAN ifdef.
|
* sim/common/sim-options.c (enum): Remove SIM_HAVE_BIENDIAN ifdef.
|
||||||
|
|
|
@ -219,7 +219,7 @@ main (int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage ()
|
usage (void)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "Usage: %s [options] program [program args]\n", myname);
|
fprintf (stderr, "Usage: %s [options] program [program args]\n", myname);
|
||||||
fprintf (stderr, "Run `%s --help' for full list of options.\n", myname);
|
fprintf (stderr, "Run `%s --help' for full list of options.\n", myname);
|
||||||
|
|
|
@ -489,8 +489,7 @@ standard_install (SIM_DESC sd)
|
||||||
#define ARG_HASH(a) ((256 * (unsigned char) a[0] + (unsigned char) a[1]) % ARG_HASH_SIZE)
|
#define ARG_HASH(a) ((256 * (unsigned char) a[0] + (unsigned char) a[1]) % ARG_HASH_SIZE)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dup_arg_p (arg)
|
dup_arg_p (char *arg)
|
||||||
char *arg;
|
|
||||||
{
|
{
|
||||||
int hash;
|
int hash;
|
||||||
static char **arg_table = NULL;
|
static char **arg_table = NULL;
|
||||||
|
@ -520,9 +519,7 @@ dup_arg_p (arg)
|
||||||
/* Called by sim_open to parse the arguments. */
|
/* Called by sim_open to parse the arguments. */
|
||||||
|
|
||||||
SIM_RC
|
SIM_RC
|
||||||
sim_parse_args (sd, argv)
|
sim_parse_args (SIM_DESC sd, char **argv)
|
||||||
SIM_DESC sd;
|
|
||||||
char **argv;
|
|
||||||
{
|
{
|
||||||
int c, i, argc, num_opts;
|
int c, i, argc, num_opts;
|
||||||
char *p, *short_options;
|
char *p, *short_options;
|
||||||
|
@ -807,9 +804,7 @@ print_help (SIM_DESC sd, sim_cpu *cpu, const struct option_list *ol, int is_comm
|
||||||
/* Print help messages for the options. */
|
/* Print help messages for the options. */
|
||||||
|
|
||||||
void
|
void
|
||||||
sim_print_help (sd, is_command)
|
sim_print_help (SIM_DESC sd, int is_command)
|
||||||
SIM_DESC sd;
|
|
||||||
int is_command;
|
|
||||||
{
|
{
|
||||||
if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE)
|
if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE)
|
||||||
sim_io_printf (sd, "Usage: %s [options] program [program args]\n",
|
sim_io_printf (sd, "Usage: %s [options] program [program args]\n",
|
||||||
|
|
|
@ -147,11 +147,7 @@ static const OPTION trace_options[] =
|
||||||
/* Set/reset the trace options indicated in MASK. */
|
/* Set/reset the trace options indicated in MASK. */
|
||||||
|
|
||||||
static SIM_RC
|
static SIM_RC
|
||||||
set_trace_option_mask (sd, name, mask, arg)
|
set_trace_option_mask (SIM_DESC sd, const char *name, int mask, const char *arg)
|
||||||
SIM_DESC sd;
|
|
||||||
const char *name;
|
|
||||||
int mask;
|
|
||||||
const char *arg;
|
|
||||||
{
|
{
|
||||||
int trace_nr;
|
int trace_nr;
|
||||||
int cpu_nr;
|
int cpu_nr;
|
||||||
|
@ -226,11 +222,7 @@ set_trace_option_mask (sd, name, mask, arg)
|
||||||
/* Set one trace option based on its IDX value. */
|
/* Set one trace option based on its IDX value. */
|
||||||
|
|
||||||
static SIM_RC
|
static SIM_RC
|
||||||
set_trace_option (sd, name, idx, arg)
|
set_trace_option (SIM_DESC sd, const char *name, int idx, const char *arg)
|
||||||
SIM_DESC sd;
|
|
||||||
const char *name;
|
|
||||||
int idx;
|
|
||||||
const char *arg;
|
|
||||||
{
|
{
|
||||||
return set_trace_option_mask (sd, name, 1 << idx, arg);
|
return set_trace_option_mask (sd, name, 1 << idx, arg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,10 +218,7 @@ sim_add_commas (char *buf, int sizeof_buf, unsigned long value)
|
||||||
bfd open. */
|
bfd open. */
|
||||||
|
|
||||||
SIM_RC
|
SIM_RC
|
||||||
sim_analyze_program (sd, prog_name, prog_bfd)
|
sim_analyze_program (SIM_DESC sd, char *prog_name, bfd *prog_bfd)
|
||||||
SIM_DESC sd;
|
|
||||||
char *prog_name;
|
|
||||||
bfd *prog_bfd;
|
|
||||||
{
|
{
|
||||||
asection *s;
|
asection *s;
|
||||||
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
|
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
|
||||||
|
@ -295,7 +292,7 @@ sim_analyze_program (sd, prog_name, prog_bfd)
|
||||||
/* Called before sim_elapsed_time_since to get a reference point. */
|
/* Called before sim_elapsed_time_since to get a reference point. */
|
||||||
|
|
||||||
SIM_ELAPSED_TIME
|
SIM_ELAPSED_TIME
|
||||||
sim_elapsed_time_get ()
|
sim_elapsed_time_get (void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_GETRUSAGE
|
#ifdef HAVE_GETRUSAGE
|
||||||
struct rusage mytime;
|
struct rusage mytime;
|
||||||
|
@ -315,8 +312,7 @@ sim_elapsed_time_get ()
|
||||||
The actual time may be cpu usage (preferred) or wall clock. */
|
The actual time may be cpu usage (preferred) or wall clock. */
|
||||||
|
|
||||||
unsigned long
|
unsigned long
|
||||||
sim_elapsed_time_since (start)
|
sim_elapsed_time_since (SIM_ELAPSED_TIME start)
|
||||||
SIM_ELAPSED_TIME start;
|
|
||||||
{
|
{
|
||||||
#ifdef HAVE_GETRUSAGE
|
#ifdef HAVE_GETRUSAGE
|
||||||
return sim_elapsed_time_get () - start;
|
return sim_elapsed_time_get () - start;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue