From 6c4010e4421fbb1be76e89f4edba2d7db532c1cb Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 30 Jun 2022 12:36:45 +1200 Subject: Resolve -Wstrict-prototypes warnings with clang-15 warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] --- Source/CParse/cparse.h | 2 +- Source/CParse/cscanner.c | 10 +++++----- Source/CParse/parser.y | 6 +++--- Source/CParse/templ.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/CParse') diff --git a/Source/CParse/cparse.h b/Source/CParse/cparse.h index c67ffeaba..0d9ca4b9d 100644 --- a/Source/CParse/cparse.h +++ b/Source/CParse/cparse.h @@ -43,7 +43,7 @@ extern "C" { extern void scanner_clear_rename(void); extern void scanner_set_location(String *file, int line); extern void scanner_set_main_input_file(String *file); - extern String *scanner_get_main_input_file(); + extern String *scanner_get_main_input_file(void); extern void Swig_cparse_follow_locators(int); extern void start_inline(char *, int); extern String *scanner_ccode; diff --git a/Source/CParse/cscanner.c b/Source/CParse/cscanner.c index a658f5a6f..155c7c81b 100644 --- a/Source/CParse/cscanner.c +++ b/Source/CParse/cscanner.c @@ -123,7 +123,7 @@ void Swig_cparse_cplusplusout(int v) { * Initialize buffers * ------------------------------------------------------------------------- */ -void scanner_init() { +void scanner_init(void) { scan = NewScanner(); Scanner_idstart(scan,"%"); scan_init = 1; @@ -528,11 +528,11 @@ void scanner_set_location(String *file, int line) { Scanner_set_location(scan,file,line-1); } -void scanner_check_typedef() { +void scanner_check_typedef(void) { check_typedef = 1; } -void scanner_ignore_typedef() { +void scanner_ignore_typedef(void) { check_typedef = 0; } @@ -540,7 +540,7 @@ void scanner_last_id(int x) { last_id = x; } -void scanner_clear_rename() { +void scanner_clear_rename(void) { rename_active = 0; } @@ -554,7 +554,7 @@ void scanner_set_main_input_file(String *file) { main_input_file = file; } -String *scanner_get_main_input_file() { +String *scanner_get_main_input_file(void) { return main_input_file; } diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 1ae3a59db..ddb9634b2 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -50,7 +50,7 @@ * Externals * ----------------------------------------------------------------------------- */ -int yyparse(); +int yyparse(void); /* NEW Variables */ @@ -349,7 +349,7 @@ static String *make_name(Node *n, String *name,SwigType *decl) { } /* Generate an unnamed identifier */ -static String *make_unnamed() { +static String *make_unnamed(void) { unnamed++; return NewStringf("$unnamed%d$",unnamed); } @@ -874,7 +874,7 @@ static void add_typedef_name(Node *n, Node *declnode, String *oldName, Symtab *c /* If the class name is qualified. We need to create or lookup namespace entries */ -static Symtab *set_scope_to_global() { +static Symtab *set_scope_to_global(void) { Symtab *symtab = Swig_symbol_global_scope(); Swig_symbol_setscope(symtab); return symtab; diff --git a/Source/CParse/templ.c b/Source/CParse/templ.c index f8c926d37..44a606299 100644 --- a/Source/CParse/templ.c +++ b/Source/CParse/templ.c @@ -19,7 +19,7 @@ static int template_debug = 0; const char *baselists[3]; -void SwigType_template_init() { +void SwigType_template_init(void) { baselists[0] = "baselist"; baselists[1] = "protectedbaselist"; baselists[2] = "privatebaselist"; -- cgit v1.2.1