diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2022-12-25 20:41:46 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-12-27 00:00:50 +0100 |
commit | 84e0fb3f287864eca3a9322ef364b913f6a260bd (patch) | |
tree | 123333bce32a7d57c5112aa0d4c07b12821b6305 /ddb | |
parent | 63eefc08b5e762937118254ad0b82583cc38a2d2 (diff) | |
download | gnumach-84e0fb3f287864eca3a9322ef364b913f6a260bd.tar.gz gnumach-84e0fb3f287864eca3a9322ef364b913f6a260bd.tar.bz2 gnumach-84e0fb3f287864eca3a9322ef364b913f6a260bd.zip |
Fix some warnings with -Wmissing-prototypes.
Marked some functions as static (private) as needed and added missing
includes.
This also revealed some dead code which was removed.
Note that -Wmissing-prototypes is not enabled here since there is a
bunch more warnings.
Message-Id: <Y6j72lWRL9rsYy4j@mars>
Diffstat (limited to 'ddb')
-rw-r--r-- | ddb/db_break.c | 8 | ||||
-rw-r--r-- | ddb/db_command.c | 8 | ||||
-rw-r--r-- | ddb/db_expr.c | 16 | ||||
-rw-r--r-- | ddb/db_input.c | 10 | ||||
-rw-r--r-- | ddb/db_output.c | 2 | ||||
-rw-r--r-- | ddb/db_print.c | 8 | ||||
-rw-r--r-- | ddb/db_sym.c | 6 | ||||
-rw-r--r-- | ddb/db_task_thread.c | 2 | ||||
-rw-r--r-- | ddb/db_variables.c | 4 | ||||
-rw-r--r-- | ddb/db_watch.c | 4 | ||||
-rw-r--r-- | ddb/db_write_cmd.c | 1 |
11 files changed, 35 insertions, 34 deletions
diff --git a/ddb/db_break.c b/ddb/db_break.c index c3a9e181..c0962161 100644 --- a/ddb/db_break.c +++ b/ddb/db_break.c @@ -61,7 +61,7 @@ static db_thread_breakpoint_t db_free_thread_break_list = 0; static boolean_t db_thread_break_init = FALSE; static int db_breakpoint_number = 0; -db_breakpoint_t +static db_breakpoint_t db_breakpoint_alloc() { db_breakpoint_t bkpt; @@ -80,7 +80,7 @@ db_breakpoint_alloc() return (bkpt); } -void +static void db_breakpoint_free(bkpt) db_breakpoint_t bkpt; { @@ -319,7 +319,7 @@ db_set_breakpoint(task, addr, count, thread, task_bpt) } } -void +static void db_delete_breakpoint(task, addr, task_thd) const task_t task; db_addr_t addr; @@ -523,7 +523,7 @@ db_delete_temp_breakpoint( /* * List breakpoints. */ -void +static void db_list_breakpoints(void) { db_breakpoint_t bkpt; diff --git a/ddb/db_command.c b/ddb/db_command.c index 1d4052cd..57200fe3 100644 --- a/ddb/db_command.c +++ b/ddb/db_command.c @@ -96,7 +96,7 @@ boolean_t db_ed_style = TRUE; /* * Search for command prefix. */ -int +static int db_cmd_search(name, table, cmdp) const char * name; const struct db_command *table; @@ -143,7 +143,7 @@ db_cmd_search(name, table, cmdp) return (result); } -void +static void db_cmd_list(table) const struct db_command *table; { @@ -155,7 +155,7 @@ db_cmd_list(table) } } -void +static void db_command( struct db_command **last_cmdp, /* IN_OUT */ struct db_command *cmd_table) @@ -295,7 +295,7 @@ db_command( } } -void +static void db_command_list( struct db_command **last_cmdp, /* IN_OUT */ struct db_command *cmd_table) diff --git a/ddb/db_expr.c b/ddb/db_expr.c index c9e6752a..9e20a840 100644 --- a/ddb/db_expr.c +++ b/ddb/db_expr.c @@ -41,7 +41,7 @@ #include <ddb/db_variables.h> #include <kern/task.h> -boolean_t +static boolean_t db_term(db_expr_t *valuep) { int t; @@ -124,7 +124,7 @@ db_size_option(modif, u_option, t_option) return(size); } -boolean_t +static boolean_t db_unary(db_expr_t *valuep) { int t; @@ -173,7 +173,7 @@ db_unary(db_expr_t *valuep) return (db_term(valuep)); } -boolean_t +static boolean_t db_mult_expr(db_expr_t *valuep) { db_expr_t lhs = 0, rhs; @@ -218,7 +218,7 @@ db_mult_expr(db_expr_t *valuep) return (TRUE); } -boolean_t +static boolean_t db_add_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; @@ -249,7 +249,7 @@ db_add_expr(db_expr_t *valuep) return (TRUE); } -boolean_t +static boolean_t db_shift_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; @@ -283,7 +283,7 @@ db_shift_expr(db_expr_t *valuep) return (TRUE); } -boolean_t +static boolean_t db_logical_relation_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; @@ -332,7 +332,7 @@ db_logical_relation_expr(db_expr_t *valuep) return (TRUE); } -boolean_t +static boolean_t db_logical_and_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; @@ -354,7 +354,7 @@ db_logical_and_expr(db_expr_t *valuep) return (TRUE); } -boolean_t +static boolean_t db_logical_or_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; diff --git a/ddb/db_input.c b/ddb/db_input.c index b70299d3..a564025e 100644 --- a/ddb/db_input.c +++ b/ddb/db_input.c @@ -67,7 +67,7 @@ char * db_history_prev = (char *) 0; /* start of previous line */ #define BLANK ' ' #define BACKUP '\b' -void +static void db_putstring(s, count) const char *s; int count; @@ -76,7 +76,7 @@ db_putstring(s, count) cnputc(*s++); } -void +static void db_putnchars(c, count) int c; int count; @@ -90,7 +90,7 @@ db_putnchars(c, count) */ #define DEL_FWD 0 #define DEL_BWD 1 -void +static void db_delete( int n, int bwd) @@ -110,7 +110,7 @@ db_delete( db_le -= n; } -void +static void db_delete_line(void) { db_delete(db_le - db_lc, DEL_FWD); @@ -136,7 +136,7 @@ db_delete_line(void) #endif /* DB_HISTORY_SIZE */ /* returns TRUE at end-of-line */ -boolean_t +static boolean_t db_inputchar(int c) { static int escaped, csi; diff --git a/ddb/db_output.c b/ddb/db_output.c index ded9fa96..9a76f545 100644 --- a/ddb/db_output.c +++ b/ddb/db_output.c @@ -178,7 +178,7 @@ db_putchar(int c) /* character to output */ /* other characters are assumed non-printing */ } -void +static void db_id_putc(char c, vm_offset_t dummy) { db_putchar(c); diff --git a/ddb/db_print.c b/ddb/db_print.c index 8a76beea..6c2ea238 100644 --- a/ddb/db_print.c +++ b/ddb/db_print.c @@ -127,7 +127,7 @@ db_show_regs( #define db_thread_fp_used(thread) FALSE #endif -char * +static char * db_thread_stat(thread, status) const thread_t thread; char *status; @@ -145,7 +145,7 @@ db_thread_stat(thread, status) return(status); } -void +static void db_print_thread( thread_t thread, int thread_id, @@ -244,7 +244,7 @@ db_print_thread( } } -void +static void db_print_task( task_t task, int task_id, @@ -466,7 +466,7 @@ db_show_one_task(addr, have_addr, count, modif) db_print_task(task, task_id, flag); } -int +static int db_port_iterate(thread, func) const thread_t thread; void (*func)(); diff --git a/ddb/db_sym.c b/ddb/db_sym.c index 2abd5746..a6a64eae 100644 --- a/ddb/db_sym.c +++ b/ddb/db_sym.c @@ -264,7 +264,7 @@ out: */ boolean_t db_qualify_ambiguous_names = FALSE; -boolean_t +static boolean_t db_name_is_ambiguous(char *sym_name) { int i; @@ -507,8 +507,8 @@ void db_free_symbol(db_sym_t s) * Switch into symbol-table specific routines */ -void dummy_db_free_symbol(db_sym_t symbol) { } -boolean_t dummy_db_sym_init(char *a, char *b, char *c, char *d) { +static void dummy_db_free_symbol(db_sym_t symbol) { } +static boolean_t dummy_db_sym_init(char *a, char *b, char *c, char *d) { return FALSE; } diff --git a/ddb/db_task_thread.c b/ddb/db_task_thread.c index f7fbb805..93e44c25 100644 --- a/ddb/db_task_thread.c +++ b/ddb/db_task_thread.c @@ -152,7 +152,7 @@ db_check_thread_address_valid(thread) /* * convert task_id(queue position) to task address */ -task_t +static task_t db_lookup_task_id(int task_id) { task_t task; diff --git a/ddb/db_variables.c b/ddb/db_variables.c index 0fd9bad0..5403cc9a 100644 --- a/ddb/db_variables.c +++ b/ddb/db_variables.c @@ -70,7 +70,7 @@ struct db_variable db_vars[] = { }; struct db_variable *db_evars = db_vars + sizeof(db_vars)/sizeof(db_vars[0]); -const char * +static const char * db_get_suffix(suffix, suffix_value) const char *suffix; short *suffix_value; @@ -116,7 +116,7 @@ db_cmp_variable_name(vp, name, ap) return(TRUE); } -int +static int db_find_variable( struct db_variable **varp, db_var_aux_param_t ap) diff --git a/ddb/db_watch.c b/ddb/db_watch.c index f0d0443f..5a845eca 100644 --- a/ddb/db_watch.c +++ b/ddb/db_watch.c @@ -64,7 +64,7 @@ db_watchpoint_t db_watchpoint_list = 0; extern vm_map_t kernel_map; -db_watchpoint_t +static db_watchpoint_t db_watchpoint_alloc(void) { db_watchpoint_t watch; @@ -83,7 +83,7 @@ db_watchpoint_alloc(void) return (watch); } -void +static void db_watchpoint_free(watch) db_watchpoint_t watch; { diff --git a/ddb/db_write_cmd.c b/ddb/db_write_cmd.c index 46a2ee32..1a1e5fc9 100644 --- a/ddb/db_write_cmd.c +++ b/ddb/db_write_cmd.c @@ -43,6 +43,7 @@ #include <ddb/db_output.h> #include <ddb/db_sym.h> #include <ddb/db_task_thread.h> +#include <ddb/db_write_cmd.h> |