Resolve -Wstrict-prototypes warnings with clang-15

warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
This commit is contained in:
Olly Betts 2022-06-30 12:36:45 +12:00
commit 6c4010e442
15 changed files with 34 additions and 34 deletions

View file

@ -43,7 +43,7 @@ extern "C" {
extern void scanner_clear_rename(void); extern void scanner_clear_rename(void);
extern void scanner_set_location(String *file, int line); extern void scanner_set_location(String *file, int line);
extern void scanner_set_main_input_file(String *file); 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 Swig_cparse_follow_locators(int);
extern void start_inline(char *, int); extern void start_inline(char *, int);
extern String *scanner_ccode; extern String *scanner_ccode;

View file

@ -123,7 +123,7 @@ void Swig_cparse_cplusplusout(int v) {
* Initialize buffers * Initialize buffers
* ------------------------------------------------------------------------- */ * ------------------------------------------------------------------------- */
void scanner_init() { void scanner_init(void) {
scan = NewScanner(); scan = NewScanner();
Scanner_idstart(scan,"%"); Scanner_idstart(scan,"%");
scan_init = 1; scan_init = 1;
@ -528,11 +528,11 @@ void scanner_set_location(String *file, int line) {
Scanner_set_location(scan,file,line-1); Scanner_set_location(scan,file,line-1);
} }
void scanner_check_typedef() { void scanner_check_typedef(void) {
check_typedef = 1; check_typedef = 1;
} }
void scanner_ignore_typedef() { void scanner_ignore_typedef(void) {
check_typedef = 0; check_typedef = 0;
} }
@ -540,7 +540,7 @@ void scanner_last_id(int x) {
last_id = x; last_id = x;
} }
void scanner_clear_rename() { void scanner_clear_rename(void) {
rename_active = 0; rename_active = 0;
} }
@ -554,7 +554,7 @@ void scanner_set_main_input_file(String *file) {
main_input_file = file; main_input_file = file;
} }
String *scanner_get_main_input_file() { String *scanner_get_main_input_file(void) {
return main_input_file; return main_input_file;
} }

View file

@ -50,7 +50,7 @@
* Externals * Externals
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
int yyparse(); int yyparse(void);
/* NEW Variables */ /* NEW Variables */
@ -349,7 +349,7 @@ static String *make_name(Node *n, String *name,SwigType *decl) {
} }
/* Generate an unnamed identifier */ /* Generate an unnamed identifier */
static String *make_unnamed() { static String *make_unnamed(void) {
unnamed++; unnamed++;
return NewStringf("$unnamed%d$",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 */ /* 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(); Symtab *symtab = Swig_symbol_global_scope();
Swig_symbol_setscope(symtab); Swig_symbol_setscope(symtab);
return symtab; return symtab;

View file

@ -19,7 +19,7 @@ static int template_debug = 0;
const char *baselists[3]; const char *baselists[3];
void SwigType_template_init() { void SwigType_template_init(void) {
baselists[0] = "baselist"; baselists[0] = "baselist";
baselists[1] = "protectedbaselist"; baselists[1] = "protectedbaselist";
baselists[2] = "privatebaselist"; baselists[2] = "privatebaselist";

View file

@ -35,7 +35,7 @@ typedef struct {
* reference count of the underlying DOH objects. * reference count of the underlying DOH objects.
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
static DOHList *open_files_list_instance() { static DOHList *open_files_list_instance(void) {
static DOHList *all_open_files = 0; static DOHList *all_open_files = 0;
if (!all_open_files) if (!all_open_files)
all_open_files = DohNewList(); all_open_files = DohNewList();
@ -73,7 +73,7 @@ static void open_files_list_remove(DohFile *f) {
* Close all opened files, to be called on program termination * Close all opened files, to be called on program termination
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
void DohCloseAllOpenFiles() { void DohCloseAllOpenFiles(void) {
int i; int i;
DOHList *all_open_files = open_files_list_instance(); DOHList *all_open_files = open_files_list_instance();
for (i = 0; i < DohLen(all_open_files); i++) { for (i = 0; i < DohLen(all_open_files); i++) {

View file

@ -48,7 +48,7 @@ static int pools_initialized = 0;
* CreatePool() - Create a new memory pool * CreatePool() - Create a new memory pool
* ---------------------------------------------------------------------- */ * ---------------------------------------------------------------------- */
static void CreatePool() { static void CreatePool(void) {
Pool *p = 0; Pool *p = 0;
p = (Pool *) DohMalloc(sizeof(Pool)); p = (Pool *) DohMalloc(sizeof(Pool));
p->ptr = (DohBase *) DohCalloc(PoolSize, sizeof(DohBase)); p->ptr = (DohBase *) DohCalloc(PoolSize, sizeof(DohBase));
@ -65,7 +65,7 @@ static void CreatePool() {
* InitPools() - Initialize the memory allocator * InitPools() - Initialize the memory allocator
* ---------------------------------------------------------------------- */ * ---------------------------------------------------------------------- */
static void InitPools() { static void InitPools(void) {
if (pools_initialized) if (pools_initialized)
return; return;
CreatePool(); /* Create initial pool */ CreatePool(); /* Create initial pool */

View file

@ -1356,14 +1356,14 @@ static void add_chunk(DOH *ns, DOH *chunk, int allow) {
push/pop_imported(): helper functions for defining and undefining push/pop_imported(): helper functions for defining and undefining
SWIGIMPORTED (when %importing a file). SWIGIMPORTED (when %importing a file).
*/ */
static void push_imported() { static void push_imported(void) {
if (imported_depth == 0) { if (imported_depth == 0) {
Preprocessor_define("SWIGIMPORTED 1", 0); Preprocessor_define("SWIGIMPORTED 1", 0);
} }
++imported_depth; ++imported_depth;
} }
static void pop_imported() { static void pop_imported(void) {
--imported_depth; --imported_depth;
if (imported_depth == 0) { if (imported_depth == 0) {
Preprocessor_undef("SWIGIMPORTED"); Preprocessor_undef("SWIGIMPORTED");

View file

@ -52,7 +52,7 @@ static int expr_init = 0; /* Initialization flag */
static const char *errmsg = 0; /* Parsing error */ static const char *errmsg = 0; /* Parsing error */
/* Initialize the precedence table for various operators. Low values have higher precedence */ /* Initialize the precedence table for various operators. Low values have higher precedence */
static void init_precedence() { static void init_precedence(void) {
prec[SWIG_TOKEN_NOT] = 10; prec[SWIG_TOKEN_NOT] = 10;
prec[OP_UMINUS] = 10; prec[OP_UMINUS] = 10;
prec[OP_UPLUS] = 10; prec[OP_UPLUS] = 10;
@ -85,7 +85,7 @@ static void init_precedence() {
/* Reduce a single operator on the stack */ /* Reduce a single operator on the stack */
/* return 0 on failure, 1 on success */ /* return 0 on failure, 1 on success */
static int reduce_op() { static int reduce_op(void) {
long op_token = stack[sp - 1].value; long op_token = stack[sp - 1].value;
assert(sp > 0); assert(sp > 0);
assert(stack[sp - 1].op == EXPR_OP); assert(stack[sp - 1].op == EXPR_OP);
@ -474,6 +474,6 @@ extra_rparen:
* Return error message set by the evaluator (if any) * Return error message set by the evaluator (if any)
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
const char *Preprocessor_expr_error() { const char *Preprocessor_expr_error(void) {
return errmsg; return errmsg;
} }

View file

@ -145,7 +145,7 @@ static List *Swig_search_path_any(int syspath) {
return slist; return slist;
} }
List *Swig_search_path() { List *Swig_search_path(void) {
return Swig_search_path_any(0); return Swig_search_path_any(0);
} }
@ -376,6 +376,6 @@ String *Swig_file_dirname(const_String_or_char_ptr filename) {
/* /*
* Swig_file_debug() * Swig_file_debug()
*/ */
void Swig_file_debug_set() { void Swig_file_debug_set(void) {
file_debug = 1; file_debug = 1;
} }

View file

@ -1497,7 +1497,7 @@ int Swig_is_generated_overload(Node *n) {
* Initialize the SWIG core * Initialize the SWIG core
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
void Swig_init() { void Swig_init(void) {
/* Set some useful string encoding methods */ /* Set some useful string encoding methods */
DohEncoding("escape", Swig_string_escape); DohEncoding("escape", Swig_string_escape);
DohEncoding("hexescape", Swig_string_hexescape); DohEncoding("hexescape", Swig_string_hexescape);

View file

@ -744,28 +744,28 @@ void Swig_feature_set(Hash *features, const_String_or_char_ptr name, SwigType *d
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
static Hash *namewarn_hash = 0; static Hash *namewarn_hash = 0;
static Hash *name_namewarn_hash() { static Hash *name_namewarn_hash(void) {
if (!namewarn_hash) if (!namewarn_hash)
namewarn_hash = NewHash(); namewarn_hash = NewHash();
return namewarn_hash; return namewarn_hash;
} }
static Hash *rename_hash = 0; static Hash *rename_hash = 0;
static Hash *name_rename_hash() { static Hash *name_rename_hash(void) {
if (!rename_hash) if (!rename_hash)
rename_hash = NewHash(); rename_hash = NewHash();
return rename_hash; return rename_hash;
} }
static List *namewarn_list = 0; static List *namewarn_list = 0;
static List *name_namewarn_list() { static List *name_namewarn_list(void) {
if (!namewarn_list) if (!namewarn_list)
namewarn_list = NewList(); namewarn_list = NewList();
return namewarn_list; return namewarn_list;
} }
static List *rename_list = 0; static List *rename_list = 0;
static List *name_rename_list() { static List *name_rename_list(void) {
if (!rename_list) if (!rename_list)
rename_list = NewList(); rename_list = NewList();
return rename_list; return rename_list;

View file

@ -149,7 +149,7 @@ int ParmList_len(ParmList *p) {
* get_empty_type() * get_empty_type()
* ---------------------------------------------------------------------- */ * ---------------------------------------------------------------------- */
static SwigType *get_empty_type() { static SwigType *get_empty_type(void) {
return NewStringEmpty(); return NewStringEmpty();
} }

View file

@ -30,7 +30,7 @@ extern String *Swig_file_extension(const_String_or_char_ptr filename);
extern String *Swig_file_basename(const_String_or_char_ptr filename); extern String *Swig_file_basename(const_String_or_char_ptr filename);
extern String *Swig_file_filename(const_String_or_char_ptr filename); extern String *Swig_file_filename(const_String_or_char_ptr filename);
extern String *Swig_file_dirname(const_String_or_char_ptr filename); extern String *Swig_file_dirname(const_String_or_char_ptr filename);
extern void Swig_file_debug_set(); extern void Swig_file_debug_set(void);
/* Delimiter used in accessing files and directories */ /* Delimiter used in accessing files and directories */

View file

@ -151,7 +151,7 @@ static void set_typemap(const SwigType *type, Hash **tmhash) {
* Initialize the typemap system * Initialize the typemap system
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
void Swig_typemap_init() { void Swig_typemap_init(void) {
typemaps = NewHash(); typemaps = NewHash();
} }
@ -2170,7 +2170,7 @@ static void replace_embedded_typemap(String *s, ParmList *parm_sublist, Wrapper
* Display all typemaps * Display all typemaps
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
void Swig_typemap_debug() { void Swig_typemap_debug(void) {
int nesting_level = 2; int nesting_level = 2;
Printf(stdout, "---[ typemaps ]--------------------------------------------------------------\n"); Printf(stdout, "---[ typemaps ]--------------------------------------------------------------\n");
Swig_print(typemaps, nesting_level); Swig_print(typemaps, nesting_level);

View file

@ -180,7 +180,7 @@ int Swig_value_wrapper_mode(int mode) {
} }
static void flush_cache() { static void flush_cache(void) {
typedef_resolve_cache = 0; typedef_resolve_cache = 0;
typedef_all_cache = 0; typedef_all_cache = 0;
typedef_qualified_cache = 0; typedef_qualified_cache = 0;
@ -188,7 +188,7 @@ static void flush_cache() {
/* Initialize the scoping system */ /* Initialize the scoping system */
void SwigType_typesystem_init() { void SwigType_typesystem_init(void) {
if (global_scope) if (global_scope)
Delete(global_scope); Delete(global_scope);
if (scopes) if (scopes)
@ -407,7 +407,7 @@ void SwigType_using_scope(Typetab *scope) {
* table for the scope that was popped off. * table for the scope that was popped off.
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
Typetab *SwigType_pop_scope() { Typetab *SwigType_pop_scope(void) {
Typetab *t, *old = current_scope; Typetab *t, *old = current_scope;
t = Getattr(current_scope, "parent"); t = Getattr(current_scope, "parent");
if (!t) if (!t)
@ -2093,7 +2093,7 @@ static int SwigType_compare_mangled(const DOH *a, const DOH *b) {
* Returns the sorted list of mangled type names that should be exported into the * Returns the sorted list of mangled type names that should be exported into the
* wrapper file. * wrapper file.
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
List *SwigType_get_sorted_mangled_list() { List *SwigType_get_sorted_mangled_list(void) {
List *l = Keys(r_mangled); List *l = Keys(r_mangled);
SortList(l, SwigType_compare_mangled); SortList(l, SwigType_compare_mangled);
return l; return l;