Mercurial > pidgin
diff src/pluginpref.c @ 13106:a0a4b44239e8
[gaim-migrate @ 15468]
I was reading the gettext man page and it pointed out that it should be typed as const char *, but it's char * to avoid warnings in code predating ANSI C. So, for the heck of it, I changed added a cast in internal.h. As it turns out, there was a lot of code that relied on this. In the interest of type safety, I've fixed all the warnings. I feel this improved a number of function signatures (in terms of typing clarity). Flame me if you object.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Thu, 02 Feb 2006 21:34:43 +0000 |
parents | 8ae981f2c9cb |
children | 16f6d6f8afc7 |
line wrap: on
line diff
--- a/src/pluginpref.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/pluginpref.c Thu Feb 02 21:34:43 2006 +0000 @@ -102,7 +102,7 @@ } GaimPluginPref * -gaim_plugin_pref_new_with_name(char *name) { +gaim_plugin_pref_new_with_name(const char *name) { GaimPluginPref *pref; g_return_val_if_fail(name, NULL); @@ -114,7 +114,7 @@ } GaimPluginPref * -gaim_plugin_pref_new_with_label(char *label) { +gaim_plugin_pref_new_with_label(const char *label) { GaimPluginPref *pref; g_return_val_if_fail(label, NULL); @@ -126,7 +126,7 @@ } GaimPluginPref * -gaim_plugin_pref_new_with_name_and_label(char *name, char *label) { +gaim_plugin_pref_new_with_name_and_label(const char *name, const char *label) { GaimPluginPref *pref; g_return_val_if_fail(name, NULL); @@ -162,7 +162,7 @@ } void -gaim_plugin_pref_set_name(GaimPluginPref *pref, char *name) { +gaim_plugin_pref_set_name(GaimPluginPref *pref, const char *name) { g_return_if_fail(pref); g_return_if_fail(name); @@ -172,7 +172,7 @@ pref->name = g_strdup(name); } -char * +const char * gaim_plugin_pref_get_name(GaimPluginPref *pref) { g_return_val_if_fail(pref, NULL); @@ -180,7 +180,7 @@ } void -gaim_plugin_pref_set_label(GaimPluginPref *pref, char *label) { +gaim_plugin_pref_set_label(GaimPluginPref *pref, const char *label) { g_return_if_fail(pref); g_return_if_fail(label); @@ -190,7 +190,7 @@ pref->label = g_strdup(label); } -char * +const char * gaim_plugin_pref_get_label(GaimPluginPref *pref) { g_return_val_if_fail(pref, NULL); @@ -251,12 +251,12 @@ } void -gaim_plugin_pref_add_choice(GaimPluginPref *pref, char *label, gpointer choice) { +gaim_plugin_pref_add_choice(GaimPluginPref *pref, const char *label, gpointer choice) { g_return_if_fail(pref); g_return_if_fail(label); g_return_if_fail(choice); - pref->choices = g_list_append(pref->choices, label); + pref->choices = g_list_append(pref->choices, (gpointer)label); pref->choices = g_list_append(pref->choices, choice); }