Re: [patch] Fix compilation for 1.0pre5 with gcc 2.95.x
Simon Barner <barner <at> in.tum.de>
2003-11-24 16:23:04 GMT
> >while I updated the FreeBSD port for bmp (for those who are not familiar
> >with the ports collection: the port skeleton is available
> >here:
> >http://www.freebsd.org/cgi/cvsweb.cgi/ports/multimedia/beep-media-player/)
> >I noticed that it did not compile with gcc 2.95.4 which is still in use
> >with FreeBSD 4.x.
> >
> >The problem is, that sometimes you do not declare variables at the
> >beginning of a {}-block, but in C++ style in the middle.
> >
> >The attached patches are against version 1.0pre5.
> >
> >Regards,
> >Simon
> >
> >P.S.: Please Cc: me for replies since I am not subscribed.
> >
> >
> Thank you very much, patch is applied and commited.
In my last patches, I missed the vorbis plugin. The patches are again
attached.
Regards,
Simon
--- Input/vorbis/fileinfo.c.orig Mon Nov 24 02:44:46 2003
+++ Input/vorbis/fileinfo.c Mon Nov 24 02:48:33 2003
<at> <at> -498,6 +498,8 <at> <at>
static GtkWidget *filename_entry, *tag_frame;
+ struct stat mstat;
+
g_free(vte.filename);
vte.filename = g_strdup(fn);
<at> <at> -505,7 +507,14 <at> <at>
{
GtkWidget *hbox, *label, *filename_hbox, *vbox, *left_vbox;
GtkWidget *table, *bbox, *cancel_button;
-
+ GtkWidget * pixmapwid;
+ GdkPixbuf * pixbuf;
+ PangoAttrList *attrs;
+ PangoAttribute *attr;
+ GtkWidget * boxx;
+ GtkImage * img;
+ GtkWidget * test_table;
+
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
g_signal_connect(G_OBJECT(window), "destroy",
<at> <at> -519,15 +528,11 <at> <at>
filename_hbox = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(GTK_BOX(vbox), filename_hbox, FALSE, TRUE, 0);
- GtkWidget * pixmapwid;
- GdkPixbuf * pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)gnome_mime_audio_ogg_xpm);
+ pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)gnome_mime_audio_ogg_xpm);
pixmapwid = gtk_image_new_from_pixbuf(pixbuf);
gtk_misc_set_alignment(GTK_MISC(pixmapwid), 0, 0);
gtk_box_pack_start(GTK_BOX(filename_hbox), pixmapwid, FALSE, FALSE, 0);
- PangoAttrList *attrs;
- PangoAttribute *attr;
-
attrs = pango_attr_list_new ();
attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
<at> <at> -728,7 +733,6 <at> <at>
GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
#endif
- GtkWidget * boxx;
boxx = gtk_hbutton_box_new();
gtk_hbutton_box_set_layout_default(GTK_BUTTONBOX_SPREAD);
<at> <at> -746,7 +750,7 <at> <at>
gtk_table_attach(table,boxx,0,5,6,7,GTK_FILL,0,0,8);
rg_show_button = gtk_toggle_button_new();
- GtkImage * img = gtk_image_new_from_stock(GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_MENU);
+ img = gtk_image_new_from_stock(GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_MENU);
gtk_container_add(rg_show_button,img);
g_signal_connect(G_OBJECT(rg_show_button), "toggled",
G_CALLBACK(rg_show_cb), NULL);
<at> <at> -836,7 +840,7 <at> <at>
gtk_box_set_spacing(GTK_BOX(info_box), 0);
// FIXME: Obvious...
- GtkWidget * test_table = gtk_table_new(2, 10, FALSE);
+ test_table = gtk_table_new(2, 10, FALSE);
gtk_container_set_border_width(GTK_CONTAINER(test_table), 0);
gtk_container_add(GTK_CONTAINER(info_box), test_table);
<at> <at> -1068,7 +1072,6 <at> <at>
gtk_window_set_title(GTK_WINDOW(window), tmp);
// rg_show_cb(rg_show_button, NULL);
- struct stat mstat;
stat(fn,&mstat);
gtk_widget_set_sensitive(tag_frame, ((mstat.st_mode & S_IWRITE) == S_IWRITE ) );
--- Input/vorbis/vorbis.c.orig Mon Nov 24 02:43:58 2003
+++ Input/vorbis/vorbis.c Mon Nov 24 02:44:23 2003
<at> <at> -134,7 +134,7 <at> <at>
FILE *stream;
OggVorbis_File vfile; /* avoid thread interaction */
char *ext;
-
+ gint result;
/* is this our http resource? */
if (strncasecmp(filename, "http://", 7) == 0) {
<at> <at> -161,7 +161,6 <at> <at>
memset(&vfile, 0, sizeof(vfile));
pthread_mutex_lock(&vf_mutex);
- gint result;
result = ov_test(stream, &vfile, NULL, 0);
switch (result) {