[xcrysden] Compile fixes for newer gcc

Wolfram Quester xcrysden@democritos.it
Wed, 1 Mar 2006 19:46:35 +0100


--7cm2iqirTL37Ot+N
Content-Type: multipart/mixed; boundary="4Epv4kl9IRBfg3rk"
Content-Disposition: inline


--4Epv4kl9IRBfg3rk
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi altogether!

I tried to compile XCrySDen here with gcc-4.0, but the compilation
failed with

xcDisplayFunc.c:162: error: static declaration of =E2=80=98HandleDisplay=E2=
=80=99 follows non-static declaration
anaglyph.h:81: error: previous declaration of =E2=80=98HandleDisplay=E2=80=
=99 was here
xcDisplayFunc.c:164: error: static declaration of =E2=80=98CameraHome=E2=80=
=99 follows non-static declaration
anaglyph.h:82: error: previous declaration of =E2=80=98CameraHome=E2=80=99 =
was here
xcDisplayFunc.c:165: error: static declaration of =E2=80=98Normalise=E2=80=
=99 follows non-static declaration
anaglyph.h:83: error: previous declaration of =E2=80=98Normalise=E2=80=99 w=
as here
xcDisplayFunc.c:166: error: static declaration of =E2=80=98CalcNormal=E2=80=
=99 follows non-static declaration
anaglyph.h:84: error: previous declaration of =E2=80=98CalcNormal=E2=80=99 =
was here
make[2]: *** [xcDisplayFunc.o] Error 1
make[2]: Leaving directory `/tmp/XC/C'
make[1]: *** [compile] Error 2
make[1]: Leaving directory `/tmp/XC/C'
make: *** [src-C] Error 2


The attached patch fixes this. The cleanest solution would probably be
to move all the static declarations to the .h files. Shall I submit a
patch that accomplishes this?

With best regards,

Wolfi

--4Epv4kl9IRBfg3rk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="XCryS-compile.diff"
Content-Transfer-Encoding: quoted-printable

Index: C/anaglyph.h
=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
--- C/anaglyph.h	(revision 1)
+++ C/anaglyph.h	(working copy)
@@ -78,10 +78,10 @@
    int screenheight,screenwidth;
 } CAMERA;
=20
-void HandleDisplay(struct Togl *togl);
-void CameraHome();
-void Normalise(XYZ *);
-XYZ  CalcNormal(XYZ,XYZ,XYZ);
+static void HandleDisplay(struct Togl *togl);
+static void CameraHome();
+static void Normalise(XYZ *);
+static XYZ  CalcNormal(XYZ,XYZ,XYZ);
=20
 #define DTOR            0.0174532925
 #define RTOD            57.2957795
Index: C/xcDisplayFunc.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
--- C/xcDisplayFunc.c	(revision 1)
+++ C/xcDisplayFunc.c	(working copy)
@@ -159,11 +159,11 @@
 void xcSolidBond (GLdouble radius, GLdouble height, int bondFlag);=20
 void xcSolidCone (GLdouble baseradius, GLdouble topradius, GLdouble height=
);=20
 static int CalcTessFactor(void);
-static void HandleDisplay(struct Togl *togl);
+void HandleDisplay(struct Togl *togl);
 static void draw_scene(void);
-static void CameraHome(void);
-static void Normalise(XYZ *p);
-static XYZ CalcNormal(XYZ p, XYZ p1, XYZ p2);
+void CameraHome(void);
+void Normalise(XYZ *p);
+XYZ CalcNormal(XYZ p, XYZ p1, XYZ p2);
=20
 /* --- extern function prototypes ---  */
 extern int MakeSticks1(int i,

--4Epv4kl9IRBfg3rk--

--7cm2iqirTL37Ot+N
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

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

iD8DBQFEBewLH0o2mefAfsQRAturAJ9LqE4Vait6Hi+OfLgO9YKR4jlojwCeJ7b3
FW8NkLcr12EcItI14f2SCw4=
=o5yO
-----END PGP SIGNATURE-----

--7cm2iqirTL37Ot+N--