From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23739 invoked by alias); 29 Mar 2010 22:37:38 -0000 Received: (qmail 23730 invoked by uid 22791); 29 Mar 2010 22:37:37 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Mar 2010 22:37:31 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 6AC9A1B40D8 for ; Mon, 29 Mar 2010 22:37:29 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH v2] sim: convert old style function definitions Date: Mon, 29 Mar 2010 22:37:00 -0000 Message-Id: <1269902240-10778-1-git-send-email-vapier@gentoo.org> In-Reply-To: <1269901514-10625-1-git-send-email-vapier@gentoo.org> References: <1269901514-10625-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg01030.txt.bz2 Some more old style function definitions conversions to fix GCC warnings: sim-options.c: In function 'dup_arg_p': sim-options.c:480: warning: old-style function definition sim-options.c: In function 'sim_parse_args': sim-options.c:512: warning: old-style function definition sim-options.c: In function 'sim_print_help': sim-options.c:799: warning: old-style function definition sim-trace.c: In function 'set_trace_option_mask': sim-trace.c:155: warning: old-style function definition sim-trace.c: In function 'set_trace_option': sim-trace.c:234: warning: old-style function definition sim-utils.c: In function 'sim_analyze_program': sim-utils.c:227: warning: old-style function definition sim-utils.c: In function 'sim_elapsed_time_get': sim-utils.c:301: warning: old-style function definition sim-utils.c: In function 'sim_elapsed_time_since': sim-utils.c:322: warning: old-style function definition Signed-off-by: Mike Frysinger --- v2 - err, forgot to actually include dup_arg_p changes. 2010-03-29 Mike Frysinger * 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. sim/common/sim-options.c | 11 +++-------- sim/common/sim-trace.c | 12 ++---------- sim/common/sim-utils.c | 10 +++------- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index 3369ca2..571b292 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -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) static int -dup_arg_p (arg) - char *arg; +dup_arg_p (char *arg) { int hash; static char **arg_table = NULL; @@ -520,9 +519,7 @@ dup_arg_p (arg) /* Called by sim_open to parse the arguments. */ SIM_RC -sim_parse_args (sd, argv) - SIM_DESC sd; - char **argv; +sim_parse_args (SIM_DESC sd, char **argv) { int c, i, argc, num_opts; 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. */ void -sim_print_help (sd, is_command) - SIM_DESC sd; - int is_command; +sim_print_help (SIM_DESC sd, int is_command) { if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE) sim_io_printf (sd, "Usage: %s [options] program [program args]\n", diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c index 2397fe8..478cbfa 100644 --- a/sim/common/sim-trace.c +++ b/sim/common/sim-trace.c @@ -147,11 +147,7 @@ static const OPTION trace_options[] = /* Set/reset the trace options indicated in MASK. */ static SIM_RC -set_trace_option_mask (sd, name, mask, arg) - SIM_DESC sd; - const char *name; - int mask; - const char *arg; +set_trace_option_mask (SIM_DESC sd, const char *name, int mask, const char *arg) { int trace_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. */ static SIM_RC -set_trace_option (sd, name, idx, arg) - SIM_DESC sd; - const char *name; - int idx; - const char *arg; +set_trace_option (SIM_DESC sd, const char *name, int idx, const char *arg) { return set_trace_option_mask (sd, name, 1 << idx, arg); } diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c index 033be5c..fb84eb3 100644 --- a/sim/common/sim-utils.c +++ b/sim/common/sim-utils.c @@ -218,10 +218,7 @@ sim_add_commas (char *buf, int sizeof_buf, unsigned long value) bfd open. */ SIM_RC -sim_analyze_program (sd, prog_name, prog_bfd) - SIM_DESC sd; - char *prog_name; - bfd *prog_bfd; +sim_analyze_program (SIM_DESC sd, char *prog_name, bfd *prog_bfd) { asection *s; 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. */ SIM_ELAPSED_TIME -sim_elapsed_time_get () +sim_elapsed_time_get (void) { #ifdef HAVE_GETRUSAGE struct rusage mytime; @@ -315,8 +312,7 @@ sim_elapsed_time_get () The actual time may be cpu usage (preferred) or wall clock. */ unsigned long -sim_elapsed_time_since (start) - SIM_ELAPSED_TIME start; +sim_elapsed_time_since (SIM_ELAPSED_TIME start) { #ifdef HAVE_GETRUSAGE return sim_elapsed_time_get () - start; -- 1.7.0.2