Mercurial > pidgin.yaz
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 13105:e347b2217b1b | 13106:a0a4b44239e8 |
|---|---|
| 100 | 100 |
| 101 return pref; | 101 return pref; |
| 102 } | 102 } |
| 103 | 103 |
| 104 GaimPluginPref * | 104 GaimPluginPref * |
| 105 gaim_plugin_pref_new_with_name(char *name) { | 105 gaim_plugin_pref_new_with_name(const char *name) { |
| 106 GaimPluginPref *pref; | 106 GaimPluginPref *pref; |
| 107 | 107 |
| 108 g_return_val_if_fail(name, NULL); | 108 g_return_val_if_fail(name, NULL); |
| 109 | 109 |
| 110 pref = g_new0(GaimPluginPref, 1); | 110 pref = g_new0(GaimPluginPref, 1); |
| 112 | 112 |
| 113 return pref; | 113 return pref; |
| 114 } | 114 } |
| 115 | 115 |
| 116 GaimPluginPref * | 116 GaimPluginPref * |
| 117 gaim_plugin_pref_new_with_label(char *label) { | 117 gaim_plugin_pref_new_with_label(const char *label) { |
| 118 GaimPluginPref *pref; | 118 GaimPluginPref *pref; |
| 119 | 119 |
| 120 g_return_val_if_fail(label, NULL); | 120 g_return_val_if_fail(label, NULL); |
| 121 | 121 |
| 122 pref = g_new0(GaimPluginPref, 1); | 122 pref = g_new0(GaimPluginPref, 1); |
| 124 | 124 |
| 125 return pref; | 125 return pref; |
| 126 } | 126 } |
| 127 | 127 |
| 128 GaimPluginPref * | 128 GaimPluginPref * |
| 129 gaim_plugin_pref_new_with_name_and_label(char *name, char *label) { | 129 gaim_plugin_pref_new_with_name_and_label(const char *name, const char *label) { |
| 130 GaimPluginPref *pref; | 130 GaimPluginPref *pref; |
| 131 | 131 |
| 132 g_return_val_if_fail(name, NULL); | 132 g_return_val_if_fail(name, NULL); |
| 133 g_return_val_if_fail(label, NULL); | 133 g_return_val_if_fail(label, NULL); |
| 134 | 134 |
| 160 | 160 |
| 161 g_free(pref); | 161 g_free(pref); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void | 164 void |
| 165 gaim_plugin_pref_set_name(GaimPluginPref *pref, char *name) { | 165 gaim_plugin_pref_set_name(GaimPluginPref *pref, const char *name) { |
| 166 g_return_if_fail(pref); | 166 g_return_if_fail(pref); |
| 167 g_return_if_fail(name); | 167 g_return_if_fail(name); |
| 168 | 168 |
| 169 if(pref->name) | 169 if(pref->name) |
| 170 g_free(pref->name); | 170 g_free(pref->name); |
| 171 | 171 |
| 172 pref->name = g_strdup(name); | 172 pref->name = g_strdup(name); |
| 173 } | 173 } |
| 174 | 174 |
| 175 char * | 175 const char * |
| 176 gaim_plugin_pref_get_name(GaimPluginPref *pref) { | 176 gaim_plugin_pref_get_name(GaimPluginPref *pref) { |
| 177 g_return_val_if_fail(pref, NULL); | 177 g_return_val_if_fail(pref, NULL); |
| 178 | 178 |
| 179 return pref->name; | 179 return pref->name; |
| 180 } | 180 } |
| 181 | 181 |
| 182 void | 182 void |
| 183 gaim_plugin_pref_set_label(GaimPluginPref *pref, char *label) { | 183 gaim_plugin_pref_set_label(GaimPluginPref *pref, const char *label) { |
| 184 g_return_if_fail(pref); | 184 g_return_if_fail(pref); |
| 185 g_return_if_fail(label); | 185 g_return_if_fail(label); |
| 186 | 186 |
| 187 if(pref->label) | 187 if(pref->label) |
| 188 g_free(pref->label); | 188 g_free(pref->label); |
| 189 | 189 |
| 190 pref->label = g_strdup(label); | 190 pref->label = g_strdup(label); |
| 191 } | 191 } |
| 192 | 192 |
| 193 char * | 193 const char * |
| 194 gaim_plugin_pref_get_label(GaimPluginPref *pref) { | 194 gaim_plugin_pref_get_label(GaimPluginPref *pref) { |
| 195 g_return_val_if_fail(pref, NULL); | 195 g_return_val_if_fail(pref, NULL); |
| 196 | 196 |
| 197 return pref->label; | 197 return pref->label; |
| 198 } | 198 } |
| 249 | 249 |
| 250 return pref->type; | 250 return pref->type; |
| 251 } | 251 } |
| 252 | 252 |
| 253 void | 253 void |
| 254 gaim_plugin_pref_add_choice(GaimPluginPref *pref, char *label, gpointer choice) { | 254 gaim_plugin_pref_add_choice(GaimPluginPref *pref, const char *label, gpointer choice) { |
| 255 g_return_if_fail(pref); | 255 g_return_if_fail(pref); |
| 256 g_return_if_fail(label); | 256 g_return_if_fail(label); |
| 257 g_return_if_fail(choice); | 257 g_return_if_fail(choice); |
| 258 | 258 |
| 259 pref->choices = g_list_append(pref->choices, label); | 259 pref->choices = g_list_append(pref->choices, (gpointer)label); |
| 260 pref->choices = g_list_append(pref->choices, choice); | 260 pref->choices = g_list_append(pref->choices, choice); |
| 261 } | 261 } |
| 262 | 262 |
| 263 GList * | 263 GList * |
| 264 gaim_plugin_pref_get_choices(GaimPluginPref *pref) { | 264 gaim_plugin_pref_get_choices(GaimPluginPref *pref) { |
