summaryrefslogtreecommitdiffstats
path: root/gatchat/ppp_cp.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-04-05 14:25:14 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-04-05 14:25:14 -0500
commit5e8a9c29414fb7d9d59a25f6d9e8d523baac95cc (patch)
treecb82445eda2165ad76c106a2c8b2844440d36869 /gatchat/ppp_cp.c
parent60d96505dce4f11da7c307b03557a6f2ee8c139d (diff)
downloadofono-5e8a9c29414fb7d9d59a25f6d9e8d523baac95cc.tar.bz2
Refactor: Make option_process more typesafe
option_process was declared with two gpointer arguments for the sole reason of being used as a GFunc. Casting to a GFunc or re-writing the foreach as a loop is preferable.
Diffstat (limited to 'gatchat/ppp_cp.c')
-rw-r--r--gatchat/ppp_cp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gatchat/ppp_cp.c b/gatchat/ppp_cp.c
index c24d6122..9d3d18bb 100644
--- a/gatchat/ppp_cp.c
+++ b/gatchat/ppp_cp.c
@@ -935,8 +935,11 @@ static guint8 pppcp_process_configure_request(struct pppcp_data *data,
* when the ppp goes down.
*/
if (action->option_process) {
- g_list_foreach(data->acceptable_options,
- action->option_process, data);
+ GList *l;
+
+ for (l = data->acceptable_options; l; l = l->next)
+ action->option_process(data, l->data);
+
g_list_foreach(data->acceptable_options, remove_config_option,
data);
}
@@ -986,7 +989,7 @@ static guint8 pppcp_process_configure_ack(struct pppcp_data *data,
* the config_options list.
*/
if (action->option_process)
- action->option_process(acked_option, data);
+ action->option_process(data, acked_option);
g_free(list->data);
data->config_options =