comparison src/gtkplugin.c @ 12600:e856f985a0b9

[gaim-migrate @ 14934] Enable the extra warnings regardless of --enable-debug. Enable FORTIFY_SOURCE regardless of --enable-debug, adding a --disable-fortify flag to configure. Enable (well, stop disabling) the missing initializer warnings. This leads to warnings with: GValue v = {0,}; that must be worked around. Basically, instead of: GValue v = {0,}; ... g_value_init(&v, G_TYPE_FOO); /* or other use of the GValue */ We'd need to do: GValue v; ... v.g_type = 0; g_value_init(&v, G_TYPE_FOO); /* or other use of the GValue */ Fix several cases of missing initializers. I don't think any of these are bugs, but having this warning seems like a good idea. It might prevent us from making a mistake in the future. While I was fixing missing initializers, I optimized substitute_simple_word in plugins/spellchk.c, in the same way as I did substitute_word before. Yes, I'm bad for committing these together. Added a --enable-fatal-asserts flag to configure. As the name implies, this makes g_return_... guards fatal. This is a useful flag to run on a debug copy of Gaim. It will make it very clear if your changes have triggered one of these guards. It's also useful in detecting g_return_... abuse, which helps prevent crashes if Gaim is compiled with G_DISABLE_ASSERT defined. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Wed, 21 Dec 2005 18:36:19 +0000
parents a02f877637a6
children 0bc110c7ab91
comparison
equal deleted inserted replaced
12599:e94c33909aa6 12600:e856f985a0b9
234 234
235 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) 235 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model)
236 { 236 {
237 gchar *buf, *pname, *pdesc, *pauth, *pweb; 237 gchar *buf, *pname, *pdesc, *pauth, *pweb;
238 GtkTreeIter iter; 238 GtkTreeIter iter;
239 GValue val = { 0, }; 239 GValue val;
240 GaimPlugin *plug; 240 GaimPlugin *plug;
241 241
242 if (!gtk_tree_selection_get_selected (sel, &model, &iter)) 242 if (!gtk_tree_selection_get_selected (sel, &model, &iter))
243 { 243 {
244 /* Clear the old plugin details */ 244 /* Clear the old plugin details */
252 return; 252 return;
253 } 253 }
254 254
255 gtk_widget_set_sensitive(expander, TRUE); 255 gtk_widget_set_sensitive(expander, TRUE);
256 256
257 val.g_type = 0;
257 gtk_tree_model_get_value (model, &iter, 2, &val); 258 gtk_tree_model_get_value (model, &iter, 2, &val);
258 plug = g_value_get_pointer(&val); 259 plug = g_value_get_pointer(&val);
259 260
260 pname = g_markup_escape_text(_(plug->info->name), -1); 261 pname = g_markup_escape_text(_(plug->info->name), -1);
261 pdesc = (plug->info->description) ? 262 pdesc = (plug->info->description) ?
296 static void plugin_dialog_response_cb(GtkWidget *d, int response, GtkTreeSelection *sel) 297 static void plugin_dialog_response_cb(GtkWidget *d, int response, GtkTreeSelection *sel)
297 { 298 {
298 GaimPlugin *plug; 299 GaimPlugin *plug;
299 GtkWidget *dialog, *box; 300 GtkWidget *dialog, *box;
300 GtkTreeModel *model; 301 GtkTreeModel *model;
301 GValue val = { 0, }; 302 GValue val;
302 GtkTreeIter iter; 303 GtkTreeIter iter;
303 304
304 switch (response) { 305 switch (response) {
305 case GTK_RESPONSE_CLOSE: 306 case GTK_RESPONSE_CLOSE:
306 case GTK_RESPONSE_DELETE_EVENT: 307 case GTK_RESPONSE_DELETE_EVENT:
312 plugin_dialog = NULL; 313 plugin_dialog = NULL;
313 break; 314 break;
314 case GAIM_RESPONSE_CONFIGURE: 315 case GAIM_RESPONSE_CONFIGURE:
315 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) 316 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
316 return; 317 return;
317 gtk_tree_model_get_value (model, &iter, 2, &val); 318 val.g_type = 0;
319 gtk_tree_model_get_value(model, &iter, 2, &val);
318 plug = g_value_get_pointer(&val); 320 plug = g_value_get_pointer(&val);
319 if (plug == NULL) 321 if (plug == NULL)
320 break; 322 break;
321 if (plugin_pref_dialogs != NULL && 323 if (plugin_pref_dialogs != NULL &&
322 g_hash_table_lookup(plugin_pref_dialogs, plug)) 324 g_hash_table_lookup(plugin_pref_dialogs, plug))