patch adding G_GNUC_CONST to get_type()

Jean-Yves Lefort <[email protected]> Mon, 25 Feb 2008 21:29:41 +0100
Newsgroups gmane.comp.gnome.devtools.gob.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.

[email protected]
Content-Type: multipart/signed; protocol="application/pgp-signature";
 micalg="PGP-SHA1";
 boundary="Signature=_Mon__25_Feb_2008_21_29_41_+0100_=dO/ZA1cGgVCJLqb"

--Signature=_Mon__25_Feb_2008_21_29_41_+0100_=dO/ZA1cGgVCJLqb
Content-Type: multipart/mixed;
 boundary="Multipart=_Mon__25_Feb_2008_21_29_41_+0100_xhZCF8.I9MzEVVI0"


--Multipart=_Mon__25_Feb_2008_21_29_41_+0100_xhZCF8.I9MzEVVI0
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

The attached patch adds the G_GNUC_CONST attribute to get_type()
function declarations. It is a performance improvement which allows
the compiler to move get_type() calls out of loops, etc.

--=20
Jean-Yves Lefort <[email protected]>

--Multipart=_Mon__25_Feb_2008_21_29_41_+0100_xhZCF8.I9MzEVVI0
Content-Type: text/x-diff;
 name="gob2-jylefort-const-gettype.diff"
Content-Disposition: attachment;
 filename="gob2-jylefort-const-gettype.diff"
Content-Transfer-Encoding: quoted-printable

Index: src/main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /usr/local/cvsroot/gob2/src/main.c,v
retrieving revision 1.4
diff -u -r1.4 main.c
--- src/main.c	1 Feb 2008 21:39:50 -0000	1.4
+++ src/main.c	25 Feb 2008 20:23:09 -0000
@@ -3644,7 +3644,7 @@
 		    " */\n");
=20
 	if ( ! overrode_get_type) {
-		out_printf (outh, "GType\t%s_get_type\t(void);\n", funcbase);
+		out_printf (outh, "GType\t%s_get_type\t(void) G_GNUC_CONST;\n", funcbase=
);
 	}
=20
 	for(li =3D c->nodes; li !=3D NULL; li =3D li->next) {

--Multipart=_Mon__25_Feb_2008_21_29_41_+0100_xhZCF8.I9MzEVVI0--

--Signature=_Mon__25_Feb_2008_21_29_41_+0100_=dO/ZA1cGgVCJLqb
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHwyU7yzD7UaO4AGoRAt5AAJ43bDYGv+c6VN7wxWUWXA96SIYHQgCffgaL
YAoseuVydqpI9qUiSBGCnXg=
=Qf96
-----END PGP SIGNATURE-----

--Signature=_Mon__25_Feb_2008_21_29_41_+0100_=dO/ZA1cGgVCJLqb--


[email protected]
Content-Type: text/plain; charset=us-ascii; name="footer.txt"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

--
to unsubscribe:
send mail to [email protected] with "unsubscribe gob-list" in the subject

[email protected]