summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-03-24 15:17:57 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-03-24 15:24:06 -0500
commitc1c3b5502e082d186ce6be5a40e1f9f2a0e861b5 (patch)
tree3797b5b1e048f011f1556d0af94092c37c0b0e7d
parentdd2a1e648b0e4f605d123cbf30d6952d554332e3 (diff)
downloadofono-c1c3b5502e082d186ce6be5a40e1f9f2a0e861b5.tar.bz2
Style: No point to write a function to wrap g_free
Using casting magic works well enough, and more consistent with the rest of the library.
-rw-r--r--gatchat/ppp_cp.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/gatchat/ppp_cp.c b/gatchat/ppp_cp.c
index b02f4ba1..3132af5c 100644
--- a/gatchat/ppp_cp.c
+++ b/gatchat/ppp_cp.c
@@ -187,17 +187,11 @@ static void pppcp_this_layer_finished(struct pppcp_data *data)
action->this_layer_finished(data);
}
-static void pppcp_free_option(gpointer data, gpointer user_data)
-{
- struct ppp_option *option = data;
- g_free(option);
-}
-
static void pppcp_clear_options(struct pppcp_data *data)
{
- g_list_foreach(data->acceptable_options, pppcp_free_option, NULL);
- g_list_foreach(data->unacceptable_options, pppcp_free_option, NULL);
- g_list_foreach(data->rejected_options, pppcp_free_option, NULL);
+ g_list_foreach(data->acceptable_options, (GFunc) g_free, NULL);
+ g_list_foreach(data->unacceptable_options, (GFunc) g_free, NULL);
+ g_list_foreach(data->rejected_options, (GFunc) g_free, NULL);
g_list_free(data->acceptable_options);
g_list_free(data->unacceptable_options);
g_list_free(data->rejected_options);
@@ -212,7 +206,7 @@ static void pppcp_free_options(struct pppcp_data *data)
pppcp_clear_options(data);
/* remove default option list */
- g_list_foreach(data->config_options, pppcp_free_option, NULL);
+ g_list_foreach(data->config_options, (GFunc) g_free, NULL);
g_list_free(data->config_options);
}