diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2015-11-03 13:33:11 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2015-11-03 13:33:11 -0500 |
commit | 653090d3219377766f1d4597819fa3c805ce49eb (patch) | |
tree | 2aa8ddb037e3a614ade34988cb73b6f8e418fce0 /gdb | |
parent | 2bc84e8a6d94d9d7ead1bc4febf0fb331394406e (diff) | |
download | fsf-binutils-gdb-653090d3219377766f1d4597819fa3c805ce49eb.zip fsf-binutils-gdb-653090d3219377766f1d4597819fa3c805ce49eb.tar.gz fsf-binutils-gdb-653090d3219377766f1d4597819fa3c805ce49eb.tar.bz2 |
remote-sim.c: Add casts
Mostly some casts from "generic arg" void* to the actual type.
There are two (enum gdb_signal) casts. I tried to see if it would have
been better to change the type of sigrc, but it has a double role, as an
enum and as an integer, so I left it as is.
gdb/ChangeLog:
* remote-sim.c (check_for_duplicate_sim_descriptor): Add casts.
(get_sim_inferior_data): Likewise.
(sim_inferior_data_cleanup): Likewise.
(gdbsim_close_inferior): Likewise.
(gdbsim_resume_inferior): Likewise.
(gdbsim_wait): Likewise.
(simulator_command): Likewise.
(sim_command_completer): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/remote-sim.c | 25 |
2 files changed, 25 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 532535d..06c0496 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2015-11-03 Simon Marchi <simon.marchi@polymtl.ca> + + * remote-sim.c (check_for_duplicate_sim_descriptor): Add casts. + (get_sim_inferior_data): Likewise. + (sim_inferior_data_cleanup): Likewise. + (gdbsim_close_inferior): Likewise. + (gdbsim_resume_inferior): Likewise. + (gdbsim_wait): Likewise. + (simulator_command): Likewise. + (sim_command_completer): Likewise. + 2015-11-03 Marcin KoĆcielnicki <koriakin@0x04.net> * MAINTAINERS (Write After Approval): Add Marcin KoĆcielnicki. diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 8bd1a65..5e27114 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -152,9 +152,10 @@ static int check_for_duplicate_sim_descriptor (struct inferior *inf, void *arg) { struct sim_inferior_data *sim_data; - SIM_DESC new_sim_desc = arg; + SIM_DESC new_sim_desc = (SIM_DESC) arg; - sim_data = inferior_data (inf, sim_inferior_data_key); + sim_data = ((struct sim_inferior_data *) + inferior_data (inf, sim_inferior_data_key)); return (sim_data != NULL && sim_data->gdbsim_desc == new_sim_desc); } @@ -172,7 +173,7 @@ get_sim_inferior_data (struct inferior *inf, int sim_instance_needed) { SIM_DESC sim_desc = NULL; struct sim_inferior_data *sim_data - = inferior_data (inf, sim_inferior_data_key); + = (struct sim_inferior_data *) inferior_data (inf, sim_inferior_data_key); /* Try to allocate a new sim instance, if needed. We do this ahead of a potential allocation of a sim_inferior_data struct in order to @@ -257,7 +258,7 @@ get_sim_inferior_data_by_ptid (ptid_t ptid, int sim_instance_needed) static void sim_inferior_data_cleanup (struct inferior *inf, void *data) { - struct sim_inferior_data *sim_data = data; + struct sim_inferior_data *sim_data = (struct sim_inferior_data *) data; if (sim_data != NULL) { @@ -766,8 +767,8 @@ gdbsim_open (const char *args, int from_tty) static int gdbsim_close_inferior (struct inferior *inf, void *arg) { - struct sim_inferior_data *sim_data = inferior_data (inf, - sim_inferior_data_key); + struct sim_inferior_data *sim_data + = (struct sim_inferior_data *) inferior_data (inf, sim_inferior_data_key); if (sim_data != NULL) { ptid_t ptid = sim_data->remote_sim_ptid; @@ -849,7 +850,7 @@ gdbsim_resume_inferior (struct inferior *inf, void *arg) { struct sim_inferior_data *sim_data = get_sim_inferior_data (inf, SIM_INSTANCE_NOT_NEEDED); - struct resume_data *rd = arg; + struct resume_data *rd = (struct resume_data *) arg; if (sim_data) { @@ -1034,13 +1035,13 @@ gdbsim_wait (struct target_ops *ops, case GDB_SIGNAL_TRAP: default: status->kind = TARGET_WAITKIND_STOPPED; - status->value.sig = sigrc; + status->value.sig = (enum gdb_signal) sigrc; break; } break; case sim_signalled: status->kind = TARGET_WAITKIND_SIGNALLED; - status->value.sig = sigrc; + status->value.sig = (enum gdb_signal) sigrc; break; case sim_running: case sim_polling: @@ -1198,7 +1199,8 @@ simulator_command (char *args, int from_tty) thus allocating memory that would not be garbage collected until the ultimate destruction of the associated inferior. */ - sim_data = inferior_data (current_inferior (), sim_inferior_data_key); + sim_data = ((struct sim_inferior_data *) + inferior_data (current_inferior (), sim_inferior_data_key)); if (sim_data == NULL || sim_data->gdbsim_desc == NULL) { @@ -1231,7 +1233,8 @@ sim_command_completer (struct cmd_list_element *ignore, const char *text, int i; VEC (char_ptr) *result = NULL; - sim_data = inferior_data (current_inferior (), sim_inferior_data_key); + sim_data = ((struct sim_inferior_data *) + inferior_data (current_inferior (), sim_inferior_data_key)); if (sim_data == NULL || sim_data->gdbsim_desc == NULL) return NULL; |