From: Denis Kenzior Date: Mon, 30 Aug 2010 19:29:34 +0000 (-0500) Subject: sim: Turn around the order of arguments X-Git-Tag: 0.27~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4292b2dbeda6bf31115abb8e5f9839d61e0a1272;p=platform%2Fupstream%2Fofono.git sim: Turn around the order of arguments The void *user argument was first. It should be last instead to be consistent with the other watch functions. --- diff --git a/drivers/atmodem/sim-poll.c b/drivers/atmodem/sim-poll.c index 3f1a355..ae1b55c 100644 --- a/drivers/atmodem/sim-poll.c +++ b/drivers/atmodem/sim-poll.c @@ -168,7 +168,7 @@ static gboolean sim_status_poll(gpointer user_data) return FALSE; } -static void sim_state_watch(void *user, enum ofono_sim_state new_state) +static void sim_state_watch(enum ofono_sim_state new_state, void *user) { struct sim_poll_data *spd = user; @@ -189,7 +189,7 @@ static void sim_watch(struct ofono_atom *atom, spd->sim_state_watch = ofono_sim_add_state_watch(spd->sim, sim_state_watch, spd, NULL); - sim_state_watch(spd, ofono_sim_get_state(spd->sim)); + sim_state_watch(ofono_sim_get_state(spd->sim), spd); sim_status_poll(spd); diff --git a/include/sim.h b/include/sim.h index 36a99b9..5bd1dd3 100644 --- a/include/sim.h +++ b/include/sim.h @@ -94,8 +94,8 @@ typedef void (*ofono_sim_write_cb_t)(const struct ofono_error *error, typedef void (*ofono_sim_imsi_cb_t)(const struct ofono_error *error, const char *imsi, void *data); -typedef void (*ofono_sim_state_event_notify_cb_t)(void *data, - enum ofono_sim_state new_state); +typedef void (*ofono_sim_state_event_cb_t)(enum ofono_sim_state new_state, + void *data); typedef void (*ofono_sim_file_read_cb_t)(int ok, int total_length, int record, const unsigned char *data, @@ -178,8 +178,8 @@ enum ofono_sim_cphs_phase ofono_sim_get_cphs_phase(struct ofono_sim *sim); const unsigned char *ofono_sim_get_cphs_service_table(struct ofono_sim *sim); unsigned int ofono_sim_add_state_watch(struct ofono_sim *sim, - ofono_sim_state_event_notify_cb_t cb, - void *data, ofono_destroy_func destroy); + ofono_sim_state_event_cb_t cb, + void *data, ofono_destroy_func destroy); void ofono_sim_remove_state_watch(struct ofono_sim *sim, unsigned int id); diff --git a/src/modem.c b/src/modem.c index 88ab451..ed75f6a 100644 --- a/src/modem.c +++ b/src/modem.c @@ -1322,7 +1322,7 @@ static void emit_modems() g_free(modems); } -static void modem_sim_ready(void *user, enum ofono_sim_state new_state) +static void sim_state_watch(enum ofono_sim_state new_state, void *user) { struct ofono_modem *modem = user; @@ -1358,8 +1358,8 @@ static void sim_watch(struct ofono_atom *atom, modem->sim = __ofono_atom_get_data(atom); modem->sim_ready_watch = ofono_sim_add_state_watch(modem->sim, - modem_sim_ready, - modem, NULL); + sim_state_watch, + modem, NULL); } int ofono_modem_register(struct ofono_modem *modem) diff --git a/src/sim.c b/src/sim.c index f8884a2..fd9b412 100644 --- a/src/sim.c +++ b/src/sim.c @@ -1001,7 +1001,7 @@ static void sim_efimg_read_cb(int ok, int length, int record, memcpy(efimg, &data[1], 9); } -static void sim_ready(void *user, enum ofono_sim_state new_state) +static void sim_ready(enum ofono_sim_state new_state, void *user) { struct ofono_sim *sim = user; @@ -2056,7 +2056,7 @@ static void sim_free_state(struct ofono_sim *sim) void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted) { - ofono_sim_state_event_notify_cb_t notify; + ofono_sim_state_event_cb_t notify; GSList *l; if (inserted == TRUE && sim->state == OFONO_SIM_STATE_NOT_PRESENT) @@ -2075,7 +2075,7 @@ void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted) struct ofono_watchlist_item *item = l->data; notify = item->notify; - notify(item->notify_data, sim->state); + notify(sim->state, item->notify_data); } if (inserted) @@ -2085,8 +2085,8 @@ void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted) } unsigned int ofono_sim_add_state_watch(struct ofono_sim *sim, - ofono_sim_state_event_notify_cb_t notify, - void *data, ofono_destroy_func destroy) + ofono_sim_state_event_cb_t notify, + void *data, ofono_destroy_func destroy) { struct ofono_watchlist_item *item; @@ -2123,7 +2123,7 @@ enum ofono_sim_state ofono_sim_get_state(struct ofono_sim *sim) static void sim_set_ready(struct ofono_sim *sim) { GSList *l; - ofono_sim_state_event_notify_cb_t notify; + ofono_sim_state_event_cb_t notify; if (sim == NULL) return; @@ -2137,7 +2137,7 @@ static void sim_set_ready(struct ofono_sim *sim) struct ofono_watchlist_item *item = l->data; notify = item->notify; - notify(item->notify_data, sim->state); + notify(sim->state, item->notify_data); } } diff --git a/src/voicecall.c b/src/voicecall.c index 11dc625..a5ee2ed 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -2034,7 +2034,7 @@ struct ofono_voicecall *ofono_voicecall_create(struct ofono_modem *modem, return vc; } -static void sim_state_watch(void *user, enum ofono_sim_state new_state) +static void sim_state_watch(enum ofono_sim_state new_state, void *user) { struct ofono_voicecall *vc = user; @@ -2085,7 +2085,7 @@ static void sim_watch(struct ofono_atom *atom, sim_state_watch, vc, NULL); - sim_state_watch(vc, ofono_sim_get_state(sim)); + sim_state_watch(ofono_sim_get_state(sim), vc); } void ofono_voicecall_register(struct ofono_voicecall *vc)