From ae6743cf69163c1f24897aa03b990b4c6512762e Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Thu, 10 Jul 2014 13:15:03 -0700 Subject: [PATCH] Easy changes for -Wmissing-prototypes --- driver/main.c | 10 +++++----- driver/substit.c | 1 + libveriuser/a_fetch_argc.c | 1 + libveriuser/a_fetch_argv.c | 1 + libveriuser/nodeinfo.c | 3 ++- libveriuser/nump.c | 1 + tgt-stub/expression.c | 2 +- tgt-stub/statement.c | 2 +- tgt-vlog95/expr.c | 2 +- tgt-vlog95/logic_lpm.c | 2 +- tgt-vlog95/scope.c | 6 +++--- tgt-vvp/vvp_scope.c | 6 ++++-- vpi/sys_queue.c | 4 ++-- vpi/sys_random.c | 14 +++++++------- vpi/table_mod.c | 2 +- vpi/v2005_math.c | 2 +- vpi/va_math.c | 2 +- 17 files changed, 34 insertions(+), 27 deletions(-) diff --git a/driver/main.c b/driver/main.c index 4093ff0f3..b15bbf728 100644 --- a/driver/main.c +++ b/driver/main.c @@ -188,7 +188,7 @@ static const char** defparm_base = 0; static int defparm_size = 0; /* Function to add a command file name to the FIFO. */ -void add_cmd_file(const char* filename) +static void add_cmd_file(const char* filename) { p_command_file new; @@ -205,7 +205,7 @@ void add_cmd_file(const char* filename) } /* Function to return the top command file name from the FIFO. */ -char *get_cmd_file(void) +static char *get_cmd_file(void) { char *filename; @@ -625,7 +625,7 @@ void process_file_name(const char*name, int lib_flag) } } -int process_generation(const char*name) +static int process_generation(const char*name) { if (strcmp(name,"1995") == 0) generation = "1995"; @@ -750,7 +750,7 @@ int process_generation(const char*name) return 0; } -int process_depfile(const char*name) +static int process_depfile(const char*name) { const char*cp = strchr(name, '='); if (cp) { @@ -784,7 +784,7 @@ int process_depfile(const char*name) /* * If it exists add the SFT file for the given module. */ -void add_sft_file(const char *module) +static void add_sft_file(const char *module) { char *file; diff --git a/driver/substit.c b/driver/substit.c index c71ea9f2a..5a7b9a239 100644 --- a/driver/substit.c +++ b/driver/substit.c @@ -21,6 +21,7 @@ # include # include # include "ivl_alloc.h" +# include "globals.h" char* substitutions(const char*str) diff --git a/libveriuser/a_fetch_argc.c b/libveriuser/a_fetch_argc.c index eadeef4bb..669807a6b 100644 --- a/libveriuser/a_fetch_argc.c +++ b/libveriuser/a_fetch_argc.c @@ -19,6 +19,7 @@ # include # include +# include /* * acc_fetch_argc implemented using VPI interface diff --git a/libveriuser/a_fetch_argv.c b/libveriuser/a_fetch_argv.c index 1f447a8a1..6d22a0404 100644 --- a/libveriuser/a_fetch_argv.c +++ b/libveriuser/a_fetch_argv.c @@ -19,6 +19,7 @@ # include # include +# include /* * acc_fetch_argv implemented using VPI interface diff --git a/libveriuser/nodeinfo.c b/libveriuser/nodeinfo.c index 49582d89f..4f7baf5f0 100644 --- a/libveriuser/nodeinfo.c +++ b/libveriuser/nodeinfo.c @@ -23,7 +23,8 @@ # include # include "priv.h" -struct t_tfnoeinfo* tf_nodeinfo(PLI_INT32 a, struct t_tfnodeinfo*ip) +/* XXX Not declared or used anywhere? */ +struct t_tfnodeinfo* tf_nodeinfo(PLI_INT32 a, struct t_tfnodeinfo*ip) { (void)a; /* Parameter is not used. */ (void)ip; /* Parameter is not used. */ diff --git a/libveriuser/nump.c b/libveriuser/nump.c index c1449cae2..38d574020 100644 --- a/libveriuser/nump.c +++ b/libveriuser/nump.c @@ -19,6 +19,7 @@ #include #include +#include "veriuser.h" /* * tf_nump implemented using VPI interface diff --git a/tgt-stub/expression.c b/tgt-stub/expression.c index 610802a5d..cd8a5f4fe 100644 --- a/tgt-stub/expression.c +++ b/tgt-stub/expression.c @@ -386,7 +386,7 @@ static void show_ternary_expression(ivl_expr_t net, unsigned ind) } } -void show_unary_expression(ivl_expr_t net, unsigned ind) +static void show_unary_expression(ivl_expr_t net, unsigned ind) { unsigned width = ivl_expr_width(net); const char*sign = ivl_expr_signed(net)? "signed" : "unsigned"; diff --git a/tgt-stub/statement.c b/tgt-stub/statement.c index 0d95f771a..4777ed00f 100644 --- a/tgt-stub/statement.c +++ b/tgt-stub/statement.c @@ -269,7 +269,7 @@ static void show_stmt_trigger(ivl_statement_t net, unsigned ind) * The wait statement contains simply an array of events to wait on, * and a sub-statement to execute when an event triggers. */ -void show_stmt_wait(ivl_statement_t net, unsigned ind) +static void show_stmt_wait(ivl_statement_t net, unsigned ind) { unsigned idx; const char*comma = ""; diff --git a/tgt-vlog95/expr.c b/tgt-vlog95/expr.c index 95979983f..7b029c9ac 100644 --- a/tgt-vlog95/expr.c +++ b/tgt-vlog95/expr.c @@ -630,7 +630,7 @@ static void emit_expr_real_number(ivl_scope_t scope, ivl_expr_t expr, /* * Class properties are not supported in vlog95, but they can be translated. */ -void emit_class_property(ivl_scope_t scope, ivl_expr_t expr, unsigned wid) +static void emit_class_property(ivl_scope_t scope, ivl_expr_t expr, unsigned wid) { ivl_signal_t sig = ivl_expr_signal(expr); (void)wid; /* Parameter is not used. */ diff --git a/tgt-vlog95/logic_lpm.c b/tgt-vlog95/logic_lpm.c index 457ea648c..5e1bec833 100644 --- a/tgt-vlog95/logic_lpm.c +++ b/tgt-vlog95/logic_lpm.c @@ -1486,7 +1486,7 @@ static void emit_lpm_part_pv(ivl_scope_t scope, ivl_lpm_t lpm) fprintf(vlog_out, "]"); } -unsigned output_is_module_instantiation_input(ivl_scope_t scope, +static unsigned output_is_module_instantiation_input(ivl_scope_t scope, ivl_nexus_t nex) { unsigned idx, count = ivl_nexus_ptrs(nex); diff --git a/tgt-vlog95/scope.c b/tgt-vlog95/scope.c index 382187d1f..afdefdb07 100644 --- a/tgt-vlog95/scope.c +++ b/tgt-vlog95/scope.c @@ -51,7 +51,7 @@ static const char*get_time_const(int time_value) } } -void emit_func_return(ivl_signal_t sig) +static void emit_func_return(ivl_signal_t sig) { if (ivl_signal_dimensions(sig) > 0) { fprintf(stderr, "%s:%u: vlog95 error: A function cannot return " @@ -86,7 +86,7 @@ static void emit_sig_id(ivl_signal_t sig) fprintf(vlog_out, "\n"); } -void emit_var_def(ivl_signal_t sig) +static void emit_var_def(ivl_signal_t sig) { if (ivl_signal_local(sig)) return; fprintf(vlog_out, "%*c", indent, ' '); @@ -199,7 +199,7 @@ static void save_net_constants(ivl_scope_t scope, ivl_signal_t sig) } } -void emit_net_def(ivl_scope_t scope, ivl_signal_t sig) +static void emit_net_def(ivl_scope_t scope, ivl_signal_t sig) { int msb, lsb; get_sig_msb_lsb(sig, &msb, &lsb); diff --git a/tgt-vvp/vvp_scope.c b/tgt-vvp/vvp_scope.c index 7cbadf913..edbab12a4 100644 --- a/tgt-vvp/vvp_scope.c +++ b/tgt-vvp/vvp_scope.c @@ -134,7 +134,7 @@ const char* vvp_signal_label(ivl_signal_t sig) return buf; } -ivl_signal_t signal_of_nexus(ivl_nexus_t nex, unsigned*word) +static ivl_signal_t signal_of_nexus(ivl_nexus_t nex, unsigned*word) { unsigned idx; for (idx = 0 ; idx < ivl_nexus_ptrs(nex) ; idx += 1) { @@ -180,7 +180,7 @@ ivl_variable_type_t data_type_of_nexus(ivl_nexus_t nex) } -ivl_nexus_ptr_t ivl_logic_pin_ptr(ivl_net_logic_t net, unsigned pin) +static ivl_nexus_ptr_t ivl_logic_pin_ptr(ivl_net_logic_t net, unsigned pin) { ivl_nexus_t nex = ivl_logic_pin(net, pin); unsigned idx; @@ -201,6 +201,7 @@ ivl_nexus_ptr_t ivl_logic_pin_ptr(ivl_net_logic_t net, unsigned pin) return 0; } +#if 0 const char*drive_string(ivl_drive_t drive) { switch (drive) { @@ -224,6 +225,7 @@ const char*drive_string(ivl_drive_t drive) return ""; } +#endif /* diff --git a/vpi/sys_queue.c b/vpi/sys_queue.c index 55bd2b802..3d34c7b4a 100644 --- a/vpi/sys_queue.c +++ b/vpi/sys_queue.c @@ -57,7 +57,7 @@ /* * Routine to add the given time to the the total time (high/low). */ -void add_to_wait_time(uint64_t *high, uint64_t *low, uint64_t c_time) +static void add_to_wait_time(uint64_t *high, uint64_t *low, uint64_t c_time) { uint64_t carry = 0U; @@ -71,7 +71,7 @@ void add_to_wait_time(uint64_t *high, uint64_t *low, uint64_t c_time) * Routine to divide the given total time (high/low) by the number of * items to get the average. */ -uint64_t calc_average_wait_time(uint64_t high, uint64_t low, uint64_t total) +static uint64_t calc_average_wait_time(uint64_t high, uint64_t low, uint64_t total) { int bit = 64; uint64_t result = 0U; diff --git a/vpi/sys_random.c b/vpi/sys_random.c index 14fb9cf3d..f774764a6 100644 --- a/vpi/sys_random.c +++ b/vpi/sys_random.c @@ -41,7 +41,7 @@ static double chi_square(long *seed, long deg_of_free); static double t(long *seed, long deg_of_free); static double erlangian(long *seed, long k, long mean); -long rtl_dist_chi_square(long *seed, long df) +static long rtl_dist_chi_square(long *seed, long df) { double r; long i; @@ -64,7 +64,7 @@ long rtl_dist_chi_square(long *seed, long df) return i; } -long rtl_dist_erlang(long *seed, long k, long mean) +static long rtl_dist_erlang(long *seed, long k, long mean) { double r; long i; @@ -87,7 +87,7 @@ long rtl_dist_erlang(long *seed, long k, long mean) return i; } -long rtl_dist_exponential(long *seed, long mean) +static long rtl_dist_exponential(long *seed, long mean) { double r; long i; @@ -110,7 +110,7 @@ long rtl_dist_exponential(long *seed, long mean) return i; } -long rtl_dist_normal(long *seed, long mean, long sd) +static long rtl_dist_normal(long *seed, long mean, long sd) { double r; long i; @@ -127,7 +127,7 @@ long rtl_dist_normal(long *seed, long mean, long sd) return i; } -long rtl_dist_poisson(long *seed, long mean) +static long rtl_dist_poisson(long *seed, long mean) { long i; @@ -142,7 +142,7 @@ long rtl_dist_poisson(long *seed, long mean) return i; } -long rtl_dist_t(long *seed, long df) +static long rtl_dist_t(long *seed, long df) { double r; long i; @@ -166,7 +166,7 @@ long rtl_dist_t(long *seed, long df) } /* copied from IEEE1364-2001, with slight modifications for 64bit machines. */ -long rtl_dist_uniform(long *seed, long start, long end) +static long rtl_dist_uniform(long *seed, long start, long end) { double r; long i; diff --git a/vpi/table_mod.c b/vpi/table_mod.c index d0d587948..43609989b 100644 --- a/vpi/table_mod.c +++ b/vpi/table_mod.c @@ -92,7 +92,7 @@ static p_table_mod create_table(void) * Check to see if this is a constant string. It returns 1 if the argument * is a constant string otherwise it returns 0. */ -unsigned is_const_string_obj(vpiHandle arg) +static unsigned is_const_string_obj(vpiHandle arg) { unsigned rtn = 0; diff --git a/vpi/v2005_math.c b/vpi/v2005_math.c index e9ffc360c..aec4d9d52 100644 --- a/vpi/v2005_math.c +++ b/vpi/v2005_math.c @@ -137,7 +137,7 @@ static void va_error_message(vpiHandle callh, const char *format, /* * Process an argument. */ -vpiHandle va_process_argument(vpiHandle callh, const char *name, +static vpiHandle va_process_argument(vpiHandle callh, const char *name, vpiHandle arg, const char *post) { PLI_INT32 type; diff --git a/vpi/va_math.c b/vpi/va_math.c index e9b1a0b0c..5c5e4105a 100644 --- a/vpi/va_math.c +++ b/vpi/va_math.c @@ -164,7 +164,7 @@ static void va_error_message(vpiHandle callh, const char *format, /* * Process an argument. */ -vpiHandle va_process_argument(vpiHandle callh, const char *name, +static vpiHandle va_process_argument(vpiHandle callh, const char *name, vpiHandle arg, const char *post) { PLI_INT32 type;