From: <des...@us...> - 2003-12-26 09:31:33
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv20471 Modified Files: plugin.h prefswin.c Log Message: - added typecast macros for plugin types - fixed memory leak in prefswin_font_browse_cb() Index: plugin.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/plugin.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** plugin.h 24 Dec 2003 14:03:17 -0000 1.5 --- plugin.h 26 Dec 2003 09:31:29 -0000 1.6 *************** *** 32,35 **** --- 32,36 ---- } AFormat; + #define OUTPUT_PLUGIN(x) ((OutputPlugin *)(x)) typedef struct { void *handle; /* Filled in by xmms */ *************** *** 59,62 **** --- 60,64 ---- } OutputPlugin; + #define EFFECT_PLUGIN(x) ((EffectPlugin *)(x)) typedef struct { void *handle; /* Filled in by xmms */ *************** *** 75,78 **** --- 77,81 ---- } InputVisType; + #define INPUT_PLUGIN(x) ((InputPlugin *)(x)) typedef struct { void *handle; /* Filled in by xmms */ *************** *** 116,119 **** --- 119,123 ---- int effects_enabled(void); + #define GENERAL_PLUGIN(x) ((GeneralPlugin *)(x)) typedef struct { void *handle; /* Filled in by xmms */ *************** *** 127,130 **** --- 131,135 ---- } GeneralPlugin; + #define VIS_PLUGIN(x) ((VisPlugin *)(x)) typedef struct _VisPlugin { void *handle; /* Filled in by xmms */ Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** prefswin.c 26 Dec 2003 08:30:16 -0000 1.7 --- prefswin.c 26 Dec 2003 09:31:29 -0000 1.8 *************** *** 477,481 **** response = gtk_dialog_run(GTK_DIALOG(fontsel)); ! g_message(g_strdup_printf("%d", response)); switch (response) { --- 477,481 ---- response = gtk_dialog_run(GTK_DIALOG(fontsel)); ! g_message("%d", response); switch (response) { *************** *** 652,656 **** sel = GPOINTER_TO_INT(clist->selection->data); ! selected = (InputPlugin *) (g_list_nth(get_input_list(), sel)->data); if (!gtk_toggle_button_get_active(w)) --- 652,656 ---- sel = GPOINTER_TO_INT(clist->selection->data); ! selected = INPUT_PLUGIN((g_list_nth(get_input_list(), sel)->data)); if (!gtk_toggle_button_get_active(w)) *************** *** 1380,1390 **** gtk_label_new(_("Options"))); ! /* ! * Fonts page */ prefswin_fonts_vbox = gtk_table_new(4, 4, TRUE); ! // This ain't exactly GnomeFontPicker, but we're not a GNOME app so no GNOME widgets for us label = gtk_label_new("Playlist Font:"); --- 1380,1391 ---- gtk_label_new(_("Options"))); ! /* ! * Fonts page */ prefswin_fonts_vbox = gtk_table_new(4, 4, TRUE); ! /* This ain't exactly GnomeFontPicker, but we're not a GNOME app ! * so no GNOME widgets for us */ label = gtk_label_new("Playlist Font:"); *************** *** 1474,1480 **** ! /* ! * Ok, Cancel & Apply ! */ prefswin_hbox = gtk_hbutton_box_new(); --- 1475,1479 ---- ! /* Ok, Cancel & Apply */ prefswin_hbox = gtk_hbutton_box_new(); *************** *** 1519,1523 **** selected_oplugin = GPOINTER_TO_INT(item); output = get_output_list(); ! cp = (OutputPlugin *) g_list_nth(output, GPOINTER_TO_INT(item))->data; if (cp->configure != NULL) --- 1518,1522 ---- selected_oplugin = GPOINTER_TO_INT(item); output = get_output_list(); ! cp = OUTPUT_PLUGIN(g_list_nth(output, GPOINTER_TO_INT(item))->data); if (cp->configure != NULL) *************** *** 1534,1539 **** void gen_module_description(gchar * file, gchar * desc, gchar ** full_desc) { ! // (*full_desc) = g_strdup_printf("%s [%s]", desc, g_basename(file)); ! (*full_desc) = g_strdup_printf("%s", desc); } --- 1533,1538 ---- void gen_module_description(gchar * file, gchar * desc, gchar ** full_desc) { ! /* (*full_desc) = g_strdup_printf("%s [%s]", desc, g_basename(file)); */ ! (*full_desc) = g_strdup(desc); } *************** *** 1555,1559 **** menu = gtk_menu_new(); while (olist) { ! op = (OutputPlugin *) olist->data; if (olist->data == cp) --- 1554,1558 ---- menu = gtk_menu_new(); while (olist) { ! op = OUTPUT_PLUGIN(olist->data); if (olist->data == cp) *************** *** 1599,1603 **** while (glist) { ! ep = (EffectPlugin *) glist->data; gen_module_description(ep->filename, ep->description, &description); --- 1598,1602 ---- while (glist) { ! ep = EFFECT_PLUGIN(glist->data); gen_module_description(ep->filename, ep->description, &description); *************** *** 1628,1632 **** while (glist) { ! gp = (GeneralPlugin *) glist->data; gen_module_description(gp->filename, gp->description, &description); --- 1627,1631 ---- while (glist) { ! gp = GENERAL_PLUGIN(glist->data); gen_module_description(gp->filename, gp->description, &description); *************** *** 1657,1661 **** while (glist) { ! vp = (VisPlugin *) glist->data; gen_module_description(vp->filename, vp->description, &description); --- 1656,1660 ---- while (glist) { ! vp = VIS_PLUGIN(glist->data); gen_module_description(vp->filename, vp->description, &description); *************** *** 1684,1688 **** gtk_clist_clear(clist); while (ilist) { ! ip = (InputPlugin *) ilist->data; /* gen_module_description(ip->filename, ip->description, &description); --- 1683,1687 ---- gtk_clist_clear(clist); while (ilist) { ! ip = INPUT_PLUGIN(ilist->data); /* gen_module_description(ip->filename, ip->description, &description); |