Re: [patch] Fix compilation for 1.0pre5 with gcc 2.95.x

Simon Barner <[email protected]> Mon, 24 Nov 2003 17:23:04 +0100
Newsgroups gmane.comp.multimedia.beep-media-player.devel
Message-ID <[email protected]>
--Y5rl02BVI9TCfPar
Content-Type: multipart/mixed; boundary="gatW/ieO32f1wygP"
Content-Disposition: inline


--gatW/ieO32f1wygP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> >while I updated the FreeBSD port for bmp (for those who are not familiar
> >with the ports collection: the port skeleton is available
> >here:=20
> >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.
> >=20
> >
> 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

--gatW/ieO32f1wygP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch-Input::vorbis::fileinfo.c"
Content-Transfer-Encoding: quoted-printable

--- Input/vorbis/fileinfo.c.orig	Mon Nov 24 02:44:46 2003
+++ Input/vorbis/fileinfo.c	Mon Nov 24 02:48:33 2003
@@ -498,6 +498,8 @@
=20
 	static GtkWidget *filename_entry, *tag_frame;
=20
+	struct stat mstat;
+=09
 	g_free(vte.filename);
 	vte.filename =3D g_strdup(fn);
 =09
@@ -505,7 +507,14 @@
 	{
 		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;
+	=09
 		window =3D gtk_window_new(GTK_WINDOW_TOPLEVEL);
 		gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
 		g_signal_connect(G_OBJECT(window), "destroy",=20
@@ -519,15 +528,11 @@
 		filename_hbox =3D gtk_hbox_new(FALSE, 5);
 		gtk_box_pack_start(GTK_BOX(vbox), filename_hbox, FALSE, TRUE, 0);
=20
-		GtkWidget * pixmapwid;
-		GdkPixbuf * pixbuf =3D gdk_pixbuf_new_from_xpm_data((const char **)gnome=
_mime_audio_ogg_xpm);
+		pixbuf =3D gdk_pixbuf_new_from_xpm_data((const char **)gnome_mime_audio_=
ogg_xpm);
 		pixmapwid =3D 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);
=20
-		PangoAttrList *attrs;
-		PangoAttribute     *attr;
-
 		attrs =3D pango_attr_list_new ();
=20
 		attr =3D pango_attr_weight_new (PANGO_WEIGHT_BOLD);
@@ -728,7 +733,6 @@
 				 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
 #endif
=20
-		GtkWidget * boxx;
 		boxx =3D gtk_hbutton_box_new();
 		gtk_hbutton_box_set_layout_default(GTK_BUTTONBOX_SPREAD);
=20
@@ -746,7 +750,7 @@
 		gtk_table_attach(table,boxx,0,5,6,7,GTK_FILL,0,0,8);
=20
 		rg_show_button =3D gtk_toggle_button_new();
-		GtkImage * img =3D gtk_image_new_from_stock(GTK_STOCK_GO_FORWARD, GTK_IC=
ON_SIZE_MENU);
+		img =3D gtk_image_new_from_stock(GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_MEN=
U);
 		gtk_container_add(rg_show_button,img);
 		g_signal_connect(G_OBJECT(rg_show_button), "toggled",
 				   G_CALLBACK(rg_show_cb), NULL);
@@ -836,7 +840,7 @@
 		gtk_box_set_spacing(GTK_BOX(info_box), 0);
=20
 		// FIXME: Obvious...
-		GtkWidget * test_table =3D gtk_table_new(2, 10, FALSE);
+		test_table =3D 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);
=20
@@ -1068,7 +1072,6 @@
 	gtk_window_set_title(GTK_WINDOW(window), tmp);
 //	rg_show_cb(rg_show_button, NULL);
=20
-	struct stat mstat;
 	stat(fn,&mstat);
 	gtk_widget_set_sensitive(tag_frame, ((mstat.st_mode & S_IWRITE) =3D=3D S_=
IWRITE ) );
=20

--gatW/ieO32f1wygP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch-Input::vorbis::vorbis.c"
Content-Transfer-Encoding: quoted-printable

--- Input/vorbis/vorbis.c.orig	Mon Nov 24 02:43:58 2003
+++ Input/vorbis/vorbis.c	Mon Nov 24 02:44:23 2003
@@ -134,7 +134,7 @@
 	FILE *stream;
 	OggVorbis_File vfile; /* avoid thread interaction */
 	char *ext;
-
+	gint result;
=20
 	/* is this our http resource? */
 	if (strncasecmp(filename, "http://", 7) =3D=3D 0) {
@@ -161,7 +161,6 @@
 	memset(&vfile, 0, sizeof(vfile));
 	pthread_mutex_lock(&vf_mutex);
=20
-	gint result;
 	result =3D ov_test(stream, &vfile, NULL, 0);
=20
 	switch (result) {

--gatW/ieO32f1wygP--

--Y5rl02BVI9TCfPar
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/wjBoCkn+/eutqCoRAn4CAJ47ZJ/GAQQ9PHZDNanImVFrA1ZY5QCg6Csn
yq1Xcez2XpRxPFEAcgdzJz0=
=aaRy
-----END PGP SIGNATURE-----

--Y5rl02BVI9TCfPar--