From: Sven Panne Date: Fri, 8 Jul 2005 12:48:58 +0000 (+0000) Subject: Made a few global arrays "static", avoiding namespace pollution. The only X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=478f9b0aad4850fedd04e031f890d565e540ad35;p=freeglut Made a few global arrays "static", avoiding namespace pollution. The only externally visible symbols should either be from the GLUT API ("glutXXX") or internal freeglut entities ("fgYYY"). Reformatted things a bit on the way. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@671 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/ChangeLog b/ChangeLog index f1e6bb7..388bfed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1110,3 +1110,8 @@ obscure, though... redisplayed *and* it is visible. Otherwise we won't redraw, anyway, and immediately discover that there's still something to do, etc. etc., leading to 100% CPU load. + +(289) Made a few global arrays "static", avoiding namespace pollution. The +only externally visible symbols should either be from the GLUT API +("glutXXX") or internal freeglut entities ("fgYYY"). Reformatted things a +bit on the way. diff --git a/src/freeglut_geometry.c b/src/freeglut_geometry.c index b41b5b7..0b17793 100644 --- a/src/freeglut_geometry.c +++ b/src/freeglut_geometry.c @@ -960,14 +960,43 @@ void FGAPIENTRY glutSolidTetrahedron( void ) /* * */ -double icos_r[12][3] = { { 1.0, 0.0, 0.0 }, - { 0.447213595500, 0.894427191000, 0.0 }, { 0.447213595500, 0.276393202252, 0.850650808354 }, { 0.447213595500, -0.723606797748, 0.525731112119 }, { 0.447213595500, -0.723606797748, -0.525731112119 }, { 0.447213595500, 0.276393202252, -0.850650808354 }, - { -0.447213595500, -0.894427191000, 0.0 }, { -0.447213595500, -0.276393202252, 0.850650808354 }, { -0.447213595500, 0.723606797748, 0.525731112119 }, { -0.447213595500, 0.723606797748, -0.525731112119 }, { -0.447213595500, -0.276393202252, -0.850650808354 }, - { -1.0, 0.0, 0.0 } } ; -int icos_v [20][3] = { { 0, 1, 2 }, { 0, 2, 3 }, { 0, 3, 4 }, { 0, 4, 5 }, { 0, 5, 1 }, - { 1, 8, 2 }, { 2, 7, 3 }, { 3, 6, 4 }, { 4, 10, 5 }, { 5, 9, 1 }, - { 1, 9, 8 }, { 2, 8, 7 }, { 3, 7, 6 }, { 4, 6, 10 }, { 5, 10, 9 }, - { 11, 9, 10 }, { 11, 8, 9 }, { 11, 7, 8 }, { 11, 6, 7 }, { 11, 10, 6 } } ; +static double icos_r[12][3] = { + { 1.0, 0.0, 0.0 }, + { 0.447213595500, 0.894427191000, 0.0 }, + { 0.447213595500, 0.276393202252, 0.850650808354 }, + { 0.447213595500, -0.723606797748, 0.525731112119 }, + { 0.447213595500, -0.723606797748, -0.525731112119 }, + { 0.447213595500, 0.276393202252, -0.850650808354 }, + { -0.447213595500, -0.894427191000, 0.0 }, + { -0.447213595500, -0.276393202252, 0.850650808354 }, + { -0.447213595500, 0.723606797748, 0.525731112119 }, + { -0.447213595500, 0.723606797748, -0.525731112119 }, + { -0.447213595500, -0.276393202252, -0.850650808354 }, + { -1.0, 0.0, 0.0 } +}; + +static int icos_v [20][3] = { + { 0, 1, 2 }, + { 0, 2, 3 }, + { 0, 3, 4 }, + { 0, 4, 5 }, + { 0, 5, 1 }, + { 1, 8, 2 }, + { 2, 7, 3 }, + { 3, 6, 4 }, + { 4, 10, 5 }, + { 5, 9, 1 }, + { 1, 9, 8 }, + { 2, 8, 7 }, + { 3, 7, 6 }, + { 4, 6, 10 }, + { 5, 10, 9 }, + { 11, 9, 10 }, + { 11, 8, 9 }, + { 11, 7, 8 }, + { 11, 6, 7 }, + { 11, 10, 6 } +}; void FGAPIENTRY glutWireIcosahedron( void ) { @@ -1018,19 +1047,52 @@ void FGAPIENTRY glutSolidIcosahedron( void ) /* * */ -double rdod_r[14][3] = { { 0.0, 0.0, 1.0 }, - { 0.707106781187, 0.000000000000, 0.5 }, { 0.000000000000, 0.707106781187, 0.5 }, { -0.707106781187, 0.000000000000, 0.5 }, { 0.000000000000, -0.707106781187, 0.5 }, - { 0.707106781187, 0.707106781187, 0.0 }, { -0.707106781187, 0.707106781187, 0.0 }, { -0.707106781187, -0.707106781187, 0.0 }, { 0.707106781187, -0.707106781187, 0.0 }, - { 0.707106781187, 0.000000000000, -0.5 }, { 0.000000000000, 0.707106781187, -0.5 }, { -0.707106781187, 0.000000000000, -0.5 }, { 0.000000000000, -0.707106781187, -0.5 }, - { 0.0, 0.0, -1.0 } } ; -int rdod_v [12][4] = { { 0, 1, 5, 2 }, { 0, 2, 6, 3 }, { 0, 3, 7, 4 }, { 0, 4, 8, 1 }, - { 5, 10, 6, 2 }, { 6, 11, 7, 3 }, { 7, 12, 8, 4 }, { 8, 9, 5, 1 }, - { 5, 9, 13, 10 }, { 6, 10, 13, 11 }, { 7, 11, 13, 12 }, { 8, 12, 13, 9 } } ; -double rdod_n[12][3] = { - { 0.353553390594, 0.353553390594, 0.5 }, { -0.353553390594, 0.353553390594, 0.5 }, { -0.353553390594, -0.353553390594, 0.5 }, { 0.353553390594, -0.353553390594, 0.5 }, - { 0.000000000000, 1.000000000000, 0.0 }, { -1.000000000000, 0.000000000000, 0.0 }, { 0.000000000000, -1.000000000000, 0.0 }, { 1.000000000000, 0.000000000000, 0.0 }, - { 0.353553390594, 0.353553390594, -0.5 }, { -0.353553390594, 0.353553390594, -0.5 }, { -0.353553390594, -0.353553390594, -0.5 }, { 0.353553390594, -0.353553390594, -0.5 } - } ; +static double rdod_r[14][3] = { + { 0.0, 0.0, 1.0 }, + { 0.707106781187, 0.000000000000, 0.5 }, + { 0.000000000000, 0.707106781187, 0.5 }, + { -0.707106781187, 0.000000000000, 0.5 }, + { 0.000000000000, -0.707106781187, 0.5 }, + { 0.707106781187, 0.707106781187, 0.0 }, + { -0.707106781187, 0.707106781187, 0.0 }, + { -0.707106781187, -0.707106781187, 0.0 }, + { 0.707106781187, -0.707106781187, 0.0 }, + { 0.707106781187, 0.000000000000, -0.5 }, + { 0.000000000000, 0.707106781187, -0.5 }, + { -0.707106781187, 0.000000000000, -0.5 }, + { 0.000000000000, -0.707106781187, -0.5 }, + { 0.0, 0.0, -1.0 } +} ; + +static int rdod_v [12][4] = { + { 0, 1, 5, 2 }, + { 0, 2, 6, 3 }, + { 0, 3, 7, 4 }, + { 0, 4, 8, 1 }, + { 5, 10, 6, 2 }, + { 6, 11, 7, 3 }, + { 7, 12, 8, 4 }, + { 8, 9, 5, 1 }, + { 5, 9, 13, 10 }, + { 6, 10, 13, 11 }, + { 7, 11, 13, 12 }, + { 8, 12, 13, 9 } +}; + +static double rdod_n[12][3] = { + { 0.353553390594, 0.353553390594, 0.5 }, + { -0.353553390594, 0.353553390594, 0.5 }, + { -0.353553390594, -0.353553390594, 0.5 }, + { 0.353553390594, -0.353553390594, 0.5 }, + { 0.000000000000, 1.000000000000, 0.0 }, + { -1.000000000000, 0.000000000000, 0.0 }, + { 0.000000000000, -1.000000000000, 0.0 }, + { 1.000000000000, 0.000000000000, 0.0 }, + { 0.353553390594, 0.353553390594, -0.5 }, + { -0.353553390594, 0.353553390594, -0.5 }, + { -0.353553390594, -0.353553390594, -0.5 }, + { 0.353553390594, -0.353553390594, -0.5 } +}; void FGAPIENTRY glutWireRhombicDodecahedron( void ) {