Fuss with C function prototypes

119 formal void parameters added to keep -Wstrict-prototypes happy.
Process found one real missing prototype in vpi/vcd_priv.h:
EXTERN void vcd_names_delete(struct vcd_names_list_s*tab);
8 such warnings left, all in Tony's code
This commit is contained in:
Larry Doolittle 2014-07-08 12:12:54 -07:00 committed by Cary R
parent 78cb0a7876
commit 6ebb57195b
42 changed files with 120 additions and 120 deletions

View File

@ -79,7 +79,7 @@ static void thunker_register(void)
}
}
void (*vlog_startup_routines[])() = {
void (*vlog_startup_routines[])(void) = {
thunker_register,
0
};

View File

@ -247,7 +247,7 @@ void cfreset(FILE*fd, const char*path)
/*
* Modern version of flex (>=2.5.9) can clean up the scanner data.
*/
void destroy_lexor()
void destroy_lexor(void)
{
# ifdef FLEX_SCANNER
# if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5

View File

@ -38,7 +38,7 @@ int cflex(void);
int cferror(const char *);
int cfparse(void);
void switch_to_command_file(const char *);
void destroy_lexor();
void destroy_lexor(void);
char *current_file;
#endif

View File

@ -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()
char *get_cmd_file(void)
{
char *filename;
@ -402,7 +402,7 @@ static int t_preprocess_only(void)
* needed to run the command from the configuration file (which is
* already parsed for us) so we can handle must of the generic cases.
*/
static int t_compile()
static int t_compile(void)
{
unsigned rc;

View File

@ -22,11 +22,11 @@
# include <stdio.h>
extern void reset_lexor(FILE*out, char*paths[]);
extern void destroy_lexor();
extern void destroy_lexor(void);
extern void load_precompiled_defines(FILE*src);
extern void define_macro(const char*name, const char*value, int keyword,
int argc);
extern void free_macros();
extern void free_macros(void);
extern void dump_precompiled_defines(FILE*out);
/* These variables contain the include directories to be searched when
@ -54,6 +54,6 @@ extern char dep_mode;
extern int verbose_flag;
/* This is the entry to the lexer. */
extern int yylex();
extern int yylex(void);
#endif

View File

@ -30,29 +30,29 @@
# include "globals.h"
# include "ivl_alloc.h"
static void output_init();
static void output_init(void);
#define YY_USER_INIT output_init()
static void def_start();
static void def_add_arg();
static void def_finish();
static void def_undefine();
static void do_define();
static int def_is_done();
static void def_start(void);
static void def_add_arg(void);
static void def_finish(void);
static void def_undefine(void);
static void do_define(void);
static int def_is_done(void);
static int is_defined(const char*name);
static int macro_needs_args(const char*name);
static void macro_start_args();
static void macro_start_args(void);
static void macro_add_to_arg(int is_whitespace);
static void macro_finish_arg();
static void macro_finish_arg(void);
static void do_expand(int use_args);
static const char* do_magic(const char*name);
static const char* macro_name();
static const char* macro_name(void);
static void include_filename();
static void do_include();
static void include_filename(void);
static void do_include(void);
static int load_next_input();
static int load_next_input(void);
struct include_stack_t
{
@ -804,7 +804,7 @@ static /* inline */ char* def_argv(int arg)
return def_buf + def_argo[arg];
}
static void check_for_max_args()
static void check_for_max_args(void)
{
if (def_argc == MAX_DEF_ARG)
{
@ -825,14 +825,14 @@ static void def_buf_grow_to_fit(int length)
}
}
static void def_start()
static void def_start(void)
{
def_buf_free = def_buf_size;
def_argc = 0;
def_add_arg();
}
static void def_add_arg()
static void def_add_arg(void)
{
int length = yyleng;
@ -979,7 +979,7 @@ static void free_macro(struct define_t* def)
free(def);
}
void free_macros()
void free_macros(void)
{
free_macro(def_table);
}
@ -1052,7 +1052,7 @@ static char *find_arg(char*ptr, char*head, char*arg)
* continuation, then return 1 and this function may be called again
* to collect another line of the definition.
*/
static void do_define()
static void do_define(void)
{
char* cp;
char* head;
@ -1202,7 +1202,7 @@ static void do_define()
* Return true if the definition text is done. This is the opposite of
* the define_continue_flag.
*/
static int def_is_done()
static int def_is_done(void)
{
return !define_continue_flag;
}
@ -1212,7 +1212,7 @@ static int def_is_done()
* assigned value to the parsed name. If there is no value, then
* assign the string "" (empty string.)
*/
static void def_finish()
static void def_finish(void)
{
define_continue_flag = 0;
@ -1234,7 +1234,7 @@ static void def_finish()
def_argc = 0;
}
static void def_undefine()
static void def_undefine(void)
{
struct define_t* cur;
struct define_t* tail;
@ -1360,7 +1360,7 @@ static int macro_needs_args(const char*text)
}
}
static const char* macro_name()
static const char* macro_name(void)
{
return cur_macro ? cur_macro->name : "";
}
@ -1402,7 +1402,7 @@ static void macro_add_to_arg(int is_white_space)
def_buf_free -= length;
}
static void macro_finish_arg()
static void macro_finish_arg(void)
{
char* tail = &def_buf[def_buf_size - def_buf_free];
@ -1443,7 +1443,7 @@ static void exp_buf_grow_to_fit(int length)
}
}
static void expand_using_args()
static void expand_using_args(void)
{
char* head;
char* tail;
@ -1687,13 +1687,13 @@ static const char* do_magic(const char*name)
* parsing resumes.
*/
static void output_init()
static void output_init(void)
{
if (line_direct_flag)
fprintf(yyout, "`line 1 \"%s\" 0\n", istack->path);
}
static void include_filename()
static void include_filename(void)
{
if(standby) {
emit_pathline(istack);
@ -1712,7 +1712,7 @@ static void include_filename()
standby->comment = NULL;
}
static void do_include()
static void do_include(void)
{
/* standby is defined by include_filename() */
if (standby->path[0] == '/') {
@ -1835,7 +1835,7 @@ static void emit_pathline(struct include_stack_t* isp)
fprintf(stderr, "%s:%u: ", isp->path, isp->lineno+1);
}
static void lexor_done()
static void lexor_done(void)
{
while (ifdef_stack)
{
@ -1923,7 +1923,7 @@ static void open_input_file(struct include_stack_t*isp)
* end of a base file, in which case the next base source file is
* opened.
*/
static int load_next_input()
static int load_next_input(void)
{
int line_mask_flag = 0;
struct include_stack_t* isp = istack;
@ -2193,7 +2193,7 @@ void reset_lexor(FILE* out, char* paths[])
/*
* Modern version of flex (>=2.5.9) can clean up the scanner data.
*/
void destroy_lexor()
void destroy_lexor(void)
{
# ifdef FLEX_SCANNER
# if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5

View File

@ -1201,7 +1201,7 @@ static void emit_lpm_as_ca(ivl_scope_t scope, ivl_lpm_t lpm,
if (sign_type != NO_SIGN) fprintf(vlog_out, ")");
}
static void emit_posedge_dff_prim()
static void emit_posedge_dff_prim(void)
{
fprintf(vlog_out, "\n");
fprintf(vlog_out, "/* Icarus generated UDP to represent a synthesized "

View File

@ -23,7 +23,7 @@
static unsigned single_indent = 0;
static unsigned get_indent()
static unsigned get_indent(void)
{
if (single_indent) {
single_indent = 0;

View File

@ -106,10 +106,10 @@ extern void emit_nexus_as_ca(ivl_scope_t scope, ivl_nexus_t nex,
extern void emit_nexus_port_driver_as_ca(ivl_scope_t scope, ivl_nexus_t nex);
extern void emit_const_nexus(ivl_scope_t scope, ivl_net_const_t const_net);
extern void emit_signal_net_const_as_ca(ivl_scope_t scope, ivl_signal_t sig);
extern void emit_icarus_generated_udps();
extern void emit_icarus_generated_udps(void);
extern void add_udp_to_list(ivl_udp_t udp);
extern void emit_udp_list();
extern void emit_udp_list(void);
extern void emit_sig_file_line(ivl_signal_t sig);
extern void emit_id(const char *id);
@ -148,7 +148,7 @@ extern void get_sig_msb_lsb(ivl_signal_t sig, int *msb, int *lsb);
/*
* Cleanup functions.
*/
extern void free_emitted_scope_list();
extern void free_emitted_scope_list(void);
/*
* Debug routine to dump the various pieces of nexus information.

View File

@ -158,7 +158,7 @@ static char* draw_C8_to_string(ivl_net_const_t cptr,
return result;
}
static struct vvp_nexus_data*new_nexus_data()
static struct vvp_nexus_data*new_nexus_data(void)
{
struct vvp_nexus_data*data = calloc(1, sizeof(struct vvp_nexus_data));
return data;

View File

@ -176,7 +176,7 @@ struct vvp_nexus_data {
* cache it.
*/
extern const char* draw_net_input(ivl_nexus_t nex);
void EOC_cleanup_drivers();
void EOC_cleanup_drivers(void);
/*
* This is different from draw_net_input in that it is intended to be

View File

@ -213,7 +213,7 @@ static void process_quoted_string(void)
/*
* Modern version of flex (>=2.5.9) can clean up the scanner data.
*/
static void destroy_sdf_lexor()
static void destroy_sdf_lexor(void)
{
# ifdef FLEX_SCANNER
# if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5

View File

@ -231,7 +231,7 @@ static PLI_INT32 sys_rtoi_calltf(ICARUS_VPI_CONST PLI_BYTE8*user)
return 0;
}
void sys_convert_register()
void sys_convert_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -196,7 +196,7 @@ args_done:
/*
* Routine to register the system tasks/functions provided in this file.
*/
void sys_countdrivers_register()
void sys_countdrivers_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -90,7 +90,7 @@ static PLI_INT32 sys_deposit_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
return 0;
}
void sys_deposit_register()
void sys_deposit_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -2062,7 +2062,7 @@ static PLI_INT32 sys_end_of_simulation(p_cb_data cb_data)
return 0;
}
void sys_display_register()
void sys_display_register(void)
{
s_cb_data cb_data;
s_vpi_systf_data tf_data;

View File

@ -1056,7 +1056,7 @@ static PLI_INT32 sys_ferror_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
return 0;
}
void sys_fileio_register()
void sys_fileio_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -46,7 +46,7 @@ static PLI_INT32 sys_finish_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
return 0;
}
void sys_finish_register()
void sys_finish_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -381,7 +381,7 @@ static PLI_INT32 sys_value_plusargs_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
return 0;
}
void sys_plusargs_register()
void sys_plusargs_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -1393,7 +1393,7 @@ static PLI_INT32 sys_q_exam_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
/*
* Routine to register the system tasks/functions provided in this file.
*/
void sys_queue_register()
void sys_queue_register(void)
{
s_vpi_systf_data tf_data;
s_cb_data cb;

View File

@ -909,7 +909,7 @@ static PLI_INT32 sys_rand_func_sizetf(PLI_BYTE8 *x)
return 32;
}
void sys_random_register()
void sys_random_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -142,7 +142,7 @@ static PLI_INT32 sys_mti_random_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
return 0;
}
void sys_random_mti_register()
void sys_random_mti_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -569,7 +569,7 @@ static PLI_INT32 sys_writemem_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
return 0;
}
void sys_readmem_register()
void sys_readmem_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -30,8 +30,8 @@ extern char *readmem_error_token;
extern void sys_readmem_start_file(FILE*in, int bin_flag,
unsigned width, struct t_vpi_vecval*val);
extern int readmemlex();
extern int readmemlex(void);
extern void destroy_readmem_lexor();
extern void destroy_readmem_lexor(void);
#endif

View File

@ -24,9 +24,9 @@
# include "sys_readmem_lex.h"
# include <string.h>
static void make_addr();
static void make_hex_value();
static void make_bin_value();
static void make_addr(void);
static void make_hex_value(void);
static void make_bin_value(void);
static int save_state;
@ -60,12 +60,12 @@ char *readmem_error_token = 0;
static unsigned word_width = 0;
static struct t_vpi_vecval*vecval = 0;
static void make_addr()
static void make_addr(void)
{
sscanf(yytext+1, "%x", (unsigned int*)&vecval->aval);
}
static void make_hex_value()
static void make_hex_value(void)
{
char*beg = yytext;
char*end = beg + strlen(beg);
@ -136,7 +136,7 @@ static void make_hex_value()
}
}
static void make_bin_value()
static void make_bin_value(void)
{
char*beg = yytext;
char*end = beg + strlen(beg);
@ -195,7 +195,7 @@ void sys_readmem_start_file(FILE*in, int bin_flag,
/*
* Modern version of flex (>=2.5.9) can clean up the scanner data.
*/
void destroy_readmem_lexor()
void destroy_readmem_lexor(void)
{
# ifdef FLEX_SCANNER
# if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5

View File

@ -1435,7 +1435,7 @@ static PLI_INT32 sys_sscanf_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
return 0;
}
void sys_scanf_register()
void sys_scanf_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -318,7 +318,7 @@ static PLI_INT32 sys_sdf_annotate_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
return 0;
}
void sys_sdf_register()
void sys_sdf_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -23,42 +23,42 @@
# include <stdlib.h>
# include <string.h>
extern void sys_convert_register();
extern void sys_countdrivers_register();
extern void sys_darray_register();
extern void sys_fileio_register();
extern void sys_finish_register();
extern void sys_deposit_register();
extern void sys_display_register();
extern void sys_plusargs_register();
extern void sys_queue_register();
extern void sys_random_register();
extern void sys_random_mti_register();
extern void sys_readmem_register();
extern void sys_scanf_register();
extern void sys_sdf_register();
extern void sys_time_register();
extern void sys_vcd_register();
extern void sys_vcdoff_register();
extern void sys_special_register();
extern void table_model_register();
extern void vams_simparam_register();
extern void sys_convert_register(void);
extern void sys_countdrivers_register(void);
extern void sys_darray_register(void);
extern void sys_fileio_register(void);
extern void sys_finish_register(void);
extern void sys_deposit_register(void);
extern void sys_display_register(void);
extern void sys_plusargs_register(void);
extern void sys_queue_register(void);
extern void sys_random_register(void);
extern void sys_random_mti_register(void);
extern void sys_readmem_register(void);
extern void sys_scanf_register(void);
extern void sys_sdf_register(void);
extern void sys_time_register(void);
extern void sys_vcd_register(void);
extern void sys_vcdoff_register(void);
extern void sys_special_register(void);
extern void table_model_register(void);
extern void vams_simparam_register(void);
#ifdef HAVE_LIBZ
#ifdef HAVE_LIBBZ2
extern void sys_lxt_register();
extern void sys_lxt_register(void);
#else
static void sys_lxt_register() { fputs("LXT support disabled since libbzip2 not available\n",stderr); exit(1); }
static void sys_lxt_register(void) { fputs("LXT support disabled since libbzip2 not available\n",stderr); exit(1); }
#endif
extern void sys_lxt2_register();
extern void sys_fst_register();
extern void sys_lxt2_register(void);
extern void sys_fst_register(void);
#else
static void sys_lxt_register() { fputs("LXT support disabled since zlib not available\n",stderr); exit(1); }
static void sys_lxt2_register() { fputs("LXT2 support disabled since zlib not available\n",stderr); exit(1); }
static void sys_fst_register() { fputs("FST support disabled since zlib not available\n",stderr); exit(1); }
static void sys_lxt_register(void) { fputs("LXT support disabled since zlib not available\n",stderr); exit(1); }
static void sys_lxt2_register(void) { fputs("LXT2 support disabled since zlib not available\n",stderr); exit(1); }
static void sys_fst_register(void) { fputs("FST support disabled since zlib not available\n",stderr); exit(1); }
#endif
static void sys_lxt_or_vcd_register()
static void sys_lxt_or_vcd_register(void)
{
int idx;
struct t_vpi_vlog_info vlog_info;
@ -195,7 +195,7 @@ static void sys_lxt_or_vcd_register()
}
}
void (*vlog_startup_routines[])() = {
void (*vlog_startup_routines[])(void) = {
sys_convert_register,
sys_countdrivers_register,
sys_darray_register,

View File

@ -107,7 +107,7 @@ static PLI_INT32 sys_realtime_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
return 0;
}
void sys_time_register()
void sys_time_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -159,7 +159,7 @@ __inline__ static int dump_header_pending(void)
* This function writes out all the traced variables, whether they
* changed or not.
*/
static void vcd_checkpoint()
static void vcd_checkpoint(void)
{
struct vcd_info*cur;
@ -167,7 +167,7 @@ static void vcd_checkpoint()
show_this_item(cur);
}
static void vcd_checkpoint_x()
static void vcd_checkpoint_x(void)
{
struct vcd_info*cur;
@ -855,7 +855,7 @@ static PLI_INT32 sys_dumpvars_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
return 0;
}
void sys_vcd_register()
void sys_vcd_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -48,7 +48,7 @@ static PLI_INT32 sys_dumpvars_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
return 0;
}
void sys_vcdoff_register()
void sys_vcdoff_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;

View File

@ -64,7 +64,7 @@ static PLI_INT32 cleanup_table_mod(p_cb_data cause)
* Create an empty table model object and add it to the list of table
* model objects.
*/
static p_table_mod create_table()
static p_table_mod create_table(void)
{
/* Create an empty table model object. */
p_table_mod obj = (p_table_mod) malloc(sizeof(s_table_mod));
@ -110,7 +110,7 @@ unsigned is_const_string_obj(vpiHandle arg)
/*
* Get any command line flags. For now we only have a debug flag.
*/
static void check_command_line_flags()
static void check_command_line_flags(void)
{
struct t_vpi_vlog_info vlog_info;
static unsigned command_line_processed = 0;
@ -684,7 +684,7 @@ static PLI_INT32 sys_table_model_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
/*
* Routine to register the system function provided in this file.
*/
void table_model_register()
void table_model_register(void)
{
s_vpi_systf_data tf_data;
s_cb_data cb;

View File

@ -94,8 +94,8 @@ typedef struct t_table_mod {
extern unsigned parse_table_model(FILE *fp, vpiHandle callh, p_table_mod table);
extern int tblmodlex();
extern void destroy_tblmod_lexor();
extern int tblmodlex(void);
extern void destroy_tblmod_lexor(void);
extern void init_tblmod_lexor(FILE *fp);
#endif

View File

@ -150,7 +150,7 @@ void init_tblmod_lexor(FILE *fp)
/*
* Modern version of flex (>=2.5.9) can clean up the scanner data.
*/
void destroy_tblmod_lexor()
void destroy_tblmod_lexor(void)
{
# ifdef FLEX_SCANNER
# if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5

View File

@ -90,7 +90,7 @@ static p_table_mod table_def;
extern int tblmodlex(void);
static void yyerror(const char *fmt, ...);
static void process_point()
static void process_point(void)
{
assert(cur_value == indep_values);
#if 0

View File

@ -371,7 +371,7 @@ static void sys_v2005_math_register(void)
/*
* Hook to get Icarus Verilog to find the registration function.
*/
extern void sys_clog2_register();
extern void sys_clog2_register(void);
void (*vlog_startup_routines[])(void) = {
sys_v2005_math_register,

View File

@ -21,7 +21,7 @@ extern void v2009_array_register(void);
extern void v2009_enum_register(void);
extern void v2009_string_register(void);
void (*vlog_startup_routines[])() = {
void (*vlog_startup_routines[])(void) = {
v2009_array_register,
v2009_enum_register,
v2009_string_register,

View File

@ -45,7 +45,7 @@ EXTERN const char *vcd_names_search(struct vcd_names_list_s*tab,
EXTERN void vcd_names_sort(struct vcd_names_list_s*tab);
EXTERN void vcd_names_delete();
EXTERN void vcd_names_delete(struct vcd_names_list_s*tab);
/*
* Keep a map of nexus ident's to help with alias detection.
@ -53,7 +53,7 @@ EXTERN void vcd_names_delete();
EXTERN const char*find_nexus_ident(int nex);
EXTERN void set_nexus_ident(int nex, const char *id);
EXTERN void nexus_ident_delete();
EXTERN void nexus_ident_delete(void);
/*
* Keep a set of scope names to help with duplicate detection.

View File

@ -182,7 +182,7 @@ static void vhdl_register(void)
vpi_register_cb(&cb);
}
void (*vlog_startup_routines[])() = {
void (*vlog_startup_routines[])(void) = {
vhdl_register,
0
};

View File

@ -93,7 +93,7 @@ static PLI_INT32 vpi_tree_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
return 0;
}
void sys_register()
void sys_register(void)
{
s_vpi_systf_data tf_data;
vpiHandle res;
@ -108,7 +108,7 @@ void sys_register()
vpip_make_systf_system_defined(res);
}
void (*vlog_startup_routines[])() = {
void (*vlog_startup_routines[])(void) = {
sys_register,
0
};

View File

@ -25,7 +25,7 @@
* map of a 4-vbit value to a hex digit. The table handles the display
* of x, X, z, Z, etc.
*/
static void draw_hex_table()
static void draw_hex_table(void)
{
unsigned idx;
@ -71,7 +71,7 @@ static void draw_hex_table()
printf("};\n");
}
static void draw_oct_table()
static void draw_oct_table(void)
{
unsigned idx;
@ -117,7 +117,7 @@ static void draw_oct_table()
printf("};\n");
}
int main()
int main(void)
{
draw_hex_table();
draw_oct_table();

View File

@ -21,6 +21,6 @@
* Things that should be statically linked by VPI modules go here.
*/
void __libvpi_c_dummy_function()
void __libvpi_c_dummy_function(void)
{
}