no longer using sinf/cosfsqrtf in fg_geometry, no need for all this
authorDiederick Niehorster <dcnieho@gmail.com>
Mon, 21 May 2012 09:36:23 +0000 (09:36 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Mon, 21 May 2012 09:36:23 +0000 (09:36 +0000)
extra boilerplate

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1319 7f0cb862-5218-0410-a997-914c9d46530a

CMakeLists.txt
config.h.in
src/fg_geometry.c

index 2277d70..f2e2c1e 100644 (file)
@@ -245,9 +245,6 @@ CHECK_INCLUDE_FILES(sys/ioctl.h HAVE_SYS_IOCTL_H)
 CHECK_INCLUDE_FILES(fcntl.h    HAVE_FCNTL_H)
 CHECK_INCLUDE_FILES(errno.h    HAVE_ERRNO_H)
 CHECK_INCLUDE_FILES(usbhid.h   HAVE_USBHID_H)
-CHECK_FUNCTION_EXISTS(sinf      HAVE_SINF)
-CHECK_FUNCTION_EXISTS(cosf      HAVE_COSF)
-CHECK_FUNCTION_EXISTS(sqrtf     HAVE_SQRTF)
 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
 CHECK_FUNCTION_EXISTS(vfprintf  HAVE_VFPRINTF)
 CHECK_FUNCTION_EXISTS(_doprnt   HAVE_DOPRNT)
index 8d7f60d..823ff07 100644 (file)
@@ -13,9 +13,6 @@
 #cmakedefine HAVE_GETTIMEOFDAY
 #cmakedefine HAVE_VFPRINTF
 #cmakedefine HAVE_DOPRNT
-#cmakedefine HAVE_SINF
-#cmakedefine HAVE_COSF
-#cmakedefine HAVE_SQRTF
 #cmakedefine NEED_XPARSEGEOMETRY_IMPL
 #cmakedefine HAVE_STDINT_H
 #cmakedefine HAVE_INTTYPES_H
index f4f5056..57301a0 100644 (file)
 #include "fg_gl2.h"
 #include <math.h>
 
-/* VC++6 in C mode doesn't have C99's sinf/cos/sqrtf */
-#ifndef HAVE_SINF
-#define sinf(x) (float)sin((double)(x))
-#endif
-#ifndef HAVE_COSF
-#define cosf(x) (float)cos((double)(x))
-#endif
-#ifndef HAVE_SQRTF
-#define sqrtf(x) (float)sqrt((double)(x))
-#endif
-
 /* declare for drawing using the different OpenGL versions here so we can
    have a nice code order below */
 #ifndef GL_ES_VERSION_2_0
@@ -987,8 +976,8 @@ static void fghCircleTable(GLfloat **sint, GLfloat **cost, const int n, const GL
 
     for (i=1; i<size; i++)
     {
-        (*sint)[i] = sinf(angle*i);
-        (*cost)[i] = cosf(angle*i);
+        (*sint)[i] = (GLfloat)sin(angle*i);
+        (*cost)[i] = (GLfloat)cos(angle*i);
     }
 
     
@@ -1106,8 +1095,8 @@ void fghGenerateCone(
     const GLfloat rStep = (GLfloat)base / ( ( stacks > 0 ) ? stacks : 1 );
 
     /* Scaling factors for vertex normals */
-    const GLfloat cosn = ( (GLfloat)height / sqrtf( height * height + base * base ));
-    const GLfloat sinn = ( (GLfloat)base   / sqrtf( height * height + base * base ));
+    const GLfloat cosn = (GLfloat) (height / sqrt( height * height + base * base ));
+    const GLfloat sinn = (GLfloat) (base   / sqrt( height * height + base * base ));