diff options
author | Tom Tromey <tromey@redhat.com> | 2014-01-13 12:16:41 -0700 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-02-19 07:48:43 -0700 |
commit | 555bbdeb943f17e908e8066aba836705637c0cfb (patch) | |
tree | 2604b94c745a87e21243f46971c72d6ea9b4ae83 /gdb | |
parent | be4ddd36d63cfdddc26d912a91d9da4bbfc00f75 (diff) | |
download | gdb-555bbdeb943f17e908e8066aba836705637c0cfb.zip gdb-555bbdeb943f17e908e8066aba836705637c0cfb.tar.gz gdb-555bbdeb943f17e908e8066aba836705637c0cfb.tar.bz2 |
remove function casts from target.c
This cleans up target.c to avoid function casts.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.c (complete_target_initialization): Remove casts. Use
return_zero_has_execution.
(return_zero): Add "ignore" argument.
(return_zero_has_execution): New function.
(init_dummy_target): Remove casts. Use
return_zero_has_execution.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/target.c | 33 |
2 files changed, 29 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b7286be..0dd90ca 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 2014-02-19 Tom Tromey <tromey@redhat.com> + * target.c (complete_target_initialization): Remove casts. Use + return_zero_has_execution. + (return_zero): Add "ignore" argument. + (return_zero_has_execution): New function. + (init_dummy_target): Remove casts. Use + return_zero_has_execution. + +2014-02-19 Tom Tromey <tromey@redhat.com> + * target.c (update_current_target): Update comments. Do not INHERIT to_stratum. diff --git a/gdb/target.c b/gdb/target.c index e24a2c2..bd656da 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -77,7 +77,9 @@ static void tcomplain (void) ATTRIBUTE_NORETURN; static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *); -static int return_zero (void); +static int return_zero (struct target_ops *); + +static int return_zero_has_execution (struct target_ops *, ptid_t); void target_ignore (void); @@ -376,19 +378,19 @@ complete_target_initialization (struct target_ops *t) t->to_xfer_partial = default_xfer_partial; if (t->to_has_all_memory == NULL) - t->to_has_all_memory = (int (*) (struct target_ops *)) return_zero; + t->to_has_all_memory = return_zero; if (t->to_has_memory == NULL) - t->to_has_memory = (int (*) (struct target_ops *)) return_zero; + t->to_has_memory = return_zero; if (t->to_has_stack == NULL) - t->to_has_stack = (int (*) (struct target_ops *)) return_zero; + t->to_has_stack = return_zero; if (t->to_has_registers == NULL) - t->to_has_registers = (int (*) (struct target_ops *)) return_zero; + t->to_has_registers = return_zero; if (t->to_has_execution == NULL) - t->to_has_execution = (int (*) (struct target_ops *, ptid_t)) return_zero; + t->to_has_execution = return_zero_has_execution; install_delegators (t); } @@ -3246,7 +3248,13 @@ default_thread_architecture (struct target_ops *ops, ptid_t ptid) } static int -return_zero (void) +return_zero (struct target_ops *ignore) +{ + return 0; +} + +static int +return_zero_has_execution (struct target_ops *ignore, ptid_t ignore2) { return 0; } @@ -3361,12 +3369,11 @@ init_dummy_target (void) dummy_target.to_supports_disable_randomization = find_default_supports_disable_randomization; dummy_target.to_stratum = dummy_stratum; - dummy_target.to_has_all_memory = (int (*) (struct target_ops *)) return_zero; - dummy_target.to_has_memory = (int (*) (struct target_ops *)) return_zero; - dummy_target.to_has_stack = (int (*) (struct target_ops *)) return_zero; - dummy_target.to_has_registers = (int (*) (struct target_ops *)) return_zero; - dummy_target.to_has_execution - = (int (*) (struct target_ops *, ptid_t)) return_zero; + dummy_target.to_has_all_memory = return_zero; + dummy_target.to_has_memory = return_zero; + dummy_target.to_has_stack = return_zero; + dummy_target.to_has_registers = return_zero; + dummy_target.to_has_execution = return_zero_has_execution; dummy_target.to_magic = OPS_MAGIC; install_dummy_methods (&dummy_target); |