Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint lint: remove redundant 'extern' from function ...



details:   https://anonhg.NetBSD.org/src/rev/a919f572d83a
branches:  trunk
changeset: 376612:a919f572d83a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jun 24 07:15:08 2023 +0000

description:
lint: remove redundant 'extern' from function declarations

No binary change.

diffstat:

 usr.bin/xlint/common/externs.h |   34 +-
 usr.bin/xlint/lint1/externs1.h |  402 ++++++++++++++++++++--------------------
 2 files changed, 216 insertions(+), 220 deletions(-)

diffs (truncated from 548 to 300 lines):

diff -r a5a873c99220 -r a919f572d83a usr.bin/xlint/common/externs.h
--- a/usr.bin/xlint/common/externs.h    Sat Jun 24 07:02:24 2023 +0000
+++ b/usr.bin/xlint/common/externs.h    Sat Jun 24 07:15:08 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs.h,v 1.25 2023/01/13 19:41:50 rillig Exp $      */
+/*     $NetBSD: externs.h,v 1.26 2023/06/24 07:15:08 rillig Exp $      */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -34,33 +34,33 @@
 /*
  * inittyp.c
  */
-extern void    inittyp(void);
+void   inittyp(void);
 
 /*
  * tyname.c
  */
-extern const char *type_name(const type_t *);
-extern const   char *tspec_name(tspec_t);
+const char *type_name(const type_t *);
+const  char *tspec_name(tspec_t);
 
 /*
  * mem.c
  */
-extern void    *xmalloc(size_t);
-extern void    *xcalloc(size_t, size_t);
-extern void    *xrealloc(void *, size_t);
-extern char    *xstrdup(const char *);
-extern  char   *xasprintf(const char *, ...) __printflike(1, 2);
+void   *xmalloc(size_t);
+void   *xcalloc(size_t, size_t);
+void   *xrealloc(void *, size_t);
+char   *xstrdup(const char *);
+char   *xasprintf(const char *, ...) __printflike(1, 2);
 
 /*
  * emit.c
  */
 #if defined(IS_LINT1) || defined(IS_LINT2)
-extern void    outopen(const char *);
-extern void    outclose(void);
-extern void    outclr(void);
-extern void    outchar(char);
-extern void    outstrg(const char *);
-extern void    outint(int);
-extern void    outname(const char *);
-extern void    outsrc(const char *);
+void   outopen(const char *);
+void   outclose(void);
+void   outclr(void);
+void   outchar(char);
+void   outstrg(const char *);
+void   outint(int);
+void   outname(const char *);
+void   outsrc(const char *);
 #endif
diff -r a5a873c99220 -r a919f572d83a usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Sat Jun 24 07:02:24 2023 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Sat Jun 24 07:15:08 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.177 2023/04/23 09:04:44 rillig Exp $    */
+/*     $NetBSD: externs1.h,v 1.178 2023/06/24 07:15:08 rillig Exp $    */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -60,7 +60,7 @@ extern        bool    allow_gcc;
 
 extern sig_atomic_t fpe;
 
-extern void    norecover(void);
+void   norecover(void);
 
 /*
  * cgram.y
@@ -69,8 +69,8 @@ extern        int     block_level;
 extern size_t  mem_block_level;
 extern int     yydebug;
 
-extern int     yyerror(const char *);
-extern int     yyparse(void);
+int    yyerror(const char *);
+int    yyparse(void);
 
 /*
  * scan.l
@@ -82,36 +82,36 @@ extern      bool    in_system_header;
 extern symt_t  symtyp;
 extern FILE    *yyin;
 
-extern void    initscan(void);
-extern int64_t convert_integer(int64_t, tspec_t, unsigned int);
-extern void    clear_warn_flags(void);
-extern sym_t   *getsym(sbuf_t *);
-extern void    clean_up_after_error(void);
-extern sym_t   *pushdown(const sym_t *);
-extern sym_t   *mktempsym(type_t *);
-extern void    rmsym(sym_t *);
-extern void    rmsyms(sym_t *);
-extern void    inssym(int, sym_t *);
-extern void    freeyyv(void *, int);
-extern int     yylex(void);
+void   initscan(void);
+int64_t        convert_integer(int64_t, tspec_t, unsigned int);
+void   clear_warn_flags(void);
+sym_t  *getsym(sbuf_t *);
+void   clean_up_after_error(void);
+sym_t  *pushdown(const sym_t *);
+sym_t  *mktempsym(type_t *);
+void   rmsym(sym_t *);
+void   rmsyms(sym_t *);
+void   inssym(int, sym_t *);
+void   freeyyv(void *, int);
+int    yylex(void);
 
 /*
  * mem1.c
  */
-extern const   char *record_filename(const char *, size_t);
-extern int     get_filename_id(const char *);
-extern void    add_directory_replacement(char *);
-extern const char *transform_filename(const char *, size_t);
+const  char *record_filename(const char *, size_t);
+int    get_filename_id(const char *);
+void   add_directory_replacement(char *);
+const char *transform_filename(const char *, size_t);
 
-extern void    *block_zero_alloc(size_t);
-extern void    *level_zero_alloc(size_t, size_t);
-extern void    level_free_all(size_t);
+void   *block_zero_alloc(size_t);
+void   *level_zero_alloc(size_t, size_t);
+void   level_free_all(size_t);
 
-extern void    *expr_zero_alloc(size_t);
-extern tnode_t *expr_alloc_tnode(void);
-extern void    expr_free_all(void);
-extern memory_pool expr_save_memory(void);
-extern void    expr_restore_memory(memory_pool);
+void   *expr_zero_alloc(size_t);
+tnode_t        *expr_alloc_tnode(void);
+void   expr_free_all(void);
+memory_pool expr_save_memory(void);
+void   expr_restore_memory(memory_pool);
 
 /*
  * debug.c
@@ -159,22 +159,22 @@ extern    int     nerr;
 extern int     sytxerr;
 extern bool    any_query_enabled;
 
-extern void    msglist(void);
-extern void    error_at(int, const pos_t *, ...);
-extern void    warning_at(int, const pos_t *, ...);
-extern void    message_at(int, const pos_t *, ...);
-extern void    error(int, ...);
-extern void    warning(int, ...);
-extern bool    gnuism(int, ...);
-extern void    c99ism(int, ...);
-extern void    c11ism(int, ...);
-extern void    assert_failed(const char *, int, const char *, const char *)
+void   msglist(void);
+void   error_at(int, const pos_t *, ...);
+void   warning_at(int, const pos_t *, ...);
+void   message_at(int, const pos_t *, ...);
+void   error(int, ...);
+void   warning(int, ...);
+bool   gnuism(int, ...);
+void   c99ism(int, ...);
+void   c11ism(int, ...);
+void   assert_failed(const char *, int, const char *, const char *)
                __attribute__((__noreturn__));
-extern void    update_location(const char *, int, bool, bool);
-extern void    suppress_messages(const char *);
+void   update_location(const char *, int, bool, bool);
+void   suppress_messages(const char *);
 
-extern void    query_message(int, ...);
-extern void    enable_queries(const char *);
+void   query_message(int, ...);
+void   enable_queries(const char *);
 
 /*
  * decl.c
@@ -183,100 +183,97 @@ extern   dinfo_t *dcs;
 extern const char unnamed[];
 extern int     enumval;
 
-extern void    initdecl(void);
-extern type_t  *gettyp(tspec_t);
-extern type_t  *block_dup_type(const type_t *);
-extern type_t  *expr_dup_type(const type_t *);
-extern type_t  *expr_unqualified_type(const type_t *);
-extern bool    is_incomplete(const type_t *);
-extern void    dcs_add_storage_class(scl_t);
-extern void    dcs_add_type(type_t *);
-extern void    dcs_add_qualifier(tqual_t);
-extern void    dcs_add_packed(void);
-extern void    dcs_set_used(void);
-extern void    begin_declaration_level(declaration_kind);
-extern void    end_declaration_level(void);
-extern void    dcs_set_asm(void);
-extern void    dcs_begin_type(void);
-extern void    dcs_end_type(void);
-extern int     length_in_bits(const type_t *, const char *);
-extern unsigned int alignment_in_bits(const type_t *);
-extern sym_t   *concat_lists(sym_t *, sym_t *);
-extern void    check_type(sym_t *);
-extern sym_t   *declarator_1_struct_union(sym_t *);
-extern sym_t   *set_bit_field_width(sym_t *, int);
-extern qual_ptr *merge_qualified_pointer(qual_ptr *, qual_ptr *);
-extern sym_t   *add_pointer(sym_t *, qual_ptr *);
-extern sym_t   *add_array(sym_t *, bool, int);
-extern sym_t   *add_function(sym_t *, sym_t *);
-extern void    check_function_definition(sym_t *, bool);
-extern sym_t   *declarator_name(sym_t *);
-extern sym_t   *old_style_function_name(sym_t *);
-extern type_t  *make_tag_type(sym_t *, tspec_t, bool, bool);
-extern const   char *storage_class_name(scl_t);
-extern type_t  *complete_tag_struct_or_union(type_t *, sym_t *);
-extern type_t  *complete_tag_enum(type_t *, sym_t *);
-extern sym_t   *enumeration_constant(sym_t *, int, bool);
-extern void    declare(sym_t *, bool, sbuf_t *);
-extern void    copy_usage_info(sym_t *, sym_t *);
-extern bool    check_redeclaration(sym_t *, bool *);
-extern bool    pointer_types_are_compatible(const type_t *, const type_t *,
-                   bool);
-extern bool    types_compatible(const type_t *, const type_t *,
-                   bool, bool, bool *);
-extern void    complete_type(sym_t *, sym_t *);
-extern sym_t   *declare_argument(sym_t *, bool);
-extern void    check_func_lint_directives(void);
-extern void    check_func_old_style_arguments(void);
+void   initdecl(void);
+type_t *gettyp(tspec_t);
+type_t *block_dup_type(const type_t *);
+type_t *expr_dup_type(const type_t *);
+type_t *expr_unqualified_type(const type_t *);
+bool   is_incomplete(const type_t *);
+void   dcs_add_storage_class(scl_t);
+void   dcs_add_type(type_t *);
+void   dcs_add_qualifier(tqual_t);
+void   dcs_add_packed(void);
+void   dcs_set_used(void);
+void   begin_declaration_level(declaration_kind);
+void   end_declaration_level(void);
+void   dcs_set_asm(void);
+void   dcs_begin_type(void);
+void   dcs_end_type(void);
+int    length_in_bits(const type_t *, const char *);
+unsigned int alignment_in_bits(const type_t *);
+sym_t  *concat_lists(sym_t *, sym_t *);
+void   check_type(sym_t *);
+sym_t  *declarator_1_struct_union(sym_t *);
+sym_t  *set_bit_field_width(sym_t *, int);
+qual_ptr *merge_qualified_pointer(qual_ptr *, qual_ptr *);
+sym_t  *add_pointer(sym_t *, qual_ptr *);
+sym_t  *add_array(sym_t *, bool, int);
+sym_t  *add_function(sym_t *, sym_t *);
+void   check_function_definition(sym_t *, bool);
+sym_t  *declarator_name(sym_t *);
+sym_t  *old_style_function_name(sym_t *);
+type_t *make_tag_type(sym_t *, tspec_t, bool, bool);
+const  char *storage_class_name(scl_t);
+type_t *complete_tag_struct_or_union(type_t *, sym_t *);
+type_t *complete_tag_enum(type_t *, sym_t *);
+sym_t  *enumeration_constant(sym_t *, int, bool);
+void   declare(sym_t *, bool, sbuf_t *);
+void   copy_usage_info(sym_t *, sym_t *);
+bool   check_redeclaration(sym_t *, bool *);
+bool   pointer_types_are_compatible(const type_t *, const type_t *, bool);
+bool   types_compatible(const type_t *, const type_t *, bool, bool, bool *);
+void   complete_type(sym_t *, sym_t *);
+sym_t  *declare_argument(sym_t *, bool);
+void   check_func_lint_directives(void);
+void   check_func_old_style_arguments(void);
 
-extern void    declare_local(sym_t *, bool);
-extern sym_t   *abstract_name(void);
-extern void    global_clean_up(void);
-extern sym_t   *declare_1_abstract(sym_t *);
-extern void    check_size(sym_t *);
-extern void    mark_as_set(sym_t *);
-extern void    mark_as_used(sym_t *, bool, bool);
-extern void    check_usage(dinfo_t *);
-extern void    check_usage_sym(bool, sym_t *);
-extern void    check_global_symbols(void);
-extern void    print_previous_declaration(const sym_t *);
-extern int     to_int_constant(tnode_t *, bool);
+void   declare_local(sym_t *, bool);
+sym_t  *abstract_name(void);
+void   global_clean_up(void);
+sym_t  *declare_1_abstract(sym_t *);
+void   check_size(sym_t *);
+void   mark_as_set(sym_t *);
+void   mark_as_used(sym_t *, bool, bool);
+void   check_usage(dinfo_t *);
+void   check_usage_sym(bool, sym_t *);



Home | Main Index | Thread Index | Old Index