|
Message
From: =?unknown-8bit?Q?Gy=F6rgy?= 'nog' Jeney<nog@s...>
Date: Tue Jul 5 17:53:13 CEST 2005
Subject: [openrisc] [or1ksim #144] C stylistic fixes
Hi,ChangeLog: * prototype() -> prototype(void) where appropriate. * Use `static' where it can be used.
nog. -------------- next part -------------- diff -upr --unidirectional-new-file ./cpu/or1k/sprs.c /home/nog/or1ksim-ac/cpu/or1k/sprs.c --- ./cpu/or1k/sprs.c 2005-07-05 16:19:21.000000000 +0200 +++ /home/nog/or1ksim-ac/cpu/or1k/sprs.c 2005-06-30 15:31:14.000000000 +0200 @@ -44,7 +44,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg DEFAULT_DEBUG_CHANNEL(spr); DECLARE_DEBUG_CHANNEL(immu); -int audio_cnt = 0; +static int audio_cnt = 0; static FILE *fo = 0; diff -upr --unidirectional-new-file ./cpu/or32/dyn_rec.c /home/nog/or1ksim-ac/cpu/or32/dyn_rec.c --- ./cpu/or32/dyn_rec.c 2005-07-05 16:19:20.000000000 +0200 +++ /home/nog/or1ksim-ac/cpu/or32/dyn_rec.c 2005-07-05 15:53:03.000000000 +0200 @@ -459,7 +459,7 @@ void run_sched_out_of_line(int add_norma } /* Signals a page as dirty */ -void dirtyfy_page(struct dyn_page *dp) +static void dirtyfy_page(struct dyn_page *dp) { oraddr_t check; diff -upr --unidirectional-new-file ./cpu/or32/execute.c /home/nog/or1ksim-ac/cpu/or32/execute.c --- ./cpu/or32/execute.c 2005-07-05 06:18:33.000000000 +0200 +++ /home/nog/or1ksim-ac/cpu/or32/execute.c 2005-06-12 16:18:55.000000000 +0200 @@ -295,7 +295,7 @@ static inline int fetch(void) } /* This code actually updates the PC value. */ -static inline void update_pc () +static inline void update_pc (void) { cpu_state.delay_insn = next_delay_insn; pcprev = cpu_state.pc; /* Store value for later */ @@ -605,7 +613,7 @@ static inline void decode_execute_wrappe } /* Reset the CPU */ -void cpu_reset() +void cpu_reset(void) { int i; struct hist_exec *hist_exec_head = NULL; diff -upr --unidirectional-new-file ./debug/debug_unit.c /home/nog/or1ksim-ac/debug/debug_unit.c --- ./debug/debug_unit.c 2005-07-05 16:19:18.000000000 +0200 +++ /home/nog/or1ksim-ac/debug/debug_unit.c 2005-07-05 16:15:10.000000000 +0200 @@ -77,13 +77,13 @@ void set_stall_state(int state) runtime.cpu.stalled = state; } -void du_reset() +void du_reset(void) { development.riscop = 0; set_stall_state (0); } -void du_clock() +void du_clock(void) { watchpoints=0; }; diff -upr --unidirectional-new-file ./debug/gdbcomm.c /home/nog/or1ksim-ac/debug/gdbcomm.c --- ./debug/gdbcomm.c 2005-07-05 06:18:33.000000000 +0200 +++ /home/nog/or1ksim-ac/debug/gdbcomm.c 2005-06-18 07:57:05.000000000 +0200 @@ -164,7 +164,7 @@ int GetServerSocket(const char* name,con return sockfd; } -void BlockJTAG() +void BlockJTAG(void) { struct pollfd fds[2]; int n = 0; @@ -260,7 +260,7 @@ void HandleServerSocket(Boolean block) } /* End of while statement */ } -void JTAGRequest() +void JTAGRequest(void) { struct sockaddr_in sa; struct sockaddr* addr = (struct sockaddr*)&sa; @@ -320,7 +320,7 @@ void JTAGRequest() gdb_fd = fd; } -void GDBRequest() +void GDBRequest(void) { JTAGProxyWriteMessage msg_write; JTAGProxyReadMessage msg_read; @@ -660,7 +660,7 @@ static int gdb_read(void* buf,int len)
return 0;
}
-int gdbcomm_init ()
+int gdbcomm_init (void)
{
serverPort = config.debug.server_port;
if((server_fd = GetServerSocket("or1ksim","tcp",serverPort)))
diff -upr --unidirectional-new-file ./mprofiler.c /home/nog/or1ksim-ac/mprofiler.c
--- ./mprofiler.c 2005-07-05 06:18:33.000000000 +0200
+++ /home/nog/or1ksim-ac/mprofiler.c 2005-06-06 15:30:50.000000000 +0200
@@ -58,7 +58,7 @@ oraddr_t end_addr = 0xffffffff;
/* File to read from */
static FILE *fprof = 0;
-void mp_help ()
+void mp_help (void)
{
PRINTF ("mprofiler <-d|-p|-a|-w> [-f filename] [-g group] from to\n");
PRINTF ("\t-d\t--detail\t\tdetailed output\n");
@@ -95,7 +95,7 @@ unsigned long hash_get (oraddr_t addr, i
return h->cnt[index];
}
-void init ()
+void init (void)
{
int i;
for (i = 0; i < HASH_SIZE; i++)
diff -upr --unidirectional-new-file ./mprofiler.h /home/nog/or1ksim-ac/mprofiler.h
--- ./mprofiler.h 2005-07-05 06:18:33.000000000 +0200
+++ /home/nog/or1ksim-ac/mprofiler.h 2005-06-06 15:30:33.000000000 +0200
@@ -37,6 +37,6 @@ Foundation, Inc., 675 Mass Ave, Cambridg
#define HASH_FUNC(x) ((x) & 0xffff)
int main_mprofiler (int argc, char *argv[]);
-void mp_help();
+void mp_help(void);
#endif /* not __MPROFILER_H */
diff -upr --unidirectional-new-file ./sim-config.c /home/nog/or1ksim-ac/sim-config.c
--- ./sim-config.c 2005-07-05 16:19:21.000000000 +0200
+++ /home/nog/or1ksim-ac/sim-config.c 2005-07-04 16:09:42.000000000 +0200
@@ -61,10 +52,8 @@ Foundation, Inc., 675 Mass Ave, Cambridg
struct config_section *sections = NULL;
-void init_defconfig()
+void init_defconfig(void)
{
- int i;
-
memset(&config, 0, sizeof(config));
/* Sim */
config.sim.exe_log = 0;
@@ -232,7 +231,7 @@ int parse_args(int argc, char *argv[])
return 0;
}
-void print_config()
+void print_config(void)
{
if (config.sim.verbose) {
char temp[20];
diff -upr --unidirectional-new-file ./sim-config.h /home/nog/or1ksim-ac/sim-config.h
--- ./sim-config.h 2005-07-05 06:18:33.000000000 +0200
+++ /home/nog/or1ksim-ac/sim-config.h 2005-07-04 16:09:17.000000000 +0200
@@ -236,14 +236,11 @@ void read_script_file (char *filename);
/* Executes set sim command. Returns nonzero if error. */
void set_config_command (int argc, char **argv);
-/* Outputs C structure of current config to file */
-void output_cfg (FILE *f);
-
-void init_defconfig();
+void init_defconfig(void);
int parse_args(int argc, char *argv[]);
-void print_config();
+void print_config(void);
void sim_done(void);
diff -upr --unidirectional-new-file ./toplevel.c /home/nog/or1ksim-ac/toplevel.c
--- ./toplevel.c 2005-07-05 16:19:20.000000000 +0200
+++ /home/nog/or1ksim-ac/toplevel.c 2005-07-05 16:11:38.000000000 +0200
@@ -148,7 +148,7 @@ struct sim_reset_hook {
struct sim_reset_hook *next;
};
-struct sim_reset_hook *sim_reset_hooks = NULL;
+static struct sim_reset_hook *sim_reset_hooks = NULL;
/* Registers a new reset hook, called when sim_reset below is called */
void reg_sim_reset(void (*reset_hook)(void *), void *dat)
@@ -346,8 +346,8 @@ void do_scheduler (void)
void recalc_do_stats(void)
{
extern int do_stats;
- do_stats = config.cpu.dependstats || config.cpu.superscalar ||
- config.cpu.dependstats || config.sim.history || config.sim.exe_log;
+ do_stats = config.cpu.superscalar || config.cpu.dependstats ||
+ config.sim.history || config.sim.exe_log;
}
/* Main function */
|
 |